|
So ON_MESSAGE is for Windows system messages whereas ON_COMMAND is for anyhting thats WM_USER + .....
thankx
|
|
|
|
|
ForNow wrote: So ON_MESSAGE is for Windows system messages
Yes
ForNow wrote: ON_COMMAND is for anyhting thats WM_USER + .....
No - if you look at the definition of the ON_COMMAND macro, you'll see this:
#define ON_COMMAND(id, memberFxn) \
{ WM_COMMAND, CN_COMMAND, (WORD)id, (WORD)id, AfxSigCmd_v, \
static_cast<AFX_PMSG> (memberFxn) },
What this means is that ON_COMMAND handles the WM_COMMAND[^] message, which (to quote that page) is sent when the user selects a command item from a menu, when a control sends a notification message to its parent window, or when an accelerator keystroke is translated.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
|
Hi,
Please give me a sample to use RegQueryValueEx()..and i want to store the value in a CString..Please help me out.. as im a beginner..
|
|
|
|
|
You may find sample code in the RegQueryValueEx documentation page [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Yes, there's a useful sample on that page, if you're interested in getting a data object with an unknown size. But if you want to read a C string and convert that string to a CString, you are probably better off with this:
<br />
BOOL ReadStringFromMysterioiusOSSource(char* destination, int maxChar);<br />
<br />
<br />
CString myValue;<br />
char buf[438];<br />
ReadStringFromMysterioiusOSSource(buf, 438);<br />
myValue = buf;<br />
(If you really need to use a OS function, just use the CString's assignment operator)
|
|
|
|
|
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Dear all
Is there any API to get MAC address of the LAN card used (more the one network we need to find MAC address for give IP address) at client side(system).system may contain more than one network card and also more than one network may conncet
plz help me
thanks in advance
Regards
sunny
|
|
|
|
|
Have you looked into GetAdaptersInfo() ?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
hey
GetAdaptersAddresses() function is better than GetAdaptersInfo()
Regards
Sunny
|
|
|
|
|
hi folks, yesterday i was not clear on my doubt. Sorry about that.
Here is my doubt:
i have a propertysheet which has three propertypages.Out of the three, one propertypage will contain the other two propertypages inside it.
click the link for Sample Application:
http://www.codeguru.com/cpp/controls/propertysheet/article.php/c595/[^]
If i insert a radio button in the third propertypage (which has two propertypages inside it), the application got struck. how can i resolve it?
thanks,
rakesh
|
|
|
|
|
Rakesh5 wrote: ...the application got struck.
Does this mean something?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
DavidCrow wrote: Does this mean something?
Yes. He was hoping to find someone that gives a struck.
|
|
|
|
|
With so little information, nobody will be able to help you.
Have you ever used a debugger? Visual Studio has one built in!
|
|
|
|
|
Are you a real person, or is this some new fangled kind of Turing test?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Wow, that post in the Lounge worked!
|
|
|
|
|
I guess I'm kinda like Batman - when the Bat Signal is displayed, I'll see it and come to the rescue.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
When your program "gets stuck", use the PAUSE icon on visual studio to see where the program execution is in your code. YOu can then use the "Step into", "Step Over" and "Step out" methods to see what your proggie is doing.
Also, check the following: your first radio button in your radio button group should have the WS_GROUP style on it, also, the next control in the tab order that comes right after the last radio button in the group should also have the WS_GROUP style. If your property pages are created from dialog resources made in visual studio's dialog editor, make sure that they have the "Control Parent" and "Control" styles set.
Do any of these help?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
modified on Thursday, March 19, 2009 10:59 AM
|
|
|
|
|
Microsoft has a Knowledge base article about it Q149501 "PRB: Child CPropertySheet Hangs If Focus Is Switched" [^]
Steve
_________________
I C(++) therefore I am
|
|
|
|
|
UI design is very tricky and can get quite complicated.
And this is not going to sell.
You need to change it.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hi All
I'm getting some error in below code. can any body tell me whats is the proboem in my code?
Test.h
---------------
class Test
{
private:
int i , j;
public:
//f pointer
int f1(int i, int j);
int f2(int i, int j);
int (*fptr)(int,int);
};
Test.cpp
-----------------
int Test::f1(int i, int j)
{
int res = i+j;
cout<<"IM IN f1 : Reult "<<res<<endl;
return res;
}
int Test::f2(int i, int j)
{
int res = i-j;
cout<<"IM IN f2 : Reult "<<res<<endl;
return res;
}
main.cpp
------------
int main()
{
Test obj;
int (*fptr)(int,int) ;
fptr = &(Test::f1);
fptr(2,1);
return 0;
}
Actually im getting error in fptr = &(Test::f1); line
i.e Error 1 error C2440: '=' : cannot convert from 'int (__thiscall Test::* )(int,int)' to 'int (__cdecl *)(int,int)' c:\documents and settings\e_skanun\my documents\visual studio 2005\projects\test\test\main.cpp 35
And im nt able to correct.
plz do help.
Regards
Phillip
Regards
Phillip
|
|
|
|
|
Global functions and class member functions do not have the same signature: for a function member of a class, the this pointer is passed implicitely to identify the instance of the class on which the function is called.
What you are trying to do there is store a pointer to a member function in a pointer to a global function. So, that's why the compiler complains that you cannot do that.
EDIT: oops, I misread your code sorry. David's answer is correct.
modified on Thursday, March 19, 2009 9:07 AM
|
|
|
|
|
Cool_Phillip wrote: int (*fptr)(int,int) ;
Change this to:
int (Test::*fptr)(int, int); Cool_Phillip wrote: fptr(2,1);
Change this to:
(obj.*fptr)(2,1);
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Thanx its working now.
Regards
Phillip
|
|
|
|
|
That's because &(Test::f1) is not a int (__cdecl *)(int,int) and cannot be converted to one. All non-static methods have an extra, implicit parameter, the object pointer. And, just to make things more complex, the object pointer isn't passed like other parameters, so trying to use a function pointer of int (__cdecl*)(Test*, int, int) won't work either.
Instead, you need to make fptr a method pointer, and call it with the special 'method pointer' syntax - replace your main with this one:
int main()
{
Test obj;
int (Test::*fptr)(int,int) ;
fptr = &(Test::f1);
(obj.*fptr)(2,1);
return 0;
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|