|
Because the value of msgID is not known at compile time, it is generated at run time, and the compiler must know the value of any constant used in case statements. You have to use an if else construct for registered messages.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
i think ,you go for if statement for resolving Registered message id before Switch statement
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
ting668 wrote:
why?
Case expressions must be integral constants.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi, can anybody tell me abt how to find vendor of a scsi hard disk using c++ ?
As SCSI command: READ_CAPACITY does not give u this information
Thanks & Regards
|
|
|
|
|
Anonymous wrote:
Hi, can anybody tell me abt how to find vendor of a scsi hard disk using c++ ?
The vendor's name is typically not part of a piece of hardware. Are you perhaps referring to the manufacturer's name (e.g., Seagate, WD, Hitachi)?
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hello all.
I am creating a CRichEditCtrl derived class, and I want it to be always a read-only edit box.
I guess I should use somewhere the SetReadOnly() function but, which method should I overwrite?.
I have created a Dialog with a CEdit, I've used the class wizard to add a control variable for the CEdit, and I've writen my clase name instead the CEdit one (the usual procedure, I think).
I've tried to overwrite several functions, like OnCreate, but they are never called (I'm sorry about my ignorance
Thanks in advance.
|
|
|
|
|
cbusgut wrote:
I guess I should use somewhere the SetReadOnly() function but, which method should I overwrite?.
Have you tried PreSubclassWindow() ?
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Thank you very much. That was what I was looking for!
|
|
|
|
|
Hai Frens
I am facing a prblm with modeless dialog.
I am taking the parent for child dialog as desktop passing GetDesktopWindow() function in Create() func of dialog. Now the prblm is once i close the child, the parent is not getting enabled automatically. Only if i click it will get enabled.
What i want is the parent should get enabled automatically if i close the child. . .
Could any body help me to get it out this prblm. . .
thanx
bye
|
|
|
|
|
on WM_DESTROY of your modeless dialog set the focus to the desktop window...
Hope this helps you,
Greetz,
Davy
|
|
|
|
|
My application is a SDI and i am invoking the modeless dialog from the menu item click. Once i close the dialog the SDI should get enaled. Which function i have to use set the focus for desktop window. . .weather i have to set focus for SDI or desktop?
Thanx
|
|
|
|
|
uueeMy application is a SDI and i am invoking the modeless dialog from the menu item click. Once i close the dialog the SDI should get enaled. Which function i have to use set the focus for desktop window. . .weather i have to set focus for SDI or desktop?
Thanx
|
|
|
|
|
I think this should set the focus to the main window of your app...
::SetFocus(AfxGetMainWnd()->m_hWnd);
Greetz,
Davy
|
|
|
|
|
sorry Davy. . .Its not working.
I tried it by placing the ::SetFocus(AfxGetMainWnd()->m_hWnd)func in the OnDestroy()func of child.But its not working. Do u have any other idea.
Thanx
|
|
|
|
|
Hi,
Try using SetWindowPos. Have a look @ msdn. i think it is having some same source related to it
Sujan
|
|
|
|
|
Hi
sorryI am not replying your message. ButI wantto knowhow I can also make my name go scrolling as ur "BARIN" does here ....Could u tell me ?
Dharani Babu S
|
|
|
|
|
Actually I tried to make new window which is applied setWindowRegion.
the region was got from BeginPath TextOut EndPath CRgn::RegionFromPath
then make window itself fade out on timer event..
Does that make sense?
But the region which has text area is not neat..
So, I want to listen your opinion..
How can I make text fade out on screen..
the text should have transparent background..
Does anyone have idea?
|
|
|
|
|
Draw text into a transparent window - the background will show through the window and you can see your text.
Change the alpha or gamma of the transparent window over time?
Thus causing your text to disappear?
|
|
|
|
|
if drawing text onto the transparent window,
I wont be able to see the text...
right?
|
|
|
|
|
As I understand it, a transparent window means that the BACKGROUND shows through.
If you don't erase the background of your window and fill it in with anything, what is beneath it will show through. Anything you DRAW in your 'transparent' window will still be on top of whatever is showing though.
So, if you only draw your text when you get the WM_PAINT for your transparent window, the text should show up fine.
|
|
|
|
|
Sorry, I'm still confusing...
You say transparent window,, does that mean layered window?
What I tried was drawing some text on the layered window..
But the text was diaspearing as the window's getting transparent..
|
|
|
|
|
But what I'd like to do is draw 100% opaque string onto the 100% transparent
window..
Thanks anyway, Blake
|
|
|
|
|
Hi
I have a short question about debugging in C++. Let's say I have a member variable that rarely changes, and in my program I suspect there's an invalid modification made to this variable that causes my program to crash. Is there a way to set up a debugger in such a way that it will trap when the variable is changed?
Simple text find in the source files won't do, since more complex circumstances (e.g. int tmp[100]; memcpy(tmp, some_buffer, 101*sizeof(int) /*oooops*/); ) MAY also change the value of the variable if it's located right after tmp[99], and these kinds of error won't be detected by source files text find.
Thanks!
|
|
|
|
|
Hello Indrawati,
You've touched on one of my favourite debugging techniques. I assume that you are using Visual C++ 6.0.
Do the following :
1. Put a breakpoint at the place where your member variable is first created, A good place would be when your object is instantiated.
2. Start to debug your app.
3. After your object has been created and initialized, select and highlight your member variable.
4. Press SHIFT+F9 to bring up the Quick Watch window.
5. You will see your member variable displayed on the edit box labelled "Expression".
6. Put a '&'symbol just infront of your member variable. The memory address of your member variable will appear on the value column.
7. Remember this memory address.
8. Now press CTRL-B to bring up the "Breakpoints" dialog box.
9. Select the "Data" tab in the "Breakpoints" dialog box.
10. In the edit box labelled "Ënter the expression to be evaluated", type in the memory address of your member variable.
11. In the "Enter the number of elements to watch in an array or structure" edit box, type in the number of bytes that your member variable would take up.
12. Click "OK".
You now have a memory address breakpoint. Whenever the contents of this memory address changes (up the the number of bytes you specified in point 11), a message box will appear rto indicate to you that changes have occurred.
Hope this advise will help you.
Best Regards,
Bio.
|
|
|
|
|
Cool Bio ...
Have been searching for this till now ...
Dharani Babu S
|
|
|
|