|
dNimrod#X wrote:
Can someone tell me what the class name of a dialog box is?
#32770
dNimrod#X wrote:
Also, if you think there is a better (more correct) way of doing this, please do let me know!
By sending a window a WM_GETTEXT message, you risk entering a deadlock state if that window is in a blocked state (i.e., its message pump is not processing messages). I'm not saying that will happen to you here, but it is something you need to consider.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
dNimrod#X wrote:
Can someone tell me what the class name of a dialog box is?
You should try the excellent Spy++ tool which comes with visual studio. It's called spyxx.exe, and it lets you inspect any window. Just hit ALT+F3 when it's started, and a dialog with blue/white icon will show up. Just drag the icon onto any window it'll highlight the window you selected in the tree view. Double click the treeview item or right click it. You can even spy on window messages for any window which is really handy sometimes. Have fun exploring!
--
Arigato gozaimashita!
|
|
|
|
|
U can use the SPY++ utility which comes with VC++ to get these informations
|
|
|
|
|
I have seen this done in a program I don't remember which, where the program woud allow you though and option to show or hide all icons on the desktop.
You can accomplish this manually in WinXP by right clicking on the desktop and selecting
Arrange Icons By | Show Desktop icons.
I have searched everywhere and how not found any info on the subject.
So, please how do you do this programmatically?
Thanks,
|
|
|
|
|
Hai,
I'm new to C++.I'm declaring a function and using it in main.cpp. If I want to use that function in my class say class1.cpp..how should I do that.
Thanks.
|
|
|
|
|
Hello,
If you want to associate the function with the class, exemple use data members from the class without passing them as arguments, make the funtion a member function of the class:
<br />
class A<br />
{<br />
public: <br />
void YourFunction();<br />
};<br />
If you want to call that function from a member function (say constructor) you can do this (there's nothing special about it...)
<br />
A::A()<br />
{<br />
YourFunction();<br />
}<br />
Hope this helps..
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
Hai ..
Thanks o lot..but i think my question is different ..I'm declaring the function in main.
it's somewhat like this..
void myfuntion()
main()
{
..
myfunction();
}
myfunction()
{
...
}
class A
{
public:
void mysecondfunc();
}
void A::mysecondfunc()
{
myfunction(); --->if I use like this it is giving error identifier undeclared, not found
}
how should resolve this..
Thanks again.
|
|
|
|
|
Hello,
In that case, you simply need to declare the function before you use it. The most common case would be in a header file. The implementation is done in the corresponding .cpp file. For exemple:
Consider your function MyFunc, in the header file (say MyHeader.h) you declare the function like this: void MyFunc();
You define the function in the implementation file say MyFunc.cpp like this:
<br />
void MyFunc()<br />
{<br />
}<br />
Whenever you want to use MyFunc, just include MyFunc.h at the top of the file where you use the function.
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
Hai,
Thanks again..I tried this..but it gives an error that func redefined or already defined in obj..what am I missing here..
Thanks a lot.
|
|
|
|
|
Delete all the .obj files and do a completely rebuild the project...
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
You probably still have a prototype at the top of main.cpp . If that is the case, delete the prototype and replace it with a #include statement instead.
You'll then need to modify the .h file so that it gets included only once. Check out the .h files that ClassWizard produces to see the directives that are used.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi,
I used next code:
<br />
if(labMask.hideemptyrows == true){<br />
mc_hideemptyrows.SetCheck(BST_CHECKED);<br />
OnCheckHideemptyrows();<br />
}
else{<br />
mc_hideemptyrows.SetCheck(BST_UNCHECKED);<br />
}
strange thing is: when labMask.hideemptyrows = true, the "else" statement is performed !!!
if I do this:
if(labMask.hideemptyrows){ ... }
then it works fine.
Can anyone tell me why this is?
tnx.
(oh btw labMask.hideemptyrows is of type bool)
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
What type is hideemptyrows ? Using a breakpoint at the if(...) statement, what value does it have?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I had the same problem a couple of weeks ago, and finally realized that I was stepping through the code in 'Release' mode. So the values it was giving me weren't correct. You may not be doing the same thing, but just to make sure, check and see if you're in debug mode while stepping through.
[insert witty comment here]
bdiamond
|
|
|
|
|
Nice suggestion, but you might want to reply to V. so that he is sure to see it.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Never ever compare for equality with true or TRUE . Always do if (labMask.hideemptyrows) . The reason is that, even with a bool variable, there's nothing stopping the variable from getting values other than 0 or 1. When you compare against true , the test will fail if the bool got some value other than 1.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
I just performed the Heimlich Maneuver on SQL #1.
-- Chris Maunder
|
|
|
|
|
Tnx for your reply.
However I do not agree on this one:
1. a BOOL is an "Integer", a bool a "Boolean" (true or false)
so it can't get another value then true or false. Can it?
2. even after casting (bool)labMask.hideemptyrows the if statement returned false (we saw it in the quickwatch window)
3. although I see your point (especially for BOOLs) I find it more readable to compare against true or false (you see instandly what type your variable is)
So idd if the bool class can have other values then true or false I see your point, but why use the bool and not the BOOL? (surely not memory?)
Personally I think the compiler is broken or something
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
V. wrote:
Personally I think the compiler is broken or something
..and that might just be it! I have had many a few hairy moments where the code being executed doesn't match the fragment being shown on the screen. A good cleanup and complete rebuild of the project should solve this.
If that doesn't work, then a good thumping of the PC should teach it to behave!
I Dream of Absolute Zero
|
|
|
|
|
I'm using Chris Maunder's MFC Grid control in a personal project and I'd like to override a virtual function:
virtual void OnFixedColumnClick(CCellID& cell);
I've made a derived class and everything seems to be working right except that I want to override that function so that I can set a different compare function if the column clicked is the one that has dates in it. None of the virtual functions show up in classwizard, and I'm trying to figure out if I do it manually, how to put this in the message map so that I can get this message. I know this is something that I should know how to do, but some days I'm dumber than others. Any help is appreciated. Thanks in advance!!!
[insert witty comment here]
bdiamond
|
|
|
|
|
you simply redefine the method in your new class.
something like :
clas YourClass
{
...
virtual void OnFixedColumnClick(CCellID& cell);
}
...
void YourClass::OnFixedColumnClick(CCellID& cell)
{
ChrisMaunderGridBaseClass::OnFixedColumnClick(cell);
}
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I got it, what you said is exactly what I was doing, which was right. Except I should have been looking for OnFixedRowClick(), not OnFixedColumnClick(). Thanks
[insert witty comment here]
bdiamond
|
|
|
|
|
Hi
My computer is on LAN. I know my IP address. How can I get the corresponding MAC address, to which the particular IP is bound to ? ( if I have more than one ethernet card)
I have tried Netbios, GetAdaptersInfo etc.
Is there any solution for this, something similar to GetAdaptersInfo which will work in windows NT also. ?
Thanks in advance
Shiraz
The Best Relligion is Science.
Once you understand it, you will know God.
|
|
|
|
|
zainu wrote:
I have tried Netbios, GetAdaptersInfo etc.
These are the normal solutions. Are you saying they do not work for you?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Have you tried going through the ARP table using GetIpNetTable() ?
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Hi,
Thankyou all..
I tried these methods..all the three, netbios, GetIpNetTable(), GetAdapterInfo().
These are the problems I am facing:-
Netbios: I am not able to find MAC if there are more than one LAN card and multiple IP set for each card.
GetIpNetTable: Doesnt give me the particular MAC address of a IP Address.
GetAdapterInfo: Not supported in Windows NT
Is there anything Like GetAdapterInfo that will work in all windows platform ?
Thanks in advance
Shiraz
The Best Relligion is Science.
Once you understand it, you will know God.
|
|
|
|