|
Could you please check which SP is installed at yours?
Listing file would be interesting only if it passes.
The original code is quite a bit more complex, and while I can work around this in this one place, I have probably thousands of others wit h a similar structure. The version posted is the "most brittle" one - changing a single thing will fix it.
But from the isolation process I have dozens of iterations that show the same bug in more comple code. (that's the frightening part) It seems to be triggered by rgister starvation for local/temp variables, a function with many parameters, and the killer is always moving an assignment (mov REG, esp) to far up.
I never really know a killer from a savior boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
peterchen wrote:
Could you please check which SP is installed at yours?
Oh, it's SP5. I thought I only had SP4 I must have installed it without letting myself know
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I want to modify/customise the icon of EXE files programatically
For this purpose, I made use of LoadResource, FindResource, UpdateResource and other helper functions.
But, could not achieve the desired result!
Has anyone done such work?, do let me know!.
NK
|
|
|
|
|
There's no easy way to do this! I think your best shot it is to surgically change the bytes of data within the EXE. This will be no mean feat, but there's an article recently published that demonstrates how to surgically read the data - http://www.codeproject.com/useritems/GetIconsfromExeorDLLs.asp[^] - you may be able to adapt the teqnique to modify the images.
Joel Holdsworth
"Outlook not so good"
That magic 8-ball knows everything! I'll ask about Exchange Server next
|
|
|
|
|
Thanks for the reply!
Yeah...I went through the article and also the code!
Found some useful utilities(ResourceHacker) as well on the NET. This tool has an option to change the icon. But after changing the icon, it was not reflected on my windows explorer. I had to copy and paste the file to see the new updated icon. Presently, I am using this tool to debug what my program is updating in the resource file. As you rightly put it, its not an easy task!.
|
|
|
|
|
I want to change the title bar color of application,
there is an API "SystemParametersInfo" that can do that, but
It changes the color of title bars of all applications, where as I want to change only the color of my application's titlebar.
I know that painting non-client area we can do it, but there are numerous dialogs in application, painting in each of them is difficult, due to some reasons I avoid this technique.
Is there a more simple solution?
Please Help?
|
|
|
|
|
pc_dev wrote:
I know that painting non-client area we can do it, but there are numerous dialogs in application, painting in each of them is difficult, due to some reasons I avoid this technique.
Is there a more simple solution?
non-client painting is the way to do it. Just create a base class for all your dialog that will take care of that, and just pass a color to each dialog.
On the other hand, maybe skinning can do that, but it is still the same thing, painting the non-client area.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
This article covers that topic
Custom captions[^]
If you vote me down, my score will only get lower
|
|
|
|
|
Hi
When I create an "out-of-the-box" MDI application with the project wizard (using Visual C++ .NET 2003) with a CView as child (so every setting in the wizard is left on default) then the OnMove() function fires only twice - at the start of the application.
<br />
void CTestOnMoveView::OnMove(int x, int y)<br />
{<br />
TRACE("CTestOnMoveView::OnMove (%d/%d)\n", x, y);<br />
CView::OnMove(x, y);<br />
}<br />
...results in...
<br />
CTestOnMoveView::OnMove (0/0)<br />
CTestOnMoveView::OnMove (2/2)<br />
Afterwards OnMove() is never called again, no matter how I move, resize, maximize and minimize the application window and/or the child window. Only if I close the document/childwindow and make a new one ("File"->"New") then OnMove() is called again twice, then no more afterwards.
Sorry, I just don't get it
OnResize() on the other hand works 100% as expected, firing every time the size of the window is someway changed.
Any help welcome,
thanks,
T.T.H. / Matthias
|
|
|
|
|
That is because the View never moves...
The view window is actually a child window of your CChildFrame (from CMDIChildWnd),
and (almost) always sits at (0,0).
When you drag the "View" about, you are actually dragging the frame about. The view
sits still relative to its parent window.
When you resize the "View", you actually resize the frame. The frame resizes the View,
which is why you get WM_SIZE messages!
If you really need to know that you've moved, move your functionality into CChildFrame.
The child frame can be useful, as you can (e.g) toolbars to each frame, instead of
just having the main ones.
Hopefully that made sense!
Iain.
|
|
|
|
|
My question is I have a Dialog Form. If I move the mouse on the form , ToolTipText should appear with a message "mouse is on the move".
The section of the block is given below
void CDialogBackGroundDlg::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CDialog::OnMouseMove(nFlags, point);
}
How will code the block for the OnMouseMove with ToolTipText facility?
Can anyone please help me regarding this matter.
Philip
|
|
|
|
|
i want to get ethernet card(RS-232 serial)'s ip address & MAC address.
|
|
|
|
|
Use following
for IP
"gethostbyname" it returns pointer to "hostent structure" which contains IP
for MAC address
"GetAdaptersInfo"
|
|
|
|
|
can i get my ethernet card information?
how to use GetAdaptersInfo function.
i have already get local pc computer ip address and mac address.but this is only for computer.
i don't know,how i can get other device ip address(may be printer,fax,bar code reader) in my network.
can i get device information..???
please , explain me...
|
|
|
|
|
vc-programmer- wrote:
how to use GetAdaptersInfo function.
See here.
vc-programmer- wrote:
i don't know,how i can get other device ip address(may be printer,fax,bar code reader) in my network.
One way, if you know the name, would be with gethostbyname() .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hello,
For years I was using a methodology described in Ellemtel Code Conventions and Rules[^], but lately I had a discussion with a collegue about the order of #include files on a C/C++ source file.
The header files contain:
- All header files contain a technique for preventing multiple inclusion
- All modules contain a public header file for providing prototypes and other dirty stuff towards the world. (most of the cases all the modules contain a pair of files: header and implementation)
- Some modules have also a private header file.
- Any header file can contain preprocessor stuff, type definitions, global variables. and function prototypes
What is the order you think these include files should appear on any implementation file? (pick them out of the list below)
- Group A: System header files(
#include <....> ) - Group B: Public header file for the file.
- Group C: Private header file for the module if any.
- Group D: Other header files from your code.
In your oppinion, what is the correct include order? (Based on your experience/knowledge)
I
-- Ricky Marek (AKA: rbid)
-- "Things are only impossible until they are not" --- Jean-Luc Picard
|
|
|
|
|
Typically (for me), it would be...
#include "stdafx.h"
#include <afxtempl.h>
#include <string>
etc.
#include <Utilities.h>
#include <<a href = "http://www.codeproject.com/buttonctrl/LedButton.asp">LedButton.h</a>[<a href = "http://www.codeproject.com/buttonctrl/LedButton.asp" target = "_blank">^</a>]>
#include <ThisDll.h>
#include "ThisClass.h"
#include "resource.h"
I make sure headers files I've written come after "system" ones, to make sure I
don't mess up any defines, etc. In practise, it matters very rarely. But it has
mattered in the past, so I try to be good!
Iain.
|
|
|
|
|
Hi
Although is not strictly what you are asking it may be a usefull information.
Order usually matters when a header file is not well written. This means that either it does not contain required definitions (thus relies on a accidental inclusion of another header file above to be completed) or two headers contain the same definition and when they are both included may produce problems. Thus, despite the chosen order a good advice is to write your private headers carefully.
Personaly when I write them I follow the following style: Assyme that I write a header called myheder.h. It would be in the style
// A unique symbol to protect my code
#ifndef MY_APP_MY_HEADER_H
#define MY_APP_MY_HEADER_H 1
..... include headers required for that header file
.... write here the actual header code
#endif /* MY_APP_MY_HEADER_H */
Headers written this way are guaranteed to be included once and be self contain. Their inclusion then is order independant.
|
|
|
|
|
Hi, this is my first post so I'll try to sound like I know what I'm talking about... :->
I want to make an application in VC++ to emulate a drive on windows (ex H: ) and use it to access files that are stored on an ftp server (like South River Technologies' WebDrive does). I just don't know where to find documentation on how to emulate a drive on windows OS. Any pointers would be appreciated
Matt
|
|
|
|
|
Have a look at Shell Namespace Extensions. There's a few articles around here that should help, particularly the ones by Michael Dunn.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Thanks, that's exacly what I was looking for
|
|
|
|
|
I really have no experience when it comes to creating documents for printing. Actually, I do not know anything when it comes to writing code for printing. For example, in a database application which I wrote about a year and half ago I would like to add the capability of creating reports similar to those in Access. I do not know from where to begin. Do I just create a window and then I add text and lines to it and then send that window to a printer? This is the only idea that pops into my head but it sounds so inefficient.
Is there a place online where I can read some tutorials? It doesn't really have to be about creating reports but something similar about creating documents and printing them.
// Afterall, I realized that even my comment lines have bugs
If the sun were to blow up, it would take us 7-8 minutes to realize it.
|
|
|
|
|
You've got lots of choices, but it depends on what dependancies you can afford to introduce into your software.
If you already have the reports in access how about using access via the COM automation interfaces. Alternatively word automation is probably easier to get started with, especially if you want to construct temporary html files and then load them in word, or use ShellExecute api to print. If clients can't be guaranteed to have office you could also use IWebBrowser2 and related interfaces (perhaps IHTMLWindow3) to provide a low dependancy (only the standard internet explorer control) printing method - I haven't used this approach but I don't see it being too hard.
Another report generation idea is to convert the results of queries to xml and then use xslt as a flexible and extensible formatting system.
Alternatively MFC has extensive documentation on printing.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts your aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Printing is very similar to drawing on the screen - you use a device context and draw to it. The only thing you really have to watch out for is separating the documents into pages (CDC::BeginPage() and CDC::EndPage() in MFC) and remember that the printing resolution is a lot higher than the screen, so use CDC::GetDeviceCaps() to get the DPI of the printer. Use CPrintDialog to show the print dialog to the user, and the dialog also returns a device context for the printer which is already setup, so all you'll need to do is draw to the DC. Have a look at the documentation for more info, but it really is actually quite easy.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
In addition to the previous advice, you would do well to search for articles on codeproject
by its defacto printing guru Roger Allen[^]. He has quite a few printing articles, with and
without views, etc. He's also a nice chap, but tell him I said that. He'll get big headed.
Iain.
|
|
|
|