Greetings, fellow programmers,
I am trying to figure out some strangeness in using an external COM object from my own COM object, via simple inclusion (i.e. my object uses another object through standard CoCreateInstance and related API, there is no aggregation or anything funky happening). Without going into too much detail - trust me, it'd be impossible to compress it all into a single post - here is what seems to be happening:
1) I call CoCreateInstance() on an external object. The return HRESULT is S_OK.
2) My *own* object is starting to behave strangely. Variables that are supposed to have values in them are trashed. Unfortunately it is very hard to figure out what exactly IS in the object, and what's happening at any given point, because of the copious amounts of inheritance and various other C++ trickery going on. This isn't my code, and is most definately not my idea of a good design. Anyway, I shortly encounter a crash due to following a NULL pointer which *I know* held a valid value before I called the CoCreateInstance().
My conclusion from 1 & 2, is that the code for my object, screwed up as it is, is not to blame. What I suspect happening, is that the COM object I am calling craps all over my stack frame. So here is my question. How in the world do I confirm whether that is in fact happening? Debugging across COM boundaries is something I've always wanted to avoid... but since the code runs in my own memory space, there ought to be something I can do. I do have the code for the external COM object, but its sourcebase is huge - I estimate about a week of full time work to figure out everything that's going on under the hood. So this is my worst case scenario - but basically I am looking for a good way to confirm my suspicions before diving into it. Any takers on my dilemma?
Thanks,
PO
I am trying to figure out some strangeness in using an external COM object from my own COM object, via simple inclusion (i.e. my object uses another object through standard CoCreateInstance and related API, there is no aggregation or anything funky happening). Without going into too much detail - trust me, it'd be impossible to compress it all into a single post - here is what seems to be happening:
1) I call CoCreateInstance() on an external object. The return HRESULT is S_OK.
2) My *own* object is starting to behave strangely. Variables that are supposed to have values in them are trashed. Unfortunately it is very hard to figure out what exactly IS in the object, and what's happening at any given point, because of the copious amounts of inheritance and various other C++ trickery going on. This isn't my code, and is most definately not my idea of a good design. Anyway, I shortly encounter a crash due to following a NULL pointer which *I know* held a valid value before I called the CoCreateInstance().
My conclusion from 1 & 2, is that the code for my object, screwed up as it is, is not to blame. What I suspect happening, is that the COM object I am calling craps all over my stack frame. So here is my question. How in the world do I confirm whether that is in fact happening? Debugging across COM boundaries is something I've always wanted to avoid... but since the code runs in my own memory space, there ought to be something I can do. I do have the code for the external COM object, but its sourcebase is huge - I estimate about a week of full time work to figure out everything that's going on under the hood. So this is my worst case scenario - but basically I am looking for a good way to confirm my suspicions before diving into it. Any takers on my dilemma?
Thanks,
PO