G
Guest
I have an existing MFC c++ ocx control that I need to work with a c# class.
If I use a locally defined data structure, everything works. For example,
in my C++ app I declare.
MyCSharpClass DataStructure;
To use the data structure in my c# class I use
DataAccess::Select(%DataStructure);
This works great.
However, when I retreive my DataStructure from the MFC C++ ocx control, I
can not pass the structure to the c# class, I get compile errors. For example
char* pDataStructure;
//ocx call returns a pointer to the data structure
myControl.GetData(pDataSturcture);
Now I need pass (by reference) the data structure to a c# class.
I have tried:
DataAccess::Select(pDataStructure);
as well as other variations to cast the data structure to the c# class.
The data structures in the C++ ocx and the c# class are identical. The data
is allocated on the heap.
How can I pass the pointer returned from my control to the c# class.
Thanks for any assistance.
If I use a locally defined data structure, everything works. For example,
in my C++ app I declare.
MyCSharpClass DataStructure;
To use the data structure in my c# class I use
DataAccess::Select(%DataStructure);
This works great.
However, when I retreive my DataStructure from the MFC C++ ocx control, I
can not pass the structure to the c# class, I get compile errors. For example
char* pDataStructure;
//ocx call returns a pointer to the data structure
myControl.GetData(pDataSturcture);
Now I need pass (by reference) the data structure to a c# class.
I have tried:
DataAccess::Select(pDataStructure);
as well as other variations to cast the data structure to the c# class.
The data structures in the C++ ocx and the c# class are identical. The data
is allocated on the heap.
How can I pass the pointer returned from my control to the c# class.
Thanks for any assistance.