🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #149412

Re: [Dialog] Scripting - Calling external DLL causes Could Not Call Proc

#149412
From: Jeff
Date: Sat, 05 Jun 2004 18:11
73 lines
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
Technical Details
Message-ID: <66u2kt94sjad$.qwltu5ylzvn$.dlg@40tude.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.dca.giganews.com!internal1.nntp.sjc.giganews.com!border2.nntp.sjc.giganews.com!border1.nntp.sjc.giganews.com!nntp.giganews.com!sjc1.usenetserver.com!news.usenetserver.com!sn-xit-02!sn-xit-01!sn-post-01!supernews.com!news.supernews.com!not-for-mail
References: <hlofdrweet5e$.12pmj6hfuthne.dlg@40tude.net> <6d71vxvej5nu$.dlg@alain-guerin.com>

Show Full Headers
Complete Article Headers
Message-ID: <66u2kt94sjad$.qwltu5ylzvn$.dlg@40tude.net>
Subject: Re: [Dialog] Scripting - Calling external DLL causes Could Not Call Proc
Date: Sat, 5 Jun 2004 13:11:29 -0500
From: Jeff <n@n.com>
References: <hlofdrweet5e$.12pmj6hfuthne.dlg@40tude.net> <6d71vxvej5nu$.dlg@alain-guerin.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.dca.giganews.com!internal1.nntp.sjc.giganews.com!border2.nntp.sjc.giganews.com!border1.nntp.sjc.giganews.com!nntp.giganews.com!sjc1.usenetserver.com!news.usenetserver.com!sn-xit-02!sn-xit-01!sn-post-01!supernews.com!news.supernews.com!not-for-mail
Newsgroups: news.software.readers
Organization: None
User-Agent: 40tude_Dialog/2.0.12.1
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Reply-To: n@n.com
X-Complaints-To: abuse@supernews.com
Lines: 73