![]() |
| | #1 |
| Badly Drawn Boy Join Date: Aug 2001 Location: Salt Lake City, Utah
Posts: 1,201
| Programs works one way, not another. VC++ 6.0 help. I have no idea what could be wrong.. I'm using Visual C++ 6.0. When I compile my project, then execute it (Ctrl +F5), everything works fine. The program does what it's suppose to do. But when I execute the program from outside of VC++ (by just clicking on the .exe), it appears to hang. Like it's getting stuck in a loop or something. I have a function in my Bitmapclass called "DrawtoBuffer()." If I comment-out this line, the program works (when I click on the .exe). But, I don't think anything is wong with my function. I mean, it works correctly when I execute from inside VC++ (ctrl +f5)... I'm confused. Why would it work when I launch it one way, but not another? Here's my function, but I don't know if the problem is in here. You know, what with it working sometimes... Code: void cBITMAP::DrawToBuffer(cXYCOORD Position, cBUFFER &buffer)
{
//Edited out. Embarassed by my code. It didn't have anything to
//do with my problem, anway. :)
__________________ Staying away from General. Last edited by ethic; 12-10-2002 at 02:21 PM. |
| ethic is offline | |
| | #2 |
| Registered User Join Date: Apr 2002
Posts: 1,571
| If you're loading a bitmap externally, make sure you have the bmp file in the same directory as your exe. You can put it in the main directory and run your program within VS ( ctrl f5) no problem, but if you go in release/debug directories without moving the bmp it will not work. So just check that first.
__________________ "...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers |
| MrWizard is offline | |
| | #3 |
| Badly Drawn Boy Join Date: Aug 2001 Location: Salt Lake City, Utah
Posts: 1,201
| Thanks a lot. That must have been the problem. It works now.. I had this: MyProject: -PicData (folder) -Debug (folder) ---MyProject.exe I moved the PicData folder into the Debug folder. Thanks again.
__________________ Staying away from General. |
| ethic is offline | |
| | #4 |
| Registered User Join Date: Apr 2002
Posts: 1,571
| Anytime |
| MrWizard is offline | |
| | #5 |
| train spotter Join Date: Aug 2001 Location: near a computer
Posts: 3,448
| Try a messagebox or similar to tell you that the resource was not found. Check the returns from the macros / functions and if they return an error or fail use GetLastError() and print this into a messagebox. Will help your debugging.
__________________ "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter." Friedrich Nietzsche "I spent a lot of my money on booze, birds and fast cars......the rest I squandered." George Best "If you are going through hell....keep going." Winston Churchill |
| novacain is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Compiling x64 code in VC++ 6.0? | cpjust | Windows Programming | 7 | 07-29-2008 09:36 AM |
| Visual C++ 6.0 Pro vs Visual C++ 6.0 Enterprise | Joelito | Tech Board | 5 | 01-23-2007 07:00 PM |
| makefile exported by vc 6.0 doesn't work | wow | Windows Programming | 7 | 03-24-2006 04:20 PM |
| Programs Communicating | Drek | C++ Programming | 1 | 01-26-2002 04:47 PM |
| programming in C with VC++ 6.0 | Korn1699 | C Programming | 4 | 12-07-2001 12:56 PM |