hanzelko
asked on
VBA::_ErrObject
Hello.
I've got such a problem. In Visual Basic I have made ActiveX Dll and function like:
Public Sub showError(error as ErrObject)
...
End sub
A this Dll I want to use in VC++
I create IDL file, compile it, generated .c and .h files were added to project a compiled.
But then the function in VC++ looks like:
HRESULT showError(VBA::_ErrObject **error);
And I don't know how to create that VBA::_ErrObject in VC++.
It look like it is a normal COM object (_ErrObject) but _ErrObjectPtr.CreateInstan ce doesn't work.
I have #import msvbvm60.dll used.
Thanks for help.
I've got such a problem. In Visual Basic I have made ActiveX Dll and function like:
Public Sub showError(error as ErrObject)
...
End sub
A this Dll I want to use in VC++
I create IDL file, compile it, generated .c and .h files were added to project a compiled.
But then the function in VC++ looks like:
HRESULT showError(VBA::_ErrObject **error);
And I don't know how to create that VBA::_ErrObject in VC++.
It look like it is a normal COM object (_ErrObject) but _ErrObjectPtr.CreateInstan
I have #import msvbvm60.dll used.
Thanks for help.
ASKER
Hi.
I have tried it.
But Set objError = new ErrObject doesn't work.
It throws exception ActiveX cant create object in VB.
So I have used
Set objError = err // return global error object.
This works, but behaves buggy. Something in objErrr is set when I call showError but description is not set.
It looks like the objError is the same global err object and objErr.descritption is empty.
So where can be problem.
I have tried it.
But Set objError = new ErrObject doesn't work.
It throws exception ActiveX cant create object in VB.
So I have used
Set objError = err // return global error object.
This works, but behaves buggy. Something in objErrr is set when I call showError but description is not set.
It looks like the objError is the same global err object and objErr.descritption is empty.
So where can be problem.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ok thanks a lot. I have though about it the same way. pseudoErrObject will be good.
Set objError = New ErrObject
work.
Expose a GetErrObject from your VB ActiveX DLL and use it to obtain a pointer to ErrObject from VC++. At least you'll get an ErrObject pointer which you can pass to showError.