Hi,
we tried to use "Call DLL"...
The following sample shows a Test_"Call DLL" with an Error-message... What do we wrong??? using rundll32.exe it works...
Path for shell32 or with or without .dll extentsion has no positive effects...
Regards
Problems CALL DLL
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Problems CALL DLL
Dear Rulan,
you are not passing any parameter with the called function and anyway, you should always enter the full library name + extension with the command.
Regards
you are not passing any parameter with the called function and anyway, you should always enter the full library name + extension with the command.
Regards
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: Problems CALL DLL
Dear Francesco,
as I described above, there is no difference between full path and extention:
Parameter??? There are no parameter needed!!!!
1) THis worked fine under command line or also as "run program" code. Please try it yourself :
~InstallAware Clipboard Data~
~Run Program~
~{D9364D97-3DCF-4499-A39E-9E23EE3EE4F8}~
~rundll32.exe ~
~FALSE~
~shell32,Control_RunDLL~
~FALSE~
~~
2) What do we wrong???? I read in this forum, that "call dll" worked similar like "rundll32.exe"???? Why is it impossible for us to get our example above running under "CALL DLL".
Our last try:
What can we do better? Can You give us an example, that works?
regards
as I described above, there is no difference between full path and extention:
Parameter??? There are no parameter needed!!!!
1) THis worked fine under command line or also as "run program" code. Please try it yourself :
~InstallAware Clipboard Data~
~Run Program~
~{D9364D97-3DCF-4499-A39E-9E23EE3EE4F8}~
~rundll32.exe ~
~FALSE~
~shell32,Control_RunDLL~
~FALSE~
~~
2) What do we wrong???? I read in this forum, that "call dll" worked similar like "rundll32.exe"???? Why is it impossible for us to get our example above running under "CALL DLL".
Our last try:
What can we do better? Can You give us an example, that works?
regards
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Problems CALL DLL
Dear Rulan,
the “Control_RunDLL” is an undocumented WINAPI from the Shell32.dll which can be used to launch control panel applications.
This API requires at LEAST 4 parameters (... otherwise the function doesn't execute anything) as;
- HWND hwnd,
- HINSTANCE hinst,
- LPSTR lpszCmdLine,
- int nCmdShow
Could you please explain what do you want to do with the function?
PS
I didn't say that exist differences with calling the Shell32.dll using the full path to the library or just the library name.
I meant, you MUST USE AT LEAST the library name + extension with the Call Dll command (in your case Shell32.dll").
Regards
the “Control_RunDLL” is an undocumented WINAPI from the Shell32.dll which can be used to launch control panel applications.
This API requires at LEAST 4 parameters (... otherwise the function doesn't execute anything) as;
- HWND hwnd,
- HINSTANCE hinst,
- LPSTR lpszCmdLine,
- int nCmdShow
Could you please explain what do you want to do with the function?
PS
I didn't say that exist differences with calling the Shell32.dll using the full path to the library or just the library name.
I meant, you MUST USE AT LEAST the library name + extension with the Call Dll command (in your case Shell32.dll").
Regards
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: Problems CALL DLL
Dear Francesco,
as I can test, it works without parameters, but Francesco, that is not my problem. First, I only want to see "Call dll" running!!!!!
Please show me, what we had to do, getting a .dll function executing. Please use for example the parameters of Your choice, this would be very nice.
Background of our tests. Under WIX we are able to fire dll-functions within the setup. Our dll is able to excecute sql-statements. You now will say, that IA also can do this and that is right, but we had to save binary-data (a picture) from the client-side into an image-field of the sql-server and here is the problem. T_SQL only can do this, placing the file into the directory-structure from the server, where mssql exists... I tried using a variable to read the local image-file, in IA using "read from text file", and use this variable in sql-statements by executing IA's "MS SQL Server", but I believe the variable is not able to save/transport the binary input...
. Is this right?
OK.... Our chance, I see, is to get it running with "Call dll". The dll-Use is very complicated, using many parameters, so we only want to see an example, to look, how we had to manage the IA "call dll"...
It would be nice, if You could show us, how we could manage "call dll". Show us the working (!) shell32.dll example using "call dll" anyway, as You pleases using parameters of your choice.
...
Perhapps You have an other idea to get local binary code into an variable, which can be used to save the binary code into an image field of ms sqlserver per T-SQL-"INSERT"?
Regards
as I can test, it works without parameters, but Francesco, that is not my problem. First, I only want to see "Call dll" running!!!!!
Please show me, what we had to do, getting a .dll function executing. Please use for example the parameters of Your choice, this would be very nice.
Background of our tests. Under WIX we are able to fire dll-functions within the setup. Our dll is able to excecute sql-statements. You now will say, that IA also can do this and that is right, but we had to save binary-data (a picture) from the client-side into an image-field of the sql-server and here is the problem. T_SQL only can do this, placing the file into the directory-structure from the server, where mssql exists... I tried using a variable to read the local image-file, in IA using "read from text file", and use this variable in sql-statements by executing IA's "MS SQL Server", but I believe the variable is not able to save/transport the binary input...
![Question :?:](./images/smilies/icon_question.gif)
OK.... Our chance, I see, is to get it running with "Call dll". The dll-Use is very complicated, using many parameters, so we only want to see an example, to look, how we had to manage the IA "call dll"...
It would be nice, if You could show us, how we could manage "call dll". Show us the working (!) shell32.dll example using "call dll" anyway, as You pleases using parameters of your choice.
...
Perhapps You have an other idea to get local binary code into an variable, which can be used to save the binary code into an image field of ms sqlserver per T-SQL-"INSERT"?
Regards
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Problems CALL DLL
Dear Rulan,
please have a look at the attached sample which demonstrates how to call Control_RunDLL function.
NOTE!!
Please carefully read the code comments
By the way, you chose one of the most undocumented WINAPI to test the CALL DLL.
I may suggest you to do more practice with any other more documented WINAPI function.
With the following link is available another CALL DLL sample;
http://www.installaware.com/forum/viewtopic.php?f=2&t=8962
Of course you can't use an IA VARIABLE to hold a binary file contents.
I believe that currently the best approach is to do it with the help of an external DLL as you are doing.
Hope this helps you.
Regards
please have a look at the attached sample which demonstrates how to call Control_RunDLL function.
NOTE!!
Please carefully read the code comments
By the way, you chose one of the most undocumented WINAPI to test the CALL DLL.
I may suggest you to do more practice with any other more documented WINAPI function.
With the following link is available another CALL DLL sample;
http://www.installaware.com/forum/viewtopic.php?f=2&t=8962
Of course you can't use an IA VARIABLE to hold a binary file contents.
I believe that currently the best approach is to do it with the help of an external DLL as you are doing.
Hope this helps you.
Regards
- Attachments
-
- CallDllSample.rar
- (2.9 KiB) Downloaded 1485 times
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: Problems CALL DLL
Thanks Francesco,
something happend, but!!!!!!!!!
Here we are....
I put your example and the only thing I did was to define an return variable (SUCCESS) inside the call dll routine...
A Messagebox displayed the SUCCESS and now .... tatata...
And that I do not understand...
Regards
something happend, but!!!!!!!!!
Here we are....
I put your example and the only thing I did was to define an return variable (SUCCESS) inside the call dll routine...
A Messagebox displayed the SUCCESS and now .... tatata...
And that I do not understand...
![Sad :(](./images/smilies/icon_sad.gif)
Regards
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Problems CALL DLL
Dear Rulan,
you can't use a return value if the called WINAPI returns a VOID type.
You must follow the exact function types declaration.
By the way, how goes with my sample?
Regards
you can't use a return value if the called WINAPI returns a VOID type.
You must follow the exact function types declaration.
By the way, how goes with my sample?
Regards
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: Problems CALL DLL
Dear Francesco,
excuse me, perhapps I have expressed myself incorrectly, but..
the error message above is Your Example!!!!!!!!!
regards
excuse me, perhapps I have expressed myself incorrectly, but..
the error message above is Your Example!!!!!!!!!
regards
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Problems CALL DLL
Dear Rulan,
I'm sure that works!
which IA version you used to try my sample?
Did you followed the code notes?
Regards
I'm sure that works!
which IA version you used to try my sample?
Did you followed the code notes?
Regards
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: Problems CALL DLL
Dear Francesco,
Your right ... Example worked...
But I got it, why I had problems...
You have to explicit define the Return variable before call dll is used. IF not, You get this error above.
Sorry about that mistake...
regards
Your right ... Example worked...
![Smile :)](./images/smilies/icon_smile.gif)
But I got it, why I had problems...
You have to explicit define the Return variable before call dll is used. IF not, You get this error above.
Sorry about that mistake...
regards
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Problems CALL DLL
I'm happy you solved
... but anyway, it is not necessary to use a return variable with that function ... because it doesn't return a value.
Regards
... but anyway, it is not necessary to use a return variable with that function ... because it doesn't return a value.
Regards
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Who is online
Users browsing this forum: No registered users and 25 guests