1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to? Use exported functions from TakeCmd.dll

Discussion in 'Plugins' started by Joe Caverly, Oct 24, 2012.

  1. Joe Caverly

    Joined:
    Aug 28, 2009
    Messages:
    675
    Likes Received:
    8
    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
     

Share This Page