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

standard DLL custom action


1 reply to this topic

josephine

josephine
  • Members
  • 1 posts

Posted 17 January 2002 - 16:46

Hi,

I am using a custom action which calls a standard dll. The DLL returns a string which sets a property.  But the DLL is crashed.

The fuction prototype of the DLL looks as follows:

extern "C"
LPSTR  WINAPI MyFunction()

What's wrong with this?

If I try the following:
extern "C"
void WINAPI MyFunction(LPSTR& property)

The DLL won't crash, but the property (which I specify as an inout String) couldnot be set correctly.

Can anyone advise me the right way to return a string value of a standard dll to be called by a custom action?

Thanks,
Josephine


shaun

shaun
  • Members
  • 11 posts

Posted 18 January 2002 - 22:27

You cant  set a property directly like this you need to call the function without passing it any parameters and when u define the function u define it with parameter MSIHANDLE hInstall, u then use this with a function from msi.h / msiquery.h to modify your installer with properties etc....

eg

UINT __stdcall SetMyProperty(MSIHANDLE hInstall)
{
MsiSetProperty(hInstall, "INSTALL_MDAC", NULL);

return ERROR_SUCCESS;
}