managed-c++

ActiveX object is not receiving fired events

i, I`ve written a class A and implemented it in an Active X object (AXObj). Class A should also receive events fired from another object(O2). O2 is created inside A and I use EasyAdivse to connect the two objects, i.e. O2 is the event source. I know O2 is exists because I am able to directly call functions that O2 implements from with...

Best practice of sending array from native code to managed code(C++/CLI)?

I'm writing a win32 dll for read/write USB HID device. The data for exchange is a 64 byte unsigned char array. The client program is written in C++/CLI. In order to achieve max speed and minimum overhead, I need an efficient way to sending the array to managed client. There are two options I can think of right now: Native: use PostMe...

Using C++ class functions in C#

You can use a C++ class in a C# project by registering the C++ DLL in your C# project. My problem is that one of the C++ class has a function which has 4 parameters, 2 of which are of the type wchar_t, which is not available in C#. How can I use this function in my C# code? ...

LNK2022 Error When Using /clr

I'm having a problem linking a C++ project in VS2008 when using the /clr compile option. I am getting the following build errors: Class1.obj : error LNK2022: metadata operation failed (8013118D) : Inconsistent layout information in duplicated types (_PROPSHEETPAGEA): (0x0200046f). Class1.obj : error LNK2022: metadata operation failed (...

Marshal void* to array<byte>^

I am looking to write a void* buffer to a MemoryStream in a C++/CLI. As I don't think this is possible directly, alternatively I would like to convert this buffer to an array<byte>^ in order to be able to call Stream.Write(). I've looked at Marshal but then I am having trouble coverting void* to System::IntPtr. Any help is appreciated. ...

C++/CLI : Why can't I pass Strings by reference?

Why doesn't Microsoft's C++/CLI allow me to pass strings by reference? I received the following error: C3699: '&': cannot use this indirection on type 'System::String' ...

managed c++ strong name/signing

How can I sign a managed c++ dll with a .pfx file?? Or is there a way to include the unsigned managed c++ dll in a signed c# project? I realy dont need a signed dll I just need VS to stop giving me the Error "Referenced assembly 'SlimDX' does not have a strong name." in my c# project that must be signed. ...

How can i draw a graph with Date Axis using c++ and zedgraph

I have successfully used the c++ example project to draw graphs from my c++ project using zedgraph. However there is no example with Date axis for c++. The following code is taken from the c# example found here http://zedgraph.org/wiki/index.php?title=Tutorial:Date_Axis_Chart_Demo. Please see my comments with the text //JEM// to see wh...

Using dependency property in WPF

I have a readonly .NET property exposed from a managed wrapper which gets the name of the database, let's say the property name is DBName. The DBName may vary depending upon the database connected to the WPF application. This property getter and setter also resides inside the managed .NET wrapper. I am using this(DBName) property in my...

cli c++ listView issue

I want to create a listView that have 8 groups (Group0,Group1,...) and six columns,the format like this way Group0 XXX_0Y11_r value XXX_0Y11_w value ZZZ_(11) tt XXX_0Y12_r value XXX_0Y12_w value ZZZ_(12) tt XXX_0Y21_r value XXX_0Y21_w value ZZZ_(21) tt XXX_0Y22_r value XXX_0Y22_w value ZZZ_(22) tt QQQ_01 ...

Generating a COM visible assembly from managed c++ (C++/CLI)

Hello, I need to develop some classes that should be callable from VB6 with Managed C++ (C++/CLI). I've developed first a sample in C# and I can use the assembly through COM without problems just using the setting "Register for COM interop" and "Make assembly COM visible" (and using the attribute [ClassInterface(ClassInterfaceType.Aut...

binary '=' : no operator found which takes a right-hand operand of type 'gcroot<T> *' error with VS2010

This is a Windows Forms Application project using Visual Studio 2010. That being said: I've an unmanaged 'Vector' implementation, something like: template<class T> class Vector { public: T* data; unsigned len; (...constructors and operators overloading like =, [], == and !=) }; It works great. I've done several tests bef...

Is it possible to use boost::serialization with managed class?

We have a lot of native c++ classes that are serialized perfectly using boost::serialization. Now we want to change some of their member fields to property, so we could use them in PropertyGrids. When we changed the class definiction to ref class X, we got a huge number of these compilation errors: #1: error C2893: Failed to specialize...