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

Problem calling a standard DLL function returning string.


3 replies to this topic

Rastislav Zima

Rastislav Zima
  • Members
  • 34 posts

Posted 12 June 2001 - 10:33

I have a problem using the standard DLL (stored in the Binary table) functions that are returning the string.
The function is entered but than on returning from the function I got error "The DLL being called is crashed" - I dont know how function should be declared so that it can pass the string value back to the installation. Passing string values through output parameter of the function which is declared as LPSTR works fine - also returning a number from the function works.

Can anybody help me?


ianmw7

ianmw7
  • Members
  • 55 posts

Posted 28 June 2001 - 14:29

not sure how you would get a DLL to return a string, since it would require memory allocation in the DLL, and at the best you'd be getting a memory leak. You can pass in a string and return the address of that. You can return a static string provided you use it before the DLL is unloaded. Not sure how any of this works with the DLL in the binary table - but since I have to do one myself, I may be about to learn something!

Irina

Irina
  • Members
  • 227 posts

Posted 28 June 2001 - 19:46

Hello,
I think you can't receive back from your CA to Windows Installer any strings. You can return only error
code "success" or "failed".
BUT! You can set inside your DLL MSI property (like MYPROPERTY) and then use this property in your installation later when you want to use it.
Hope, it helps,

Rastislav Zima

Rastislav Zima
  • Members
  • 34 posts

Posted 03 July 2001 - 13:53

You can receive strings from CA - following code works, but I think that there is a limit of 65535 (allocated by ISWI) chars for the output string.

STDAPI GetString(char* szOut)
{
   strcpy( szVer, "Hello!" );
   return 0;
}

The target of the CA should be in this case:
void DLLName::GetString(out STRING=[PropertyName])
and type can be for example 131072 (standard DLL stored in binary table)