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 / Making error messages of your own? [VC++2008]

Author
Message
Murloc
15
Years of Service
User Offline
Joined: 28th Dec 2008
Location: Utena,Lithuania
Posted: 31st Jan 2009 17:23
I wonder if this is possible. I have done a quick search in the documentation and didn't found anything about this. So is it possible to make your own errors? For example if something goes wrong and returns -1 it makes Error with code 1 pop up.

Sorry for my english.

~Murloc.

Theory-When you know everything,but nothing works.
Practice-When everything works,but you don't know why.
Programming merges these two-Nothing works,and you don't know why.
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 31st Jan 2009 17:31
Have a look at EXIT PROMPT .



It makes a little message box when the program ends .

Otherwise have a look at Goga's Free DBP Plugin. It's got all kinds of message boxes that can run even while the program is running.

Murloc
15
Years of Service
User Offline
Joined: 28th Dec 2008
Location: Utena,Lithuania
Posted: 31st Jan 2009 18:29
As you can see in the topic's tittle it is Visual C++ 2008 GDK I need it for C++ not DB or DBP either :p

Theory-When you know everything,but nothing works.
Practice-When everything works,but you don't know why.
Programming merges these two-Nothing works,and you don't know why.
jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 31st Jan 2009 19:47
You can use int MessageBox(
HWND hWnd,
LPCTSTR lpText,
LPCTSTR lpCaption,
UINT uType
); to show a little message box. Example:
Murloc
15
Years of Service
User Offline
Joined: 28th Dec 2008
Location: Utena,Lithuania
Posted: 31st Jan 2009 20:01 Edited at: 31st Jan 2009 20:01


Works like a charm! Thanks!

P.S. http://msdn.microsoft.com/en-us/library/ms645505.aspx yay!

Theory-When you know everything,but nothing works.
Practice-When everything works,but you don't know why.
Programming merges these two-Nothing works,and you don't know why.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 31st Jan 2009 21:00
One of the good things about the GDK is that, usually, advice that works for DBPro also works for the GDK.

Exit Prompt is a case in point.

This DBPro code:


becomes this C++ code:


Don't be so quick to dismiss what people say simply because it's centred about DBPro.

Murloc
15
Years of Service
User Offline
Joined: 28th Dec 2008
Location: Utena,Lithuania
Posted: 31st Jan 2009 21:14
Thanks again

But sometimes there are people who can't read the title of the topic ^^

~Murloc.

Theory-When you know everything,but nothing works.
Practice-When everything works,but you don't know why.
Programming merges these two-Nothing works,and you don't know why.
Murloc
15
Years of Service
User Offline
Joined: 28th Dec 2008
Location: Utena,Lithuania
Posted: 31st Jan 2009 21:25 Edited at: 31st Jan 2009 21:35


Believe or not,but this function does NOTHING at all

EDIT: Fixed. lol

Theory-When you know everything,but nothing works.
Practice-When everything works,but you don't know why.
Programming merges these two-Nothing works,and you don't know why.
Hayer
19
Years of Service
User Offline
Joined: 4th Nov 2005
Location: Norway
Posted: 1st Feb 2009 22:28
If your using C#.Net I suggest you check out where expections.

Login to post a reply

Server time is: 2024-11-25 13:50:43
Your offset time is: 2024-11-25 13:50:43