Jump to content

cout breaks coinitialize


aqstws

Recommended Posts

I'm old at c++ but new to COM. coinitialize() works if I remove all uses of cout. If I include a single cout, such as cout << "top" << endl; anywhere in the code...even much later than my coinitialize call, coinitialize() fails. Of course I #include to get cout to compile. I am using Visual Studio 2003. A lot of trial and error has not worked for me yet. Has anyone had this observation and gotten around it?

aqstws

Link to post
  • 2 weeks later...

I am using printf. I don't have a problem printing. Even cout prints. But my problem is not getting strings out. It's that I don't know why it breaks a COM function. I have other COM code problems, and so I am trying to make sure that every COM function I use works exactly how it should work. How can an unrelated c++ function have this effect on COM? I'm learnign COM. Its' COM that's showing me something I don't understand. Does COM set up a streaming path, like cout uses?

The convenience of cout is that in the strongly typed code of c and c++, I don't need to know the variable types of whatever I am printing. I don't know how c++ does this. Does COM need that streaming pathway?

Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...