Thread View: news.software.readers
5 messages
5 total messages
Started by Jeff
Sat, 05 Jun 2004 05:27
[Dialog] Scripting - Calling external DLL causes Could Not Call Proc
Author: Jeff
Date: Sat, 05 Jun 2004 05:27
Date: Sat, 05 Jun 2004 05:27
16 lines
1719 bytes
1719 bytes
I'm writing a script that calls a custom DLL. I've been able to declare the methods in the DLL and make calls to those methods in the DLL. The DLL executes fine, however, when the method in the DLL is finished and returns back to Dialog, I get the error message: Error running script "test": Could not call proc I've removed everything from the DLL method and just have it return. I've also placed message pop ups in the script right after the call to the DLL method to see if it continues on, but it does not. It appears to execute the DLL methods fine, but upon return something occurs and it shuts down the script. Anyone run into this problem? Thanks, Jeff
Re: [Dialog] Scripting - Calling external DLL causes Could Not Call Proc
Author: Alain GUERIN
Date: Sat, 05 Jun 2004 09:07
Date: Sat, 05 Jun 2004 09:07
25 lines
2315 bytes
2315 bytes
Hello, On Sat, 5 Jun 2004 00:27:23 -0500, Jeff wrote: > I'm writing a script that calls a custom DLL. I've been able to declare > the methods in the DLL and make calls to those methods in the DLL. The DLL > executes fine, however, when the method in the DLL is finished and returns > back to Dialog, I get the error message: Error running script "test": Could > not call proc > I've removed everything from the DLL method and just have it return. I've > also placed message pop ups in the script right after the call to the DLL > method to see if it continues on, but it does not. It appears to execute > the DLL methods fine, but upon return something occurs and it shuts down > the script. > Anyone run into this problem? Did you declare your external function with the proper call ? (external 'MessageBoxA@user32.dll stdcall';) for a standard call, etc. -- A.G.
Re: [Dialog] Scripting - Calling external DLL causes Could Not Call Proc
Author: Jeff
Date: Sat, 05 Jun 2004 18:11
Date: Sat, 05 Jun 2004 18:11
73 lines
4416 bytes
4416 bytes
On Sat, 5 Jun 2004 11:07:10 +0200, Alain GUERIN wrote: > Path: sn-us!sn-xit-05!sn-xit-08!supernews.com!newsfeed.online.be!193.109.243.20.MISMATCH!newsfeed.stueberl.de!proxad.net!feeder2-1.proxad.net!news6-e.free.fr!not-for-mail > From: Alain GUERIN <courriels40@alain-guerin.com> > Subject: Re: [Dialog] Scripting - Calling external DLL causes Could Not Call Proc > Newsgroups: news.software.readers > User-Agent: 40tude_Dialog/2.0.11.1 (8a435ff6.331.356) > MIME-Version: 1.0 > Content-Type: text/plain; charset="us-ascii" > Content-Transfer-Encoding: 7bit > Reply-To: news40@alain-guerin.com > Organization: NA > References: <hlofdrweet5e$.12pmj6hfuthne.dlg@40tude.net> > Date: Sat, 5 Jun 2004 11:07:10 +0200 > Message-ID: <6d71vxvej5nu$.dlg@alain-guerin.com> > Archive: no > X-Face: '*&f@caq/y%f)QY'BcSO`EQH}'>nCphQ%q>YfG1"zCmQAa]-,^B1-<u0)r)}QS_wzU)5`a` %|NRB0OU/Q><ozTuEx.M+[fx'?9U\Ojwtt>FBPmKGeE=.(/%Gv4+w/T9UqY}e]~jQzpXe&"V84G%al +i$O,EHjhE.c[7qzp+C4VL< > Mail-Copies-To: never > X-No-Archive: yes > Lines: 25 > NNTP-Posting-Date: 05 Jun 2004 11:07:18 MEST > NNTP-Posting-Host: 81.57.20.30 > X-Trace: 1086426438 news6-e.free.fr 12755 81.57.20.30:3611 > X-Complaints-To: abuse@proxad.net > Xref: sn-us news.software.readers:173620 > > Hello, > > > On Sat, 5 Jun 2004 00:27:23 -0500, Jeff wrote: > >> I'm writing a script that calls a custom DLL. I've been able to declare >> the methods in the DLL and make calls to those methods in the DLL. The DLL >> executes fine, however, when the method in the DLL is finished and returns >> back to Dialog, I get the error message: Error running script "test": Could >> not call proc > >> I've removed everything from the DLL method and just have it return. I've >> also placed message pop ups in the script right after the call to the DLL >> method to see if it continues on, but it does not. It appears to execute >> the DLL methods fine, but upon return something occurs and it shuts down >> the script. > >> Anyone run into this problem? > > Did you declare your external function with the proper call ? (external > 'MessageBoxA@user32.dll stdcall';) for a standard call, etc. It does have something to do with the declaration or how the DLL is compiled. After some more testing, i've found that it has something to do with the parameters. Here's my original declares in the script: FUNCTION ProcessFile(sSubject: pchar):boolean; external 'ProcessFile@padll.dll stdcall'; FUNCTION PA(a:INTEGER):boolean; external 'PA@padll.dll stdcall'; And in the C++ DLL: extern "C" __declspec(dllexport) bool ProcessFile(char *sSubject) extern "C" __declspec(dllexport) bool PA(int a) I've tried several variations of types in the Script/C++ to see if it had any effect, but I still get the same problem. I've also tried forcing the __stdcall calling convention in the DLL (no effect). I have determined though, that if I make the method have no parameters, I don't get the could not call proc error. Utimately, I want to pass 1 string parameter to the DLL. The current ProcessFile with a string parameter does get the correct data from the script. Its just that the script gets that error upon returning back. I'm going to keep playing with the parameter types and DLL options, but i'd appreciate any other ideas as well. Thanks, Jeff
Re: [Dialog] Scripting - Calling external DLL causes Could Not Call Proc
Author: Jernej
Date: Sun, 06 Jun 2004 12:03
Date: Sun, 06 Jun 2004 12:03
28 lines
2151 bytes
2151 bytes
on Sat, 5 Jun 2004 13:11:29 -0500, Jeff wrote:
> I'm going to keep playing with the parameter types and DLL options, but i'd
> appreciate any other ideas as well.
This example comes with Inno Setup (which uses the same script engine as
Dialog), maybe you'll be able to help yourself with this:
MyDLL.c:
#include <windows.h>
void __stdcall MyDllFunc(HWND hWnd, char *lpText, char *lpCaption, UINT
uType)
{
MessageBox(hWnd, lpText, lpCaption, uType);
}
Declaration in script:
procedure MyDllFunc(hWnd: Integer; lpText, lpCaption: String; uType: Cardinal);
external 'MyDllFunc@MyDll.dll stdcall';
--
begin .sig
< Jernej Simon+AQ0-i+AQ0- ><+Jco->< http://www2.arnes.si/~sopjsimo/ >
< jernej simoncic at isg si ><http://deepthought.ena.si/>
end
Re: [Dialog] Scripting - Calling external DLL causes Could Not Call Proc
Author: Jeff
Date: Wed, 09 Jun 2004 00:39
Date: Wed, 09 Jun 2004 00:39
28 lines
2006 bytes
2006 bytes
> This example comes with Inno Setup (which uses the same script engine as
> Dialog), maybe you'll be able to help yourself with this:
>
> MyDLL.c:
>
> #include <windows.h>
> void __stdcall MyDllFunc(HWND hWnd, char *lpText, char *lpCaption, UINT
> uType)
> {
> MessageBox(hWnd, lpText, lpCaption, uType);
> }
>
>
> Declaration in script:
>
> procedure MyDllFunc(hWnd: Integer; lpText, lpCaption: String; uType: Cardinal);
> external 'MyDllFunc@MyDll.dll stdcall';
Thanks for the reply. I tried several more configurations, including using
the above example. I believe it has to do with the way the DLL is being
compilied.
Instead of continuing down this path, I converted the DLL to Delphi. The
Delphi version of the DLL does not have the same problem.
Thanks for all the suggestions.
Jeff
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads