cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Abhishek_Batwar
Level 4

Calling a DLL from Suite Project

Hi All,

I am not able invoke a function as defined in this post Calling a Function in a DLL from a Wizard Page or Window in a Suite Installation

http://blogs.flexerasoftware.com/installtalk/2011/12/calling-a-function-in-a-dll-from-a-wizard-page-or-window-in-a-suite-installation.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+InstallTalk+%28Blog%3A+InstallTalk%29

has anyone succeed in this ? Please let me know

I have Created a Win32 project in VS 2008
updated the project with the code
"#include "stdafx.h"
#include
#import "C:\Program Files\InstallShield\2012\Redist\Language Independent\i386\SetupSuite.exe" no_namespace raw_interfaces_only named_guids


HRESULT __stdcall Action(IDispatch *pDispSuiteUIExtension)
{
CComQIPtr spSuiteUIExtenstion = pDispSuiteUIExtension;

long lResult = 0;
return spSuiteUIExtenstion->MessageBox(CComBSTR(L"Hello"), CComBSTR(L"DLL Action"), MB_OK, &lResult);
}
"
took the build and added the dll to the support files (Language Independent) of a suite project
Created a button in the instalWelcome Dialog
In the Action contol of the button added the call "{TestSuite::Action}"

plz help
Labels (1)
0 Kudos
(5) Replies
MichaelU
Level 12 Flexeran
Level 12 Flexeran

Did you export the Action function? You can tell by examining the DLL in Dependency Walker. Are there any indications in the suite /debuglog as to what happened?
0 Kudos
Abhishek_Batwar
Level 4

Hi Michael,
Thanks for reply...
I have export the Action Function like this...:-

extern "C"
{
__declspec(dllexport) HRESULT __stdcall Action(IDispatch *pDispSuiteUIExtension)
{
CComQIPtr spSuiteUIExtenstion = pDispSuiteUIExtension;

long lResult = 0;
return spSuiteUIExtenstion->MessageBox(CComBSTR(L"Hello"), CComBSTR(L"DLL Action"), MB_OK, &lResult);
}
}

but still the issue exists...Still I am not able to call a function from DLL.

one more thing, would you please tell me how to take Logs in Suite project so that I can view where is the problem, I think my DLL is not calling properly...
please help me...

thanks in Adv
Abhishek
0 Kudos
MichaelU
Level 12 Flexeran
Level 12 Flexeran

I don't see any problems with the code (other than that it doesn't return a specific value, but that would happen after the message box). See the list of blog posts about suites - in particular the one called "Troubleshooting Issues by Logging a Suite Installation" should tell you about logging.
0 Kudos
sidetnee
Level 5

Did you ever get anywhere with this problem? I am experiencing the same issue, started off writing my own action, this didn't work so i fell back to the example in the blog post.
This wouldn't work either!!

The error out of the log is a very generic

9-18-2012[01:37:00 PM]: UI DLL: Executing user custom action > {InstallationHelperWrapper::TestAction}
9-18-2012[01:37:00 PM]: UI DLL: Could not load custom function from user DLL: InstallationHelperWrapper.dll::TestAction

The function is visible in a dependency walker (at ordinal 2)

This area of the product seems very poorly documented, can we have some more specific details as to how this is meant to work.

Any clues/assistance greatly appreciated.

Regards,

/SiD
0 Kudos
hidenori
Level 17

Have you applied InstallShield 2012 SP1? Actions that call a function in a DLL require the patch. To obtain SP1, see Q201298: InstallShield 2012 Service Pack 1.
0 Kudos