|
|
#1 |
|
Junior Member
Join Date: May 2006
Posts: 3
|
exDll with MFC Support
Has anyone a template that can be linked? (XP & VC7)
I stumbled around for a long time and read a lot of threads. C++ is not the issue, but using normal Mfc functions like registry and other bumpf behind it would be a nice feature. NetDiver030 |
|
|
|
|
|
#2 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
Doesn't creating MFC DLL with the VC wizards work? That should be enough, I think. If not, probably some MFC initialization functions must be called.
But I'd highly recommend you don't create plug-ins using MFC. Using MFC to create plug-ins would require any installer using them to install the MFC runtimes before it could even start running. NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#3 |
|
Debian user
(Forum King) Join Date: Jan 2003
Location: Arch land
Posts: 4,917
|
unless you linked statically the runtimes :\
* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE. * Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE. |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: May 2006
Posts: 3
|
Unfortunately the normal VC wizard MFC Dll as a PlugIn Dll does not work.
Only the calling of my MfcStuffDll functions via System::Call works fine. But as far as I get it this requires that my MfcStuffDll is installed first. Or is there a way to use my dll from within the installer archive? - I haven't look too closely at the usage of temporary files. Maybe that way. Or has anyone an exDll example with mfc support? (static linking. Currently there is enough discspace to waste for this project :-) ) |
|
|
|
|
|
#5 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
How do you pass the stack pointer and the variables pointer using System::Call? Have you used the correct function parameters for the functions you wish the export? What about the calling convention?
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: May 2006
Posts: 3
|
Thanks for your support so far.
Your hint with the system::call function was very helpful. I found a workaround which is fine for me because my software requires administrator priviliges anyway. I just stuffed all my MFC code in an ordinary MFC Dll. And in the init part of my installer script I install this dll in the system32 folder. Than I call my mfc functions and retrieve my system analysis and after that I remove the temporarly installed Dll from system32 and continue with the installation of the software. Works fine - but like I mentioned only for installations with administrator prviliges. Btw. I tried the normal calling convention from the exDll example: MyDll:MyFunction ... on the MFC Dll. Now I use the System::Call "MyDll::MyCheck()i().r0" to find out if some things. |
|
|
|
|
|
#7 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
That's not the calling convention I'm talking about. I'm talking about __stdcall and __cdecl. I'm talking about how you define the function in your DLL. Its header should look exactly like the functions in exdll.c, except the name. If not, you won't be able to call them the script like a normal plug-in and you'll have to use the System plug-in. Judging by the System call that does work for you, you've got the wrong function header.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|