Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Stupid COM question

$
0
0

Hi --

I'm getting an error with the following code:

                hr = theDebugPanes->Item(CComVariant("MachineForthMainThreadOutput"),&theMachineForthOutputPane);
                if (FAILED(hr))
                    return false;
                if (theMachineForthOutputPane == nullptr)
                {
                    hr = theDebugPanes->Add(_bstr_t("MachineForthMainThreadOutput"),&theMachineForthOutputPane);
                    if (FAILED(hr))
                        return false;
                }

In the above code theDebugPanes is a DTE OutputWindowPanes variable and it is being called cross process.  I'm getting an invalid argument error and I suspect that it's because I am not marshalling the string correctly.   It's been ages since I did COM, but when I'm stopped at a breakpoint and look at the value of the "MachineForthMainThreadOutput" constant, the debugger tells me it's null.  I'm imagining that the string that I'm seeing in code never made it over the process boundary correctly and into the memory space of the debugger.

If anyone has any ideas for me, I would be most appreciative.

Thanks.


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>