how to throw erros in COM DLL for use in VB6

i made a ActiveX Library with C++ Builder XE3 for use in VB6

i want to throw a error like the dao360.dll do (VB6 stop on the correct line)
not just show a messagebox

i try to many different "throw" (EOleException, EOleSysError, ..)
but it always crash VB6

if i use SetErrorInfo or this->Error(), nothing happen

i cannot return a HRESULT
my fonction return a Database* (the name of my CoClass)
resolved by returning a HRESULT and moving the Database* as the last parameter (out, retval)
VB6 see it as a function that return a Database*

i have another question

how can i return small errors numbers like the DAO360.DLL do, instead of 0x80000000+
if i don't set the first bit of the HRESULT to 1, VB6 don't see it as a error
i found it after many searchs on the internet and many try of different values
MAKE_HRESULT(SEVERITY_ERROR, FACILITY_CONTROL, ErrorCode)
Topic archived. No new replies allowed.