use GetPrivateProfileString

N

Nhan

Hi,
I am trying to use the function GetPrivateProfileString as following:
[DllImport("kernel32.dll")]
public static extern Int32 GetPrivateProfileString(string lpAppName, string
lpKeyName, string lpDefault, string lpReturnedString, short nSize, string
lpFileName);

.......

String sDatabase = "";

Int32 lSize = GetPrivateProfileString("MyApp", "DataDatabase", "",
l_sDatabase, 255, "c:\\prj\\MyApp.ini");

lSize is now = 18, but l_sDatabase is still empty

How can I do?
How can I assign a string contained 255 char 0 to l_sDatabase?


Thanks

Nhan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

GetPrivateProfileString 1
GetProfileItem. 7
GetPrivateProfileString 5
GetPrivateProfileString 2
How is it work? 4
GetPrivateProfileString problem! 1
Reading an INI file 18
Reading INI File 1

Top