Connecting Tech Pros Worldwide Forums | Help | Site Map

Reg: calling the functions form C++ DLL in C# safely

Newbie
 
Join Date: Sep 2007
Posts: 9
#1: Oct 11 '07
Hi,

I am having a dll function with the following signature.

Vstatus ncdGetDriverConfig ( int* pChanCount,VDriverConfig* pDriverConfig)

Where Vstatus and VDriverConfig are structure

how to define the above function in C# using DLL import

Regards,
Srinivas.P



Shashi Sadasivan's Avatar
Moderator
 
Join Date: Aug 2007
Location: Brisbane, Australia
Posts: 1,414
#2: Oct 11 '07

re: Reg: calling the functions form C++ DLL in C# safely


Quote:

Originally Posted by psree

Hi,

I am having a dll function with the following signature.

Vstatus ncdGetDriverConfig ( int* pChanCount,VDriverConfig* pDriverConfig)

Where Vstatus and VDriverConfig are structure

how to define the above function in C# using DLL import

Regards,
Srinivas.P

Hi,
Unfortunately I havent used pointers ever since i tooka jump into .Net :(
however, look at this link
they have some dicussion about the same thing, and it looks typesafe expecially I think IntPtr is considered safe code.
If not you can still use pointers as you do in C++ but will have to mark the block as unsafe

cheers
Reply


Similar .NET Framework bytes