PDA

View Full Version : Can not find the entry point of function 'Action3', make sure it is exported



manoj.vibhute
12-04-2006, 01:58 AM
Unable to find export function

Installshield 11.5 express

I have created a win32 dll as specified in the help using sample code and function is exported using .def file. I have tested the function using one of the MFC exe and function gets called in that exe.
But when I tried to use this dll as a custom action with following parameters, Setup file gets created.
When setup is run it gives error that "Can not find the entry point of function 'Action3', make sure it is exported"

Custom action is configured as follow
Source location: Browse file system
FileName: G:\R&DOnCallingDllFromExpressSetup\ExpressDll\ExpressWin32Dll\Debug\ExpressWin32Dll.dll
Function name: Action3
Function signature: new
Wait for action: Yes
Run Once: No
Ignore exit code: No
Comments:
Condition: No Conditions

I have added this custom action under "After destination folder Dialog"

Function exported is as follow:
UINT __stdcall Action3(MSIHANDLE hInstall)
{

TCHAR buffer[32] = {0};

DWORD dWord = 32;

MsiGetProperty(hInstall, TEXT("ProductName"), buffer, &dWord);

MessageBox(0,buffer,TEXT("Showing Product Name"), MB_OK);

return 1;

}

.def file is as follow
; ExpressWin32Dll.def : Declares the module parameters for the DLL.

LIBRARY "ExpressWin32Dll"
DESCRIPTION 'ExpressWin32Dll Windows Dynamic Link Library'

EXPORTS
; Explicit exports can go here
Action3 @1

MichaelU
12-04-2006, 12:19 PM
You might want to take a look at your DLL using Dependency Walker. I suspect the @1 might be throwing it off somehow and not really using the function name you expect. If that's the case you can choose whether to adjust your .def file or your invocation.

manoj.vibhute
12-05-2006, 06:19 AM
I have checked the things with dependency walker, but everything was fine.

Finally It worked out with following chnages, which does not seems to be logical, I might required to check whether I have done anything else.


Run Once: Yes //changed from No
Ignore exit code: Yes //changed from No

TsungH
12-05-2006, 09:00 PM
When you set Ignore exit code to yes, Windows Installer will continue even when custom action does encounter an error.

The problem I see in your custom action code is that it tries to return 1. It should return ERROR_SUCCESS, instead of a hardcoded numeric value.