Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Passing a string to a DLL.


1 reply to this topic

tsquared

tsquared
  • Members
  • 6 posts

Posted 09 June 2003 - 17:53

Hi again,

I'm trying to pass a string to a DLL function in ISDev 7.02, and according to the documentation a STRING variable is UNICODE. However, when my DLL function receives it, it is ANSI, not UNICODE. The installscript code is:

prototype cdecl BOOL DLLFile.bDLLFunction(HWND, POINTER);

function OnFirstUIAfter()
HWND hwindow;
STRING szINFDir;
POINTER pszINFDir;
...
hwindow = GetWindowHandle(HWND_INSTALL);
szINFDir = INSTALLDIR;
pszINFDir = &szINFDir;
bDLLFunction(hwindow, pszINFDir);
...

Any idea why this is happening? Any way around it?

Thanks!

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 09 June 2003 - 21:36

I believe that string variables are represented in Unicode internally, but converted to 8bit when passed to a DLL.