Tim Turner
asked on
Runtime error 32797 related to using an object from a compiled DLL
Hello,
I have a DLL created from some compiled classes.
I instantiate the Object but when I try to assign a value to one of the properties... I get a runtime error 32797
"Application-defined or object-defined error"
Dim soapInvestorReq As New InvestorInfoRequest
soapInvestorReq.AuthInfo.F IID = 22 <-- barfs on any assignment on any property of the object...
Am I instantiating/creating the object wrong? Or is this a problem with the DLL?
Please advise. 500 points for help. Thank you.
I have a DLL created from some compiled classes.
I instantiate the Object but when I try to assign a value to one of the properties... I get a runtime error 32797
"Application-defined or object-defined error"
Dim soapInvestorReq As New InvestorInfoRequest
soapInvestorReq.AuthInfo.F
Am I instantiating/creating the object wrong? Or is this a problem with the DLL?
Please advise. 500 points for help. Thank you.
This sounds like a DLL thats not registered correctly or you have the wrong GUID. Causing compatability issues. I would suggest un-registering the DLL's and changing the compatability to "no compatibility" and re-compile the DLL's
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Also, I would suggest you to test the dlll with a sample program before compiling it into .dll, as such errors can then be trapped using the Visual basic debugger.
Break up the declaration into 2 statements: the Dim and the Set.
Now if there is a problem creating the object, it will barf at the Set .. New line.
Dim soapInvestorReq As InvestorInfoRequest
Set soapInvestorReq = New InvestorInfoRequest
soapInvestorReq.AuthInfo.F IID = 22
Now if there is a problem creating the object, it will barf at the Set .. New line.
Dim soapInvestorReq As InvestorInfoRequest
Set soapInvestorReq = New InvestorInfoRequest
soapInvestorReq.AuthInfo.F
ASKER
The problem was indeed that I needed to break it up into 2 steps...
Dim soapInvestorReq As InvestorInfoRequest
Set soapInvestorReq = New InvestorInfoRequest
Dim soapInvestorReq As InvestorInfoRequest
Set soapInvestorReq = New InvestorInfoRequest