Callback, whats wrong ?

From the documentaion:

LDVCode ldv_register_event(short handle, HANDLE event)
My Xojo Code:

[code] Declare Function ldv_register_event Lib “ldv32.dll” (ByVal Handle As Integer, Byval msg_p As Ptr) As Integer

dim result as Integer
dim pp as Ptr = AddressOf MessagesAvalible

result = ldv_register_event(Handle,pp)

Return result[/code]

“MessageAvalible” is a global method in the same module as this method calling the register event.
The “result” is telling me thats the event is registered, but It never fires…

Short ? Really ?
That might actually need to be a 16 bit integer type - possibly unsigned

You always answer fast Norman ! Thanks for that .

Short ?
I have to cast the Ptr type to Uint16 ?
I’ll give it a try.

Not the ptr. The first parameter, Handle as UInt16.

Hi Tim!

Ok changed to Uint16, but the same result.

I get the handle from another call to this dll.

[code]Declare Function ldv_open Lib “ldv32.dll” (ByVal id As CString, ByRef Handle As UInt16) As Integer

dim a as Integer
dim w as UInt16
a = ldv_open(Id,w)

return a

Basicaly handle = 1 the first the i open, icrements for each time.

Don’t think it’s here the problem is, I get a “OK” message back when I register the event with the correct handle.
If I register the event with a number that i not have beed assigned throug the ldv_open function I get a “NOT OPENED” message.