Link to home
Start Free TrialLog in
Avatar of Lachlan MacColl
Lachlan MacCollFlag for Australia

asked on

Problem with old GetPrivateProfileString

I am using GetPrivateProfileString to retrieve some data for a program I am working on. Can anyone tell me why the code below does not work as well as which it often breaks at runtime.

LPCTSTR lpAppName2;
LPCTSTR lpKeyName2;
LPCTSTR lpDefault;
LPTSTR  lpReturnedString;
DWORD   nSize;
LPCTSTR lpFileName2;

	GetPrivateProfileString(
		lpAppName2 = TEXT ("Section11"),
		lpKeyName2 = TEXT ("FirstKey1"),
		lpDefault  = TEXT ("String Not Found") ,
		lpReturnedString ,
		nSize ,
		lpFileName2 = TEXT ("c:\\aa\\test2.ini")
		);
	Application->ProcessMessages();
	ShowMessage(lpReturnedString);

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Lachlan MacColl

ASKER

Thanks very much for the quick help :).
You are welcome.