Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

import dll global variable 1

Status
Not open for further replies.

alexserban

Programmer
Mar 12, 2004
1
RO
I have a small DLL written in C (with Visual C++) that exports several functions and a global variable (a string).

The string is declared like this:
__declspec(dllexport) char x[20];

In a C# application I need to read this string, but I don't know how to declare it (I know how to import a function from a DLL - with the[DllImport....] attribute - but I don't know how to import a variable).

Could you give me a small example ?
Thank You.
 
I don't think you can import a variable.

But if you were to write a wrapper function around it, you could.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top