Welcome, Guest
Username: Password: Remember me
Visual Objects

Please use this forum to post questions about Visual Objects and Vulcan.NET
  • Page:
  • 1

TOPIC:

WINTYPE LOCAL .... 24 Sep 2021 18:08 #19705

  • JKCanada604
  • JKCanada604's Avatar
  • Topic Author


  • Posts: 43
  • Good day everyone,

    I have run into something I cannot determine how to handle.

    WINTYPE LOCAL hBuffReadyEv AS HANDLE

    I have gone through the Windsk, a bunch of include files as well as the VO help - nothing found!

    As always, any hints appreciated...

    Thank you, keep well everyone annd,

    Cheers, JK

    Please Log in or Create an account to join the conversation.

    WINTYPE LOCAL .... 24 Sep 2021 18:21 #19706

    • Chris
    • Chris's Avatar


  • Posts: 3759
  • Hi John,

    This looks like a corrupted entity. What is the exact code in the VO version of the app? Is it being used anywhere?

    .
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Last edit: by Chris.

    WINTYPE LOCAL .... 24 Sep 2021 18:28 #19708

    • JKCanada604
    • JKCanada604's Avatar
    • Topic Author


  • Posts: 43
  • Hi Chris,

    Here is the code:

    FUNC OutputDebugString32(pszOut AS PSZ) AS VOID PASCAL

    LOCAL pCallBack AS PTR
    LOCAL lRet AS LOGIC
    WINTYPE LOCAL hBuffReadyEv AS HANDLE
    WINTYPE LOCAL hDataReadyEv AS HANDLE
    WINTYPE LOCAL hfShared AS HANDLE
    LOCAL pSharedMem AS _SHAREDMEM
    LOCAL nStrSize AS INT
    LOCAL nSize AS INT
    LOCAL OsVerInfo IS _WINOSVERSIONINFO
    LOCAL cFileName AS STRING
    LOCAL DIM abTemp[_MAX_PATH] AS BYTE
    LOCAL pOut AS BYTE PTR
    LOCAL lIDE AS LOGIC

    nStrSize := PszLen(pszOut) + 1

    pOut := MemAlloc(nStrSize)

    IF pOut = NULL_PTR
    MessageBox(NULL, ERRMSG_LOW_MEM, ERRMSG_CAPTION, MB_OK)
    RETURN
    ENDIF

    MemCopy(pOut, PTR(_CAST,pszOut), nStrSize)

    nSize := GetModuleFileName(_GetInst(),@abTemp[1], _MAX_PATH )

    CharUpperBuff( @abTemp[1], nSize )

    IF nSize > 4
    IF MemComp( @abTemp[nSize-3], PTR(_CAST, ".DBG"), 4 ) = 0
    lIDE := .T.
    ENDIF
    ENDIF

    OsVerInfo.dwOSVersionInfoSize := _SIZEOF(_WINOSVERSIONINFO)
    GetVersionEx(@OsVerInfo)

    OutPutDebugString(pOut)

    IF lIDE
    //
    // IDE swallows all OutPutDebugStrings,
    // don't check fot NT, we have to care
    // about the output anyway.
    // Note: Check new VO 2.0 releases
    // for this behaviour
    //
    ELSE
    IF OsVerInfo.dwPlatformId == VER_PLATFORM_WIN32_NT
    //
    // No IDE, no Windows95, (no cry) we are done ...
    //
    RETURN
    ENDIF
    ENDIF


    //
    // Make sure DBWIN32.EXE is up
    //
    hBuffReadyEv := OpenEvent(EVENT_MODIFY_STATE, FALSE, EVENT_BUFFER_READY)

    IF hBuffReadyEv = NULL_PTR

    #IFDEF __DEBUG__
    MessageBox(NULL, ERRMSG_NO_SYNC1, ERRMSG_CAPTION, MB_OK)
    #ENDIF

    RETURN
    ENDIF


    //
    // Get a handle to the data synch objects
    //
    hDataReadyEv := OpenEvent( EVENT_MODIFY_STATE, FALSE, EVENT_DATA_READY)

    IF hDataReadyEv = NULL_PTR

    #IFDEF __DEBUG__
    MessageBox(NULL, ERRMSG_NO_SYNC2, ERRMSG_CAPTION, MB_OK)
    #ENDIF

    CloseHandle(hBuffReadyEv)

    RETURN
    ENDIF

    hfShared := CreateFileMapping( 0xFFFFFFFF, 0, PAGE_READWRITE, 0, 4096, BUFFER_NAME)

    IF hfShared = NULL_PTR

    MessageBox(NULL, ERRMSG_CREATE_MAP, ERRMSG_CAPTION, MB_OK)

    CloseHandle(hBuffReadyEv)
    CloseHandle(hDataReadyEv)

    RETURN

    ENDIF

    pSharedMem := MapViewOfFile(hfShared, FILE_MAP_WRITE, 0, 0, 512)

    IF pSharedMem = NULL_PTR

    MessageBox(0, ERRMSG_MAP_MEM, ERRMSG_CAPTION, MB_OK)

    CloseHandle(hfShared)
    CloseHandle(hBuffReadyEv)
    CloseHandle(hDataReadyEv)

    RETURN

    ENDIF

    //
    // Wait for buffer event
    //
    WaitForSingleObject(hBuffReadyEv, INFINITE)

    //
    // Write it to the shared memory
    //
    pSharedMem.nProcID := GetCurrentProcessId()

    MemCopy( @pSharedMem.abInfo[1], pOut, nStrSize )

    //
    // Signal data ready event
    //
    SetEvent(hDataReadyEv)

    //
    // Clean up handles
    //
    UnmapViewOfFile(pSharedMem)

    CloseHandle(hfShared)
    CloseHandle(hDataReadyEv)
    CloseHandle(hBuffReadyEv)

    IF pOut != NULL_PTR
    MemFree(pOut)
    ENDIF

    RETURN

    As always, thank you!

    Please Log in or Create an account to join the conversation.

    WINTYPE LOCAL .... 24 Sep 2021 18:34 #19709

    • Chris
    • Chris's Avatar


  • Posts: 3759
  • Hi John,

    When I try your code in VO 2.8 I get errors about WINTYPE and HANDLE, but indeed it does compile without errors in 2.7, so I assume it was something of the past. You should be able to just remove the "WINTYPE" and replace "HANDLE" with PTR in all 3 lines and it should be fine.

    .
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    WINTYPE LOCAL .... 24 Sep 2021 18:36 #19710

    • JKCanada604
    • JKCanada604's Avatar
    • Topic Author


  • Posts: 43
  • Thank you - that was my thinking....

    Cheers, JK

    Please Log in or Create an account to join the conversation.

    WINTYPE LOCAL .... 24 Sep 2021 21:37 #19713

    • robert
    • robert's Avatar


  • Posts: 3293
  • John,
    WINTYPE ... HANDLE was an UDC that was used in the time when people were moving from VO 1 (where handles were numbers) to VO 2 (where handles are PTR)

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    WINTYPE LOCAL .... 24 Sep 2021 21:52 #19714

    • JKCanada604
    • JKCanada604's Avatar
    • Topic Author


  • Posts: 43
  • Hi Robert,

    Wowzer you are good...

    I can barely remember that far back!!!

    Thank you, keep well and,

    Cheers, JK

    Please Log in or Create an account to join the conversation.

    WINTYPE LOCAL .... 24 Sep 2021 22:04 #19715

    • robert
    • robert's Avatar


  • Posts: 3293
  • John,

    If I remember correctly there was a Windows.UDC file or something named like that, that had several UDCs that started with WINTYPE.
    There should also be UDCs for the various VTrace UDCs

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    WINTYPE LOCAL .... 25 Sep 2021 17:39 #19718

    • wriedmann
    • wriedmann's Avatar


  • Posts: 3245
  • Hi John,
    AFAIK you can remove OutputDebugstring32() from your code.
    The VO Windows API Library contains a OutputDebugString() function, or even better, a DebOut() function.
    OutputDebugString32() was needed in earlier versions of VO where both other function don't were included.
    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1