HighTechTalks DotNet Forums  

Creating data binding in managed code used by unmanaged code

Dotnet Framework (Interop) microsoft.public.dotnet.framework.interop


Discuss Creating data binding in managed code used by unmanaged code in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Stefan Soljemo
 
Posts: n/a

Default Creating data binding in managed code used by unmanaged code - 12-30-2007 , 04:30 PM






I have some existing classes written in C++ used to read PLC data. The
classes using some cind of data binding that looks like OLE-DB with an array
of structs. The data binding is done by using the C++ offsettof macro and the
classes using this information to calculate the address to each members of
the structs in the array.
I need to create a result set based on managed array of struct or datasets,
tell the existing classes how the structs looks like and indirectly writing
data to the members in the managed structs. I did some test with the
GCHandle::Alloc and GCHandle::FromIntPtr functions but are not able to
dynamically create pointers or handles in managed code because the IntPtr
does not impement the == operator.
Is it possible to do this? If so, where can I found samples. I using Visual
Studio 2005 and C# for the managed code and C++ for the unmanaged part. The
marshaling is supposed to be developed in C++.

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.