Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am facing this problem

 

1. I have to load a C++ DLL into my C# code.

 

2. The method in the DLL which i want to access is

 

GetNames(&strCStringArrayClass)

 

This method takes a pointer to the CStringArray Class Object and populates the array of strings.

 

If I use DllImport (pInvoke) method, how should i write the prototype for the exported method???

 

is there any other way of doing this?

 

Please Help

Posted (edited)
I believe u will need to use c++.net for this. I cannot think of a way to create a CStringArray object in c# to be passed to the c++ method. Edited by HJB417
  • *Experts*
Posted

I believe if you declare the parameter as the IntPtr type, you can just pass the

method directly to the DLL and marshalling will convert the method into a pointer.

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...