|
Thanx for the code, but i had already written the application using MSDN.. Thanx a lot again for the help.
Regards
Sameer
|
|
|
|
|
Do I have to CoInitialize() and Uninitialize()
???
|
|
|
|
|
Thanx a lot Nish.
This solves my problem
|
|
|
|
|
See this article.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hi,
All
I have a Server running which listens on a particular port and
according to the XML sent to it, it sends a JPG file (a binary stream).
Now this XML would be sent by my ASP page. I know i can do
this using ActiveX component.
Please suggest me (no code, just algo types) how to go about
it
Thanx
Sameer
|
|
|
|
|
Hi, How do I determine when the user has finished entering text in an edit box. In other words, how do I know he has pressed the enter key and has completed typing in the text.
Rui
|
|
|
|
|
Write a handler for EN_KILLFOCUS
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Sorry, I should have expressed myself better.
I know about Killfocus, but this requires that the user clicks elsewhere so that the focus on the edit box may be lost. Is there no other way?
Is there a way to call an event when the Enter key is pressed?
I tried using OnKeyDown, but am not sure how it works as I got no action from this event.
Rui
|
|
|
|
|
Hi,
You cannot trap enter from an edit box in the parent, you need to
derive a new class from CEdit and process the WM_CHAR mesgs
|
|
|
|
|
|
Haven't tried it now, but I think you can use PreTranslateMessage to get the WM_CHAR for the edit box, so you don't need to subclass it.
Another thing is, usually you have a default button in your dialog, so pressing enter will activate the default button, and the edit box gets an EN_KILLFOCUS message.
Martin
|
|
|
|
|
You wont get WM_KEYDOWN/WM_KEYUP messages in a dialog based application. I have written an article on how to go about trapping keys in dialog apps.
http://www.codeproject.com/useritems/pretransdialog01.asp
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Override the parents class PreTranslateMessage and put in this code:
if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_ENTER && GetFocus() == &m_Edit)
{
pMsg->wParam = VK_TAB ;
}
This code converts the ENTER key for that edit control only to a tab, so the EN_KILLFOCUS will be called regardless of whether the user uses the mouse, tab or enter key when ficnishing entering text.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
Hi,
i'm looking for a simple example on how you can transport a class over a socket. I read somewhere that it involves serialization but i don't know how to do this exactly.
The only workaround i know of, is to serialize the class to file and then to transport the file. Transporting it directly is what i'm looking for and that involves streaming, right?
Preferably not in MFC but if it is, that's ok too
Thanks
|
|
|
|
|
Look up this topic on MSDN
"Windows Sockets: Using Sockets with Archives"
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
thanks for the link
if i recall correctly, didn't you write some articles that deal with socket programming?
do you have a link to socket programming with CArchive & mfc in other words, plain sockets and streams?
|
|
|
|
|
don't use the CArchive way, it's full of bugs, especially when you scale down to a SMP machine. Look at the MSDN docs. Anyway, if you wanna hurt yourself you can start from
the MFC example ChatSvr/ChatClient
|
|
|
|
|
i'll have a look at them, thanks. you don't happen to have a link to a sample program or explanation of how you can achieve this without MFC, thus in plain win32 c++ code?
thanks
|
|
|
|
|
Hi,
anyone knows how to get the current CPU usage? I searched the MSDN about half an hour but didn't find anything...
-Dominik
|
|
|
|
|
Under NT/2000/XP, it's rather easy. Use the performance counters (basically a pseudo-registry entry).
Under 9x/ME, then it's not quite so simple.
--
Where are we going? And why am I in this handbasket?
|
|
|
|
|
The problem is, my OS is Win98...
Do you know how to get the cpu usage there?
|
|
|
|
|
what is the function of CryptExtOpenCER's declaration?
|
|
|
|
|
Search for it here: http://discuss.microsoft.com/archives/cryptoapi.html
|
|
|
|
|
|
Hi,
In a dialog-based application, i have a list control. How to
put the check box into each item of the list and how to set and get
check state? Is there a dialog based demo program?
Thanks in advance!
chen
|
|
|
|