WinAPI: CreateWindowExA in "USER32.DLL"

Posted by Admin on 01-Apr-2010 02:02

Im trying to call the CreateWindowEx function in the User32.dll, and  create a Marquee Style Process Bar but i always get the message:

Mismatch in the parameter datatypes in DLL procedure  CreateWindowEx.

here is my source code:

DEFINE VARIABLE liResult AS INTEGER    NO-UNDO.

PROCEDURE CreateWindowExA EXTERNAL "USER32.DLL":U:
    DEFINE INPUT PARAMETER piExStyle AS DOUBLE NO-UNDO.
    DEFINE INPUT PARAMETER pcClassName AS CHARACTER NO-UNDO.
    DEFINE INPUT PARAMETER pcWindowName AS CHARACTER NO-UNDO.
    DEFINE INPUT PARAMETER piStyle AS DOUBLE NO-UNDO.
    DEFINE INPUT PARAMETER piXPos AS LONG NO-UNDO.
    DEFINE INPUT PARAMETER piYPos AS LONG NO-UNDO.
    DEFINE INPUT PARAMETER piWidth AS LONG NO-UNDO.
    DEFINE INPUT PARAMETER piHeight AS LONG NO-UNDO.
    DEFINE INPUT PARAMETER phHandleToWindowParent AS LONG NO-UNDO.
    DEFINE INPUT PARAMETER phHandleToMenu AS LONG NO-UNDO.
    DEFINE INPUT PARAMETER phHandleToInstance AS LONG NO-UNDO.
    DEFINE INPUT PARAMETER pcParam AS LONG NO-UNDO.
    DEFINE RETURN PARAMETER piHandleToNewWindow AS LONG NO-UNDO.
END PROCEDURE.


DEFINE VARIABLE test AS INTEGER   NO-UNDO INIT 0.


RUN CreateWindowExA (
         0.0,
         "20",
         "0",
         8.0,
         100.0,
         100.0,
         100.0,
         100.0,
         0.0,
         0.0,
         0.0,
         OUTPUT liResult
).

here is a link to the msdn:

http://msdn.microsoft.com/en-us/library/ms632680%28VS.85%29.aspx
http://msdn.microsoft.com/en-us/library/bb760816%28VS.85%29.aspx

im using Progress 9.1.D

can someone please tell me what im doing wrong...


and btw. sry for my bad english ;-)

All Replies

Posted by rstanciu on 01-Apr-2010 08:50

comme back to progresstalk ... I have an ideea

Posted by Admin on 01-Apr-2010 09:16

AFAIK a LONG is an integer type. When you pass parameters as 8.0 or 100.0 or 0.0 it's a DECIMAL. Try passing those values as 8 or 100 or 0

This thread is closed