![]() |
Create Dll C++ in VS 2015 compatible with Inno Setup
Hi! I would like to know if you can help create a post that explains in detail how to create a C ++ Dll Compatible with Inno Setup, since for some time I have not been able to do it in a stable way, to achieve this come here to see if they can help me. my problem is always the same, the Dll does not run on a PC in which it has not been compiled ... I do not explain how this happens but I invite you to look at this code. and tell me if it contains errors or something. Name of DLL is IsFunc.dll for now it only contains a single function exported .. because it is not necessary to show all the source code if the error is always given ... with any number of internal functions or exporteds. Header.h Code:
#pragma onceDllMain.cpp Code:
#include "Header.h"IsFunc.cpp Code:
#include "Header.h"Defin.def Code:
LIBRARY "IsFunc"The purpose of the GetAppHandle function is to get the Application.Handle which can not be obtained in version 5.5.9 of Inno Setup. I know that you can get this value without any Dll but it is indispensable that the Dll conosca the value of the Application.Handle so that the other functions that I will show you can work ... Personally I do not like working with Inno Setup version 5.5.1 Advance .. I prefer version 5.5.9 for the new features .. :cool: Inno Setup Script Code:
[Setup]Code:
function GetAppHandle(): Longint;https://i.imgur.com/lERzZQA.jpg During compilation there are no errors or anything .. It works perfectly in the image you see the value obtained by the function GetAppHandle https://i.imgur.com/3posUP7.jpg And here is the problem .. :mad: but if I try on another PC this happens :mad: Apparently it's as if the linked function does not exist.?? :confused: And after performing debugging tests with VS I realized that the Dll is loaded into memory and the code of the DllMain function is executed but it just does not connect to the other functions :confused: Despite my lack of experience in creating Dlls .. I have programming skills in the C ++, Delphi, Inno Setup, Java, PHP, HTML, and others languages and never had a problem of this type I think maybe I'm missing some property in the VS solution or maybe I'm creating it in the wrong way, to work on Inno Setup Thank you in advance for any help :D |
wow seems interesting I follow with pleasure, but unfortunately this is not a programming forum, let's see who goes on..:)
|
Code:
#include <windows.h>Code:
EXPORTS |
Thank you
Quote:
|
It does not work on another PC because the *.dll created/written, must be saved in the executable to be rewritten/read in other PC systems. Or at least I guess this is your problem..:confused::rolleyes:
|
Quote:
|
I'm going to upload the complete source code to see if that makes it easier to solve the problem.
|
Quote:
|
Quote:
|
Code:
HANDLE __stdcall MyHandle(void)Code:
extern "C" __declspec(dllexport) HANDLE MyHandle(void)Code:
|
Quote:
|
1 Attachment(s)
Quote:
-------------------------------------------------------------------- Update: -- c++ src updated english strings example -- Obj. Pascal (freepascal and Delphi) src added -- setup src and demo Note: (demo) C++ DLL require vcredist 2017! Install vcredist 2017: Code:
https://go.microsoft.com/fwlink/?LinkId=746571 |
Thank you..
Quote:
anyway, thank you. I'm going to upload a file so that you can test it all that you want, and I'd appreciate it if you inform me the result .. :D :D |
Update example!
|
Not Work.
1 Attachment(s)
Quote:
|
| All times are GMT -7. The time now is 10:46. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com