Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Delphi 6 DLL problem

36 views
Skip to first unread message

Roland Smith

unread,
Jul 23, 2003, 7:56:10 AM7/23/03
to
Marco,

I don't know Delphi but here is a function from a .dll I wrote in C that
works. A software package we bought had been coded using STDCALL so I
created a wrapper .dll using WINAPI. The PB app calls my .dll which then
calls theirs.

DWORD WINAPI pbarm_init( LPSTR lpszApplName )
{
DWORD dwApplID;

dwApplID = arm_init(lpszApplName, "*", 0, 0, 0);

return dwApplID;
}

PowerBuilder External Declaration:

Function long pbarm_init(string lpszApplName) Library "pbarm.dll"

Roland
--
Topwiz Software - Home of PBSearch
http://www.topwizprogramming.com/


<m...@fcsedp.it> wrote in message news:e2QFlKOUDHA.280@forums-2-dub...
> Hi everybody!
>
> I have created a DLL in Delphi6 including the following functions:
>
> function OpenConn : longint; export; stdcall;
> function CloseConn : longint; export; stdcall;
> function Request (args : pchar) : longint; export; stdcall;
> function AddParam (sP, sV : pchar) : longint; export; stdcall;
> function ClrParam : longint; export; stdcall;
> procedure WSACloseAll; export; stdcall;
>
> "translated" in powerscript by
>
> FUNCTION LONG openconn () LIBRARY "wsa.dll";
> FUNCTION LONG closeconn () LIBRARY "wsa.dll";
> FUNCTION LONG request (string args) LIBRARY "wsa.dll";
> FUNCTION LONG addparam (string sP, string sV) LIBRARY "wsa.dll";
> FUNCTION LONG clrparam () LIBRARY "wsa.dll";
> SUBROUTINE WSACloseAll () LIBRARY "wsa.dll";
>
> When I call it from an application in Powerbuilder 6.5 it works perfectly
> well; but on closing the application, an access violation error comes off
> that does not occur if I don't use the DLL.
> Does anybody have any suggestion?
>
> Thanks.
>
> Bye.
>
> Marco Ferlini
> F.C.S. Solutions S.r.l.
> marco....@fcssolutions.it
>
>
>


Paul B

unread,
Jul 23, 2003, 7:59:53 AM7/23/03
to
Hi
check the threads - I answered your previous post,
Użytkownik <m...@fcsedp.it> napisał w wiadomości

m...@fcsedp.it

unread,
Jul 23, 2003, 2:12:43 AM7/23/03
to
0 new messages