|
It's defined by the project files I believe. When you chose a debug configuration, the compiler is passed "/D_DEBUG" IIRC.
This is however not the standard way. The standard way is to define NDEBUG (not debug) in release builds. So if you want to be cross platform, you should write code like:
#ifndef NDEBUG
#endif
Also, if NDEBUG isn't defined, then the macro assert is defined (if you include assert.h that is). But I am unsure if VC++/VS.NET defines NDEBUG in release builds or not.
--
There's a new game we like to play you see. A game with added reality. You treat me like a dog, get me down on my knees.
We call it master and servant.
|
|
|
|
|
Thanks, Jörgen pal!
George
|
|
|
|
|
Hi,
Can u help in any way for following query ????????
How can I copy user I/O (eg creating,modifing,reading a file or folder)to a fixed hidden directory ?
So that all orignial file/folder are copied to the hidden directory
When the computer is rebooted,origninal files/folder redirected back to the their location and should override the modified files/folders.
Hoping for a positive response .
|
|
|
|
|
Hi all,
I'd like to write an app which enables mouse shortcuts for not only one specifical app, but for all the apps currently running under windows (i.e. Minimize a window, Switch to next window (like Alt+Tab), ...).
1. Is this really useful ?
2. How would I implement such a thing ? It would require to catch mouse events befors they are dispatchded to the top lying window. Is this possible ?
~RaGE();
|
|
|
|
|
Rage wrote:
Is this really useful
What do you mean when you say mouse shortcuts? My mouse has maximum 3 buttons, and I don't know which of them could bear being responsible for shortcuts
Rage wrote:
How would I implement such a thing ? It would require to catch mouse events befors they are dispatchded to the top lying window. Is this possible ?
Uh ... one thing that occurs to me is installing a hook (SetWindowsHookEx) of type WH_MOUSE. That could solve your problem when placed in a DLL thus having Windows-wide scope.
|
|
|
|
|
Schlaubi wrote:
What do you mean when you say mouse shortcuts
Ever run Mozilla ? If yes, you should know what I mean. Mouse shortcuts are working this way : Hold a button down and draw a simple figure (a vertical line, an horizontal line, a right angle, etc..) then release the button. What you have drawn is detected, and is associated to a command. For instance, if i push right button, then go right, then down, then release it, it would minimize the current top-level window. A drawback is, this must not interfer with the right click possibility of the app associated to the window (for instance if drag and drop is enabled).
Schlaubi wrote:
Uh ... one thing that occurs to me is installing a hook (SetWindowsHookEx) of type WH_MOUSE. That could solve your problem when placed in a DLL thus having Windows-wide scope
Cool .. I was just crawling into MSDN, and found these Hook functions also .. this must be the possibility.
~RaGE();
|
|
|
|
|
Rage wrote:
Ever run Mozilla ?
Let me think about it ..... NO! I must admit I've never in my life used Mozilla. But your information are really interesting ... did not know that anything like that exists ... thx ...
|
|
|
|
|
Hi
I have a problem in a programming project with Visual C++
It is an extension dll for IAS (Internet Authentication Service) to
accounting and authentication dial-in users, this is a program for
using in ISPs (Internet Service Providers). IAS supports the
RADIUS (Remote Authentication Dial-In User Service) protocol.
But my problem:
In the RadiusExtensionProcessEx function when I reject the user
{
*pfAction = raReject;
}
I can add some attributes to the authentication response
{
(*pOutAttrs)[0].dwAttrType = ratReplyMessage; //=18
(*pOutAttrs)[0].fDataType = rdtString;
(*pOutAttrs)[0].cbDataLength = 24;
(*pOutAttrs)[0].lpValue = "Testing Reply Message...";
(*pOutAttrs)[1].dwAttrType = ratMinimum;
}
This specifies a message to display to the user, But if the user
is dialing form windows OS, so this message don't show to he and
windows request from the user to check and type username & password
again for three times.
My question is:
How can I send a custom reply message to windows dial-in users?
or If I cann't do that, So how can I command to their windows OS for
indicate a windows failure message?
Should I send a message with specific format?
I'm waiting for your answer...
Thank you
|
|
|
|
|
Hi, everyone!
What is the meaning of __FILE__ and __LINE__ in the following code?
sprintf (s, "_Assert: %s, %d",__FILE__, __LINE__ )
Another question, where is the two variable defined?
Are they compile system variable?
Thanks in advance.
George
|
|
|
|
|
George2 wrote:
What is the meaning of __FILE__ and __LINE__ in the following code?
___FILE___ is a macro returning the current file. ___LINE____ returns the current line. These are used in debug mode to show you where assertion occur.
sprintf (s, "_Assert: %s, %d",__FILE__, __LINE__ )
will show you the message _Assert : Main.cpp, 123, meaning that this sprintf command was executed in the Main.cpp file at line 123.
However, you can change the meaning of __LINE___ with the #line precompiler directive, but defaut value is current line.
~RaGE();
|
|
|
|
|
And why you would want to #line something STILL has me beat. Unless you're doing some serious code obfuscation.
And they still ran faster and faster and faster, till they all just melted away, and there was nothing left but a great big pool of melted butter
|
|
|
|
|
Peter Hancock wrote:
And why you would want to #line something STILL has me beat
Hey ! I know ! Do not blame _me_ for it, since I've only picked up his sample code, and he probably just asked about a piece of code which he had also not written, so we are not the dumb people in the story.
~RaGE();
|
|
|
|
|
|
hello world..
i want a source code for ping boradcast using visual c++ for my project..can you help me..the application will draw a map for all teh nodes which reply back. plizz.........help me..and the application have an ability to save and load setting when the application restart..
|
|
|
|
|
Im using PreTranslateMessage to fetch all keystrokes that are made in a
dialog.
And I return TRUE, just as I should, for each message that I handle.
Everything works, except for F1, F12 and the windowskeys. I recieve the F1 and F12 keystrokes and return TRUE, but they seem to get handled by the application anyway.
F1 launches help, F12 closes the dialog.
How do I resolve this issue?
|
|
|
|
|
I've had the same problem recently. Seems like the MFC framework insists on handling F1 even if the PreTranslateMessage tells otherwise. The solution is to override OnHelpInfo and do nothing there. As for F12, my app activates the debugger as though a user breakpoint had been called, but this does not happen when executing the app in non-debug mode (CTRL+F5), so basically I did not investigate the issue further.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
You do not need to override OnHelpInfo.
Add this in PreTranslateMessage
// Magical mystical MFC F1 Help msg!
if(pMsg->message == 0x4d)
{
gLog.WriteLogfile("help");
return(TRUE); // Eat it
}
Got it from this article:
http://www.codeproject.com/winhelp/mfchelp.asp
|
|
|
|
|
Why don't you use a keyboard hook in order to prevent those keys to be used?
windows keys can only be disabled (or handled in other way than the original one) by using a keyboard hook.
It's easier than it seems and it allows you to handle all the keys you want once you have the main hook structure done.
Hope this helps...
|
|
|
|
|
Hi gurus,
I have wasted lots my time with this problem...
I have to print the data which there on a dialog box, as you can say it as the caption of a static box, or data of an edit box or the caption of a command button. I have one format of all control on my dialog, and I want to send that data in the same format to the printer which is connected to my system.
I gone thru some articles about printing in this codeproject site. there i found creating some user defined circles and printing those things.
Is there any body to help me, and any other suggestions are also appreciated.
Thanks in advance
-Srijan
|
|
|
|
|
This sounds like you will need to make use of 2 of my printing artcles:
PrintExtension.asp[^]To get print/print preview support into your dialog
and
PrintLongText.asp[^]
which will print out a long line of text in a CString variable across multiple pages. If you can get your data into a string like this then is should do everything that you need (hopefully)
Roger Allen
Sonork 100.10016
This is a multiple choice question, choose wisely
Why did the hedgehog cross the road?
A: To show he had guts?
B: To see his flat mate?
|
|
|
|
|
Hi
Is it possible to write our own operators ( I'm not talking about operator overloading ) in C++, like what the language itself offers. For e.g. currently the switch operator does not work with strings it needs constants so if I'm able to write a operator which would be similar to switch but be able to work strings also then it would be great.
Ciao
- Nilesh
|
|
|
|
|
You cannot add keywords to the C++ language or change their behaviour excepting the mechanisms offered by operator overloading.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Well, you could probably do crafty stuff with defines, but that's not to be recommended at all
(That reminds me of a bit of microsoft code I saw ages ago that used defines to make Pascal style for loops! arrgh!)
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Macros are almost *always* evil.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
I've been using a way to sorta do switch's on strings. The overall idea is to use a function that converts the string to a number. For convienence and speed I used CRC32. I also created a macro/add-in for DevStudio so that I can just highlight some text and calculate the CRC32. For instance:
switch (Crc32( x ))<br />
{<br />
case 0xde080b5a:<br />
OnLicence();<br />
break;<br />
case 0xb644dd13:<br />
Tabs.ShowPage( 1 );<br />
break;<br />
case 0xb4629e6c:<br />
Tabs.ShowPage( 2 );<br />
break;<br />
}
Personally I think it makes the code pretty readable and maintable (If you ignore how badly the html mangles the spacing). Sure it has to do a bit more work, but the code maintainence is a breeze.
Joel Lucsy
|
|
|
|