Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!mailrus!wuarchive!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!caen!juice.engin.umich.edu!bdlepla From: bdlepla@caen.engin.umich.edu (Bryan Dennis Lepla) Newsgroups: comp.windows.ms Subject: Re: Getting simple debug output Summary: Use MessageBox(... Message-ID: <1990Sep3.213733.16037@caen.engin.umich.edu> Date: 3 Sep 90 21:37:33 GMT References: <1990Aug3.184951.5599@cs.umn.edu> Sender: news@caen.engin.umich.edu (CAEN Netnews) Organization: The University of Michigan, Ann Arbor Lines: 33 In article <1990Aug3.184951.5599@cs.umn.edu>, wytten@cs.umn.edu (Dale Wyttenbach) writes: > I'm a experienced X11 programmer trying to write my first MSW > program, and having a difficult time getting simple debug > output from my program. (I'm trying to avoid learning yet > another debugger) > > Right now I'm just opening a file called debug.txt and writing > stuff into that, but I'd like to have a quickie function that > pops up a dialog box with a message, sort of like this: > > sprintf(buf,"a= %d, b=%d",a,b); > debugwin(buf); > > I would like to do this with a dialog box, but I don't know if you can > pass the buf in since dialog boxes are defined in the .rc file. > (Remember I'm brand new at this) Does anyone have something like this > they would share? Any better ideas? "debug" doesn't appear in the > index of any of the manuals we got with the SDK. > > Thanks, > > Dale Wyttenbach > wytten@cs.umn.edu Dale, you're on the right track. Use MessageBox instead. MessageBox(hWnd, buf, "Caption",MB_OK); where hWnd is the handle to the window that creates this message box. It will create a box with your message and will wait until you hit return. I got this straight out of Petzold's book _Programming Windows_. I highly recommend it. (Or wait a couple months for his 3.0 update.)