|
Change the ID in resource editor.
Kuphryn
|
|
|
|
|
Look at following C statements:
const char ch = 'c';
char* pc = (char*)&ch;
*pc = 'd';
printf("%c[%u]\n%c[%u]",ch,&ch,*pc,pc);
Output of this code is as follows:
c[6684148]
d[6684148]
What I want to know is if both addresses are same then how the value can be different?
Thanking You...
C.R.Naik
|
|
|
|
|
I suspect that when printf() was evaluating the variables, it knew that 'ch' was a const, thus could only have its original value (i.e., why bother re-evaluating something that is known not to change). Step through this code with the debugger and watch the changes each statement makes.
|
|
|
|
|
Chintan wrote:
Amazing !!!!!!
Not really. The compiler treats constant variables very similarly to #defines. It replaces the value of ch with 'c', which is what it is initialised with, simply because it is constant. The compiler does not care what sort of pointer trickery you perform. It assumes that a constant variable is constant, which it should be.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
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"
|
|
|
|
|
Hi all, first post here
I have a Custom AppWizard project right now. How can I set, from code, the Executable for debug session and specify Additional DLLs of the generated project? I have looked at the IBuildProject and have customized several preprocessor and linker options with it. I have also located where the Executable for debug session and Additional DLLs information is stored (opt file) but it's Binary so I dont think I can edit it directly.
I hope there is a way...
Eamon Millman
2nd Year Computer Engineering
University of Victoria
|
|
|
|
|
Friends,
I was playing with "Windows Media Player", suddenly an error occured in the application. A dialog box popped up on which the name of "cpp" was written and also the line number in "cpp" file also written where the error occured.
I also want to add such feature in my release builds. How can i do so ?
|
|
|
|
|
Use __FILE__ and __LINE__ constants to do it.
like this:
char lpBuffer[240];
sprintf(lpBuffer,"File: %s\n Line:%d",__FILE__,__LINE__);
MessageBox(NULL,lpBuffer,"Message",MB_OK);
|
|
|
|
|
I've subclassed CButton to draw the text with different fonts and font sizes. The problem is that when the focus rectangle is draw on radio buttons and check boxes it's size is relative to the default font.
Is there anyway to change the size of the focus rect or to draw it myself?
Thank you
Artur Jales Moreira
|
|
|
|
|
You can draw a focus rectangle using DrawFocusRect() (or CDC::DrawFocusRect() if you're using MFC). You'll have to calculate the size of the rectangle yourself.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
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 know that! The problem is that when the control has focus there will be two rects. I was looking for a way to tell windows the size of the rect, or to disable windows to draw it so that I could draw it myself.
Artur Jales Moreira
|
|
|
|
|
jales wrote:
I know that!
Good
Unfortunately, you can't tell Windows the size of the focus rect.
The only way to prevent Windows from drawing the focus rect is to completely handle WM_PAINT without relying on the default at all. The best way would be to make an owner-draw control - then you wouldn't have to worry about subclassing it - MFC would do the hard work for you. You'd have to do all the painting yourself, but DrawFrameControl() could take some of the hard work out of it .
Hope this helps
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
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'm handling WM_PAINT. But windows still draws de focus rect.
Artur Jales Moreira
|
|
|
|
|
Try handling the WM_SETFOCUS/WM_KILLFOCUS messages and draw/erase the focus rect yourself (don't call the base).
|
|
|
|
|
I'd recommend creating an owner-draw control. Windows won't draw anything for an owner-draw control, and delegate everything to your control.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
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"
|
|
|
|
|
try taking a look at the classes present here in CP, my favourite is the one from Davide Calabro CButtonST, it has a lot of properties and it's great to learn how to manage things like what you want to do...
hope this helps...
|
|
|
|
|
easy
in WM_ERASEBACKGROUND, return 0
includeh10
|
|
|
|
|
Dear all,
This may seem like a strange question but I am working with some old 16 bit windows applications build with Visual Studie 1.52.
I was wondering if there are any way to force this application to have more process time from the OS?
Best regards
Michael Nyrup
|
|
|
|
|
Nyrup wrote:
I am working with some old 16 bit windows applications build with Visual Studie 1.52
You poor thing
Nyrup wrote:
I was wondering if there are any way to force this application to have more process time from the OS?
Windows 3.x uses cooperative multitasking, not preemptive multitasking like Win95 and later. If you just hog the processor, you cut out other processes.
From memory (admittedly, my Windows 3.x memory is a little bit rusty ), Windows only switches between processes when a process calls the Yield() or GetMessage() functions. If you call them less often, then you get more processor time, at the expense of other processes.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
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"
|
|
|
|
|
The 16-bit app runs in a 32-bit VDM process, so you can do the following:
Right click the app's pif and set the Idle sensitivity to low.
-or-
Boost the priority of the VDM process.
|
|
|
|
|
I necessary to do window, which there was inactive and always inhere over all windows (even over DirectX)
|
|
|
|
|
SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
Jeremy Falcon
|
|
|
|
|
I necessary that window there was over DirectX, for instance over game and in game possible there was orderly play.
|
|
|
|
|
|
Yes. Look at the AlphaBlend() function.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
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"
|
|
|
|
|
... the middle button of my mouse in a dialog MFC app ? Is there any message associated to it (like WM_LBUTTONDOWN f.i.) ?
~RaGE();
|
|
|
|