Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

How to? Use exported functions from TakeCmd.dll

Aug
1,948
71
Hi,
I am having trouble figuring out how to use exported functions from TakeCmd.dll for use in a plugin that I am writing in PowerBASIC.

As an example only, I am focusing on QPuts, just for a simple example.

For example, in Delphi, I used the following;

Code:
procedure QPuts(TextToDisplay: PWideChar); stdcall; external 'TakeCmd.dll';

Here is how I translated it to PowerBASIC;

Code:
DECLARE FUNCTION QPuts LIB "TakeCmd.dll" ALIAS "QPUTS" (BYVAL pstrArgs AS WORD PTR) EXPORT AS DWORD

but this just gives me a syntax error. I believe the problem is with pointers, but I'm not sure in which direction to go from here.

I can print to the TCC from a plugin using this routine;

Code:
FUNCTION QPrint(TheString AS STRING) AS STRING
    DIM h AS DWORD
    h = GetStdHandle(%STD_OUTPUT_HANDLE)
    DIM n AS DWORD
    n = FREEFILE

    OPEN HANDLE h FOR OUTPUT AS #n

    PRINT #n, TheString

    CLOSE #n
END FUNCTION

but I would still like to learn how to use the exported functions from TakeCmd.dll in PowerBASIC.

Thanks from Joe
 
Back
Top