Pinvoke reading files, returning char * values.
- From: "anirudh" <anirudhgarg@xxxxxxxxx>
- Date: 4 Apr 2006 07:46:11 -0700
Hello,
I am trying to use an Win32 DLL developed using Visual C++ 6.0 in my
C# .net application.
The signature of the original function is as follows :
BOOL __stdcall GetXMLString(
const char* strInputFileName,
const char* strPassword,
char* strOutput,
char* strErrorMessage)
So, this function takes the path of a file and a password and returns
back a string.
I translated like this :
[DllImport("STLKit.dll", CharSet=CharSet.Auto )]
public static extern bool GetXMLString(string inputFileName,
string
password,
ref
StringBuilder output,
string
errorMessage);
However this is not working at all and the output parameter is being
populated by weird messages like "publictoken" or "Dependancy
Evaluated" and so on.
My questions are :
Are these the correct mappings ?
Could there be a problem sending a file path to the function ?
Any help/pointers would really be very appreciated.
Thanks,
Anirudh
.
- Follow-Ups:
- Re: Pinvoke reading files, returning char * values.
- From: Nicholas Paldino [.NET/C# MVP]
- Re: Pinvoke reading files, returning char * values.
- Prev by Date: Re: passing array to C DLL
- Next by Date: Re: Detecting if a File is in Use
- Previous by thread: Re: Active Directory 'lastLogon' time conversion...
- Next by thread: Re: Pinvoke reading files, returning char * values.
- Index(es):
Relevant Pages
|
Loading