cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
CrookedNose
Level 3

How do I return a STRING from standard DLL custom action?

InstallShield 2009 on Windows XP

I'm trying to set up a custom action that calls a function in a C++ DLL. The function returns a const char * which I want to interperet as a STRING and takes no parameters.

I don't have a problem calling the function. To verify that I call MessageBox() inside the function and the message box gets displayed.

My problem is that if I define the return type in IS as STRING, I get the informative message "The DLL being called encountered a problem." If I define the return type as POINTER I get a decimal representation of the pointer.

So I guess there's 2 ways of looking at the question. 1) How do I define the return type to interperet a char * as a STRING? 2) What do I return from the DLL function so that STRING can be used as the return type.

Thanks in advance.
Labels (1)
0 Kudos
(4) Replies
RobertDickau
Flexera Alumni

Before going down this road, if you're the author of the DLL, is it an option to make it an MSI DLL and have the string returned as a property value?
0 Kudos
CrookedNose
Level 3

RobertDickau wrote:
Before going down this road, if you're the author of the DLL, is it an option to make it an MSI DLL and have the string returned as a property value?


I am not the DLL author. I have the source, but I do not know how much lattitude I have for modifying it.

From your response though, it sounds like there isn't an easy way to get a string from a standard DLL.
0 Kudos
padmavj
Level 2

RobertDickau wrote:
Before going down this road, if you're the author of the DLL, is it an option to make it an MSI DLL and have the string returned as a property value?


Hi

What is MSI DLL? Is it specific to MSI?
If yes, is it possible to create MSI DLLs and use it as an utility in an MSI?
Installshield concepts are pretty new to me and any help would be appreciated
0 Kudos
CrookedNose
Level 3

I'm no expert on the matter but an MSI DLL functions have a particular signature and use MsiGetProperty and MsiSetProperty to transfer data between the DLL and the installer. The signature is:

#include "msi.h"
#include "msiquery.h"
UINT function_name (MSIHANDLE);

When you create a MSI project in InstallShield and create a custom action with the MSI DLL type, all you supply is _function_name@4 and IS takes care of the rest, including supplying the handle.

Now if I could just get someone to answer my question!!! Hello...Acresso? Anyone home?
0 Kudos