We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

Shreyans26
Posts: 18
Joined: Wed Jul 16, 2014 6:20 am

Call the Function from Custom DLL.

Hi,
I am trying to call the function ABC() inside the class XY which is in WXY.DLL.
I used the call the function from standard DLL method from the custom action tab of advanced Installer.

Here is the steps of what i DID :
I have added the full path of the DLL in Path section
then return type would be void as i am displaying message box for testing purpose.
and finally the name of the function ABC.

I am getting the error "The function ABC not found in the WXY DLL".

So please can u help me in what i m doing wrong?
Thanks,
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Call the Function from Custom DLL.

Hello and welcome to Advanced Installer forums,

This may happens if you didn't export your function from the .dll.

By the way, can you please tell us what .DLL are you using? Are you using the DTF C# approach?

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Shreyans26
Posts: 18
Joined: Wed Jul 16, 2014 6:20 am

Re: Call the Function from Custom DLL.

Hi,
Thanks for your reply.

I have written a public method ABC() inside class which is in my DLL. And i am trying to call the method ABC() from custom actions. Cant we call these methods?

As i am newbie to it , what is exporting the function from DLL?

I am not using DTF C# approach. Its a simple DLL (which created by building the project) not a native DLL file of my application.

Thanks,
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Call the Function from Custom DLL.

Hello,

In order to export a function from a .DLL, you can take a look on the Exporting from a DLL article with related information for hints and guidance.

However, you can also create your custom action as a DTF C# custom action and you don't have to worry about to export the function from the .DLL as the WiX toolset will help you creating the .dll custom action. Once built your custom action from Visual Studio you can pick up the function to execute using the predefined Call function from attached native DLL.

Should there be any difficulty you encounter implementing something, please do not hesitate to contact me and I will gladly assist.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Shreyans26
Posts: 18
Joined: Wed Jul 16, 2014 6:20 am

Re: Call the Function from Custom DLL.

Hi,
Thanks for Quick Reply and time,

I just want to ask can't we call the Function inside my own DLL which was created using building the solution?
Do i need to use the DTF C# custom action Dll and write the method init and use it?

For a calling a funtion in my DLL from custom action Tab, do i need to export the function?

Thanks,
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Call the Function from Custom DLL.

Hello,

You can add the: __declspec(dllexport) void Function1(void); statement before your function.

If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”