Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 10 AUG 2022 12:02:40PM Rich Channer wrote:

Hello All,

We are needing to write an interface to an external DLL in OI (9.4) - works like a charm in c++ but cannot get it to work in Openinsight it just shuts OI without error. I suspect its a problem with the prototype record as changing the values I send seems to make no difference (but changing the data types seems to have no difference also) - any help would be appreciated!

Here's the logic from C:

typedef int(_cdecl* nCfInit) (HWND, UINT, UINT, BOOL *);

nCfInit nCfInitiate;

#define WM_USER 0x0400

#define WM_READPKT (WM_USER+1)

#define WM_CLOSEPROC (WM_USER+2)

DhWnd = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_INTERFACAPI_DIALOG), NULL, dlgproc);

BOOL bReadPckt = false;

nInstance = nCfInitiate(DhWnd, WM_READPKT, WM_CLOSEPROC, &bReadPckt);

The prototype record in OI currently looks like this (cant see an equivalent in OI for bool):

INT STDCALL nCfInit(HANDLE,UINT,UINT,UINT)

and the code to call it looks like this:

declare function nCfInit

DhWnd = get_property(@window, 'HANDLE')

WM_READPKT = "34307"

WM_CLOSEPROC = "34308"

ReadPckt = '0'

nInstance = nCfInit(hhandle, WM_READPKT, WM_CLOSEPROC, ReadPckt)

The WM_ vars probably need to be hex - but still fails if I do this, which makes me think its more the prototype record that's at fault…?

TIA !


At 11 AUG 2022 07:01AM Rich Channer wrote:

Just noticed I posted to 64-bit - but its OI9 !

Ignore this one I reposted again into 32-bit section!

Cheers, R

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/cdb427755b40ca4dacc1873d6e95c023.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1