isGadget(gadget)

BlitzPlus Forums/BlitzPlus Programming/isGadget(gadget)

OK, created the dll..... it works fine.... but I need to use queryObject and THAT is what crashes it! arg! Heres the code:

(C++ DLL)
BBDECL bool BBCALL isGadget(HWND hWnd)
{
try{
return IsWindow(hWnd);
}
catch(...)
{
return false;
}
}

in B+

if isGadget(QueryObject(handle, 1)) then
; blah, blah, blah
endif

Any ideas?