|
Never call an operator this way, this is just uggly. You can simply do that:
int nTemp = atoi((LPCSTR)strKey);
But I don't think it will work because if the cast was possible it would have been implicitely done already and you wouldn't have an error.
|
|
|
|
|
i wonder why you needed atol here. If using MC++ , then you can use Convert::ToInt32 function for this purpose, instead of mix of all these things.
System::String* valueNames[] = keySoftware->GetValueNames();
for( int i = 0; i < valueNames->Length; i++)
{
int nValue = Convert::ToInt32(valueNames[i]);
...
}
And use <pre> tags while posting code.
|
|
|
|
|
Hi
All
I want to change dialogBox size and controls positions on DialogBox at run time in VC++ 6.0,so any body have code of this, then plz forward me.
Thanks in Advance
Atool
|
|
|
|
|
use MoveWindow() API.
nave
|
|
|
|
|
|
I guess you can use Marcs' nice EasySize[^] class.
cheers,
mykel
OMM: "Let us be thankful we have commerce. Buy more. Buy more now. Buy. And be happy."
|
|
|
|
|
M. Atul wrote:
Hi
All
I want to change dialogBox size and controls positions on DialogBox at run time in VC++ 6.0,so any body have code of this, then plz forward me.
movewindow and setwindowpos!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
is there getcount method in CObArray class?
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
Yes.
INT_PTR GetCount( ) const;
Returns the number of array elements.
|
|
|
|
|
but when i decalred as objarray.GetCount() it caused error ."error C2039: 'GetCount' : is not a member of 'CObArray'" why this occurs
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
deeps_cute wrote: is there getcount method in CObArray class?
Why do you ask such question in forums. The answer to these questions are readily available in MSDN along with aditional information and better options if any.
A simple look up of class members of CObArray would have fetched the answer for you.
|
|
|
|
|
People are getting lazy ?
|
|
|
|
|
Cedric Moonen wrote: People are getting lazy ?
Laziness can be understood but this I can't. It's so simple but yet...
Even better the name of the function is GetCount . It can't be any simpler than this.
|
|
|
|
|
see i am not lazy. i got the error as getcount is not the member of cobjarray. also in afxcoll.h i cant see such event thats why i asked. can you say why this error occurs
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
deeps_cute wrote: i got the error as getcount is not the member of cobjarray
That's why I said read the docs. The method is GetSize.
|
|
|
|
|
|
MaHeSG wrote: Both GetSize() and GetCount() can be used.
Another option.
|
|
|
|
|
Cedric Moonen wrote: People are getting lazy ?
god save me!!!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Hi
The SendMessage function is used to send a message directly to a window procedure.
Does this means that for messages received by SendMessage, the message loop( GetMessage & DispatchMessage) is not needed to process the message and call the windowproc.
What happens internally on SendMessage?
Welcome all suggestions
Thanks
Anil
|
|
|
|
|
anilFirst wrote: to send a message directly to a window procedure.
no. It will go through the message loop. Why dont you try it for your self?
nave
|
|
|
|
|
Naveen R wrote: no. It will go through the message loop.
No, it wont. Thats why its SendMesssage.
As opposed to PostMessage , which are posted to message loop.
|
|
|
|
|
ok ok..
So it directly call the window proc?
nave
|
|
|
|
|
Naveen R wrote: So it directly call the window proc?
No exactly, but its system(windows) does that.
|
|
|
|
|
anilFirst wrote: Does this means that for messages received by SendMessage, the message loop( GetMessage & DispatchMessage) is not needed to process the message and call the windowproc.
It depends on from what thread the message is "sent".
If the message is sent from the thread that created the window, the message handler will get called directly without taking the detour of the message loop.
If the message is sent from another thread, the receiving thread must be running a message loop since a context switch will be made to the receiving thread while the sending thread is blocked. This is also the reason why a deadlock situation can occur when sending messages from different threads and the receiving thread doesn't process messages.
Have a closer look at MSDN documentation for SendMessage() here[^] below the "Remarks" section.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
In "Programming Windows" by Charles Petzold
"Programs generally don't call window procedures directly. The window procedure is almost always called from Windows itself. A program can indirectly call its own window procedure by calling a function named SendMessage"
So how the SendMessage and PostMessage invoke window proc's? What is internal working of both?
Thanks
Anil
|
|
|
|