Aqua-Soft Forums: cout breaks coinitialize - Aqua-Soft Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

cout breaks coinitialize Rate Topic: -----

#1 User is offline   aqstws Icon

  • Group: Member
  • Posts: 3
  • Joined: 26-December 08

Posted 26 December 2008 - 08:37 AM

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
0

#2 User is offline   djwilliams Icon

  • Group: Member
  • Posts: 277
  • Joined: 15-February 05

Posted 03 January 2009 - 09:47 PM

try using fprint?
0

#3 User is offline   aqstws Icon

  • Group: Member
  • Posts: 3
  • Joined: 26-December 08

Posted 05 January 2009 - 05:33 PM

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?
0

#4 User is offline   djwilliams Icon

  • Group: Member
  • Posts: 277
  • Joined: 15-February 05

Posted 09 January 2009 - 05:12 PM

no there are no conflicts that I know besides "getche()" are you using a loop or logical if thats being broken by value returned null?
0

#5 User is offline   herd Icon

  • Group: Developers
  • Posts: 999
  • Joined: 02-November 03

Posted 09 January 2009 - 07:17 PM

Are you doing multiple threads? COM is very stubborn with threading.
If not, it still needs to have someone poll the window procedures so that its SendMessage based marshaller can operate...
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic