|
-
February 6th, 2003, 05:34 PM
#1
Params passed to COM work in debug
But they fail when I run the service out of Debug Mode.
I have tried this with the debug executible and the release executable.
the parameters are variants in the COM object so I'm using code similar to this:
_variant_t vParam = new _variant_t;
vParam.SetString(m_sLocalVar);
spIface->MyMethod(&vParam);
I set up Logging in the COM object so I could see what was being passed to the function.
When I run the service in debug mode everything works fine. When I launch the service from the Service Control window nothing is passed to the function.
Any ideas?
Thanks for the help,
Dave
Live Life... It's not a dress rehearsal
-
February 7th, 2003, 02:50 AM
#2
If the _variant_t object that you pass is an out argument, does it "live" after you've made the call? If allocated on stack, it will destroy the underlying BSTR once it gets out of scope.
Har Har
-
February 7th, 2003, 08:27 AM
#3
I don't know if it's an out argument. I am passing a reference to to the object (&vParam) and the object doesn't go out of existance until well after the function that needs it has completed.
If I change the function in the DLL to accept the parameter by value instead of reference would that fix the problem?
Live Life... It's not a dress rehearsal
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|