|
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
|
|
|
|
|
Uhm. You call this maintainable? CRC checksums?
--
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.
|
|
|
|
|
Jörgen Sigvardsson wrote:
Uhm. You call this maintainable? CRC checksums?
With the proper tools, yes. All I have to do to update a string is highlight the checksum and corresponding string, including the comments, press a toolbar button and it's updated. Perhaps it's just me, but I dislike seeing a bunch of if statements. I'd rather see a switch. Note that I would not attempt this if I didn't have a add-in to regenerate the checksums. I even toyed with the idea of writing a small app that could be used in a pre-build custom step that would automatically refresh or generate any of the checksums. But I haven't run into any problems keeping up to date with the dozen of projects and numerous locations within each project. It just seems to work. If you have a better idea (and don't say a bunch of if's), then let me know. I realize it's not the most elegant, but it is quite efficient and, for me, quite readable.
Joel Lucsy
|
|
|
|
|
hey everyone, simple question
it seems like it should be so easy too, i just need to call use
CAboutDlg hey;
hey.DoModal();
from my main App Class.
its a dialog based project, and I get compilation errors like the app class cant see the cabout class.... please help, thanks
Deleting intermediate files and output files for project ' - Win32 Release'.
--------------------Configuration: - Win32 Release--------------------
C:\WINDOWS\Desktop\Eye.cpp(121) : error C2065: 'CAboutDlg' : undeclared identifier
C:\WINDOWS\Desktop\Eye.cpp(121) : error C2146: syntax error : missing ';' before identifier 'hey'
C:\WINDOWS\Desktop\Eye.cpp(121) : error C2065: 'hey' : undeclared identifier
C:\WINDOWS\Desktop\Eye.cpp(122) : error C2228: left of '.DoModal' must have class/struct/union type
EyeSpy.exe - 4 error(s), 0 warning(s)
todo....
:: insert inpirational text here ::
|
|
|
|
|
You need to #include the file that CAboutDlg is defined in.
he he he. I like it in the kitchen! - Marc Clifton (on taking the heat when being flamed)
NEW: Awasu v0.7[^]: A free RSS reader with support for Code Project.
|
|
|
|
|
it is included. thats whats strange, and was the first thing i checked.. ill post code when i get home tonight.
todo....
:: insert inpirational text here ::
|
|
|
|
|
Here's a weird bug: whenever I clean up my list control (before repopulating it with data), I loop through it and delete memory I allocated for each entry. At the same time, I make a call to the SetItemData() method. The code looks like this:
delete node;<br />
m_PhotoList.SetItemData(i, 0);
For some strange reason, when I do this my OnItemChanging() method gets called. In that method, I set some data (in the node that I created). Obviously, since I've just deleted the node (because I'm cleaning up the list control), an exception is thrown (for accessing memory not available).
Anyone have [b]ANY[/b] idea why this is happening? This has really gotten me stumped...
Jonah Bishop
Visit JGB Productions
|
|
|
|
|
LVN_ITEMCHANGING sends an NMLISTVIEW struct. The uChanged member tells you what changed in the item, so I bet if you inspect that member, it will contain LVIF_PARAM , meaning the LPARAM (ie, item data) changed. Your handler can ignore the notification in that case.
--Mike--
I'm bored... Episode I bored.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I have a CFormView that has an edit control, and my program has an accelerator key binding to the Delete key. When I select a word in the edit control and press Delete, the accelerator binding is invoked rather than the word being deleted in the edit control.
So, in other words, I want the delete key to act normally when my edit control has the focus. How can I correct this problem?
Jonah Bishop
Visit JGB Productions
|
|
|
|
|
Do Arab fonts require UNICODE???
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I don't think so, if the system locale ( and codepage ) is set to some arabic language country/region, it might work. I know that the resource editor is not UNICODE, and will work in codepage.
but UNICODE will make life easier.
Max.
|
|
|
|