managed-c++

Arrays of strings in Managed C++

拟墨画扇 提交于 2019-12-05 03:43:05
I'm trying to write an application in Managed C++, but I cannot work out how to declare an array of strings. String^ linet[]; throws an error 'System::String ^' : a native array cannot contain this managed type So I suppose there's a different way to do this for managed data types. What exactly is it? Do you really mean Managed C++? Not C++/CLI? Assuming you're actually using C++/CLI (because of the error message you posted), there are two ways to do this: array<String^>^ managedArray = gcnew array<String^>(10); will create a managed array, i.e. the same type as string[] in C#. gcroot<String^>

Are there any code analysis tools that will make my job easier? [closed]

时光总嘲笑我的痴心妄想 提交于 2019-12-05 03:28:39
Closed. This question is off-topic . It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I have recently inherited a program written in Managed C++ from some guy who just retired. After spending some time digging through it, I can honestly say that at least 95% of it belongs on thedailywtf . However, I am now tasked with modifying it and porting it over to a language I'm comfortable with. The program itself takes in many many parameters (50+) read in from a file and performs a series of calculations

Will Windows 8 Metro support managed c++/cli

青春壹個敷衍的年華 提交于 2019-12-04 03:36:39
问题 I can't seem to find an answer to this question anywhere, but will metro support managed c++ ?? Right now in Visual Studios 2012 RC it does not (in Metro only). I have some frameworks written in c++/cli and wanted to port them to Metro. I know c++/cx is similar, but my c++/cli objects derive from ones written in C# and it would suck to have to rewrite that part of my system (but ok if I do, I just need to know where to go from here). If there are plans to support it when Windows 8 actually

How to call managed C++ methods from Un-managed C++

倖福魔咒の 提交于 2019-12-04 03:30:38
问题 PLEASE SEE UPDATE BELOW (RESOLVED) Also I have extended this into a second question here Implement a C# DLL COM File In Unmanaged C++ Program I have researched this to the end of the internet without finding a real, understandable, human example of how to do this. I have a C# DLL that encrypts and decrypts text. I don't want to / don't have the intellectual capability to rewrite this in C++ un-managed code. So instead I created a C++/CLR class that interfaces with the C# dll. NOW I need to

Managed C++ Assembly Attributes

◇◆丶佛笑我妖孽 提交于 2019-12-04 03:27:35
Is there a way to add assembly attributes to a Managed C++ assembly? In a typical C# project, there is usually a line of code in the AssemblyInfo.cs file like the following one: [assembly: AssemblyTitle("Some Assembly")] I have a private assembly attribute that I want to add (not one of the version attributes that could be added through a resource file), and I am not sure if this is possible. It is possible - the easy way is to add an AssemblyInfo.cpp file and put: #include attributes.h //your attribute decl [assembly: MyCustomAttribute()]; It can be in any file you want, though. edit - added

The speed of .NET in numerical computing

本秂侑毒 提交于 2019-12-03 04:22:50
问题 In my experience, .NET is 2 to 3 times slower than native code. (I implemented L-BFGS for multivariate optimization). I have traced the ads on stackoverflow to http://www.centerspace.net/products/ the speed is really amazing, the speed is close to native code. How can they do that? They said that: Q. Is NMath "pure" .NET? A. The answer depends somewhat on your definition of "pure .NET". NMath is written in C#, plus a small Managed C++ layer. For better performance of basic linear algebra

The speed of .NET in numerical computing

余生长醉 提交于 2019-12-02 17:37:36
In my experience, .NET is 2 to 3 times slower than native code. (I implemented L-BFGS for multivariate optimization). I have traced the ads on stackoverflow to http://www.centerspace.net/products/ the speed is really amazing, the speed is close to native code. How can they do that? They said that: Q. Is NMath "pure" .NET? A. The answer depends somewhat on your definition of "pure .NET". NMath is written in C#, plus a small Managed C++ layer. For better performance of basic linear algebra operations, however, NMath does rely on the native Intel Math Kernel Library (included with NMath). But

pcl_visualizer.h - fatal error LNK1120: 1 unresolved externals

╄→尐↘猪︶ㄣ 提交于 2019-12-02 09:45:40
error LNK2001: unresolved external symbol "public: virtual void __cdecl pcl::visualization::PCLVisualizer::FPSCallback::Execute(class vtkObject *,unsigned long,void *)" (?Execute@FPSCallback@PCLVisualizer@visualization@pcl@@UEAAXPEAVvtkObject@@KPEAX@Z) 1>C:\Users\hatea\Documents\Visual Studio 2015\Projects\PCLTester\x64\Debug\PCLTester.dll : fatal error LNK1120: 1 unresolved externals I have thoroughly exhausted all avenues dealing with this issue. I checked here, and I found a similar question/answer series: error LNK2001 when including "pcl_visualizer.h" The problem is that I do not want to

Cast native pointer to a C++\CLI managed object reference?

故事扮演 提交于 2019-12-02 04:46:18
问题 I have a callback that is called through a delegate. Inside it I will need to treat the buffer data that arrive from a record procedure. Normally in a unmanaged context I could do a reinterpret_cast on dwParam1 to get the object reference. But in a manged context how can I cast a DWORD_PTR to a managed object ref? static void WaveInProc(HWAVEIN hwi, UINT uMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2) { ControlLib::SoundDevice^ soudDevice = ?cast_native2managed?(dwParam1);

Cast native pointer to a C++\\CLI managed object reference?

谁都会走 提交于 2019-12-02 02:26:07
I have a callback that is called through a delegate. Inside it I will need to treat the buffer data that arrive from a record procedure. Normally in a unmanaged context I could do a reinterpret_cast on dwParam1 to get the object reference. But in a manged context how can I cast a DWORD_PTR to a managed object ref? static void WaveInProc(HWAVEIN hwi, UINT uMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2) { ControlLib::SoundDevice^ soudDevice = ?cast_native2managed?(dwParam1); Here ya go, more or less what gcroot (per my comment above) does: using namespace System; using