|
|
#1 |
|
Junior Member
Join Date: May 2015
Posts: 6
|
NSIS - calling dll function
Hi!
I saw the general documentation regarding this subject, but to be honest I still don't understand how to do it. So, let's say I have the following dll function written in C++ Builder (mydll.dll): code: How do I call this dll function from NSIS script? Return value should be stored somewhere so I can later check it. |
|
|
|
|
|
#2 | |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
|
Did you look at the examples at the bottom?
Try Quote:
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
|
#3 | ||
|
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
For that example above, you would have to use the system plugin.
Quote:
Quote:
[edit] Anders you ninja
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
||
|
|
|
|
|
#4 |
|
Junior Member
Join Date: May 2015
Posts: 6
|
It works! Thanks!
|
|
|
|
|
|
#5 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
|
Please quote string parameters unless you are certain they don't contain spaces or commas! The only exception is the built-in registers and variables that have system plugin aliases; t r0 etc.
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#6 |
|
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
True, thanks. I'm a bit rusty on my nsis scripting, I haven't written an nsis script in at least a year (been looking at too much C code
).
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: May 2015
Posts: 6
|
My dll function is connecting to online db server. The problem is that user may have internet connection problems or my server may be down for some reason. In those cases my NSIS setup file (exe) crashes since dll function generates exception.
It is possible to use try-catch in NSIS script so when I call dll function to check if any exceptions happened? |
|
|
|
|
|
#8 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
|
Nope, neither C++ nor SEH exceptions are supported...
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#9 |
|
Junior Member
Join Date: May 2015
Posts: 6
|
Too bad...
Now I also have another problem. How to pass boolean value to my dll function? Function takes bool type as a parameter. Edit: passed it as integer |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|