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
>
>
>