Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Visual C++ Dark GDK and forms

Author
Message
zog
16
Years of Service
User Offline
Joined: 13th Dec 2007
Location: Southport UK
Posted: 16th May 2008 21:05
I am using the express edition of MS - Visual C++ with dark GDK. Is there a way to create simple dialog boxes to help me to debug my project ?
I tried to add a windows form to my project, but the linker complained that clr and dark GDK applications compiler switches were not compatible. I can not add resource dialogs to my project as these have been removed from the express edition as well. I have MS Visual studio 2005, but I haven't used it much as I detest .net

Thanks for any help in advance

Jack Taylor

Jack Taylor
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 16th May 2008 21:16
You can define a char buffer and use sprintf to fill it and use MessageBox to display a modal dialog box containing the text.

char debugtext[256];
int intvalue = 42;

sprintf(debugtext, "%i", intvalue);
MessageBox(NULL, debugtext, "MyApp", MB_ICONINFORMATION);

MessageBox can be used after including windows.h, and there are many options available in the flags parameter.

Actually, only the editor is missing, the resource compiler is in there. You need two files for creating resources...resource.h and appname.rc Both are text files, and you can actually make any resource available if you know how the two files interact and how to define a resource in the first place.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 16th May 2008 21:45 Edited at: 21st May 2008 18:42
You could make a log file or call WinAPI message box dialog thats in the API if you want... but I think you want to be in windowed mode - it might wreak havoc in full screen mode.

I have a DarkGDK OOP library http://code.google.com/p/darkgdkoop/ that has a logging system built into it.... it has a gui too... but I haven't made microsoft'ish dialog boxes yet...

To integrate to your project...

1: Download the current release
2: Unzip
3: you would "include existing" files to your project - all the j*.cpp and j*.h files in the GamesClasses folder, and all the j*.cpp and j*.cpp files in the FoundationClasses folder. I recommend placing these in a new "filter" so they are not listed alongside your project - easier ro remove them from your project this way. (New filter is when you right click project from inside tree view, you'll see the option)
4: In your project properties area, you would tell it the directories of the GameClasses folder and the FoundationClasses folder. Look at a demo project's properties in Jegas, LLC Game Classes solution to see what I mean.

Then in your program.... add the following includes


The library does alot of display init... so if you don't wish to adopt this code, just call my init first, then yours, for just a file log, it shouldn't matter. Here's a sample program I just tossed together to show you how to get the log file going as quick as possible using this system of mine... (Could just roll your own of course)



[edit] sorry JinZai - I was posting same time as you.. just took me awhile.. I was in my vs2008 writing the little demo...[/edit]

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 16th May 2008 22:22
Sample out put... forgot to send it:


zog
16
Years of Service
User Offline
Joined: 13th Dec 2007
Location: Southport UK
Posted: 17th May 2008 17:25
Thanks for your help Jason and Jinzai. I will have a look at your solutions. I will also try copying across resources created with 2005 and see if the compiler will link them.

Jack Taylor

Jack Taylor
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 21st May 2008 18:41
goodluck - I modified above code snip - if you use JGC:addy->Update() - it calls sync for you.

Login to post a reply

Server time is: 2024-11-20 11:20:26
Your offset time is: 2024-11-20 11:20:26