|
I think its a fairly simple question.. I'm just not that
experienced in Managed code yet...
The question is, How do you allocate a block of memory in
Managed code (Managed VC++ DLL) and pass the pointer over to an unmanaged DLL
(Written in VC++ 7.1) so that this memory block can be filled with
data.
I've tried using: (Managed VC++ DLL)
UBYTE __pin *pDataPtr =
NULL;
pDataPtr = (UBYTE *)new char[dwDataSize]; But that doesn't work.. It compiles, But when you call the
function in VB.Net it fails with this error:
An unhandled exception of type
'System.NullReferenceException' occurred in
cdmsclientdotnet.dll
Additional information: Object reference not set to an instance of an object. This is where I'm stuck! Any ideas?
My guess here is because of Manage code and the Garbage
Collector, You don't really get a "real" memory pointer, when calling new, But
more of a handle. But how do I get the real memory pointer to pass to
unmanaged code?
|
_______________________________________________ msvc mailing list [email protected] See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for subscription changes, and list archive.
