|
When you click on an edit control, the message goes to the
edit control window, not to the dialog window.
You could derive a class from CEdit and use that class to
subclass the edit controls. When your CEdit-derived class gets a
WM_LBUTTONDOWN message, it could notify its parent by posting an
app-specific message.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all
please how i can convert integer number to string text like this
(i entered 7 in keyboard and the output will be seven)
thank's for all
-*-*-*-*-*-*-*-*-*
To Be Or Not To Be
(KARFER)
-*-*-*-*-*-*-*-*-*
|
|
|
|
|
you may use the function sprintf function, for instance
int i;
char buffer[20];
i=7;
sprintf(buffer,"%d", i);
or, if you prefer the CString class
int i;
CString str;
i=7;
str.Format("%d", i);
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.
[my articles]
|
|
|
|
|
O.K
Thank's For all
I'll Be There
|
|
|
|
|
CP holds some articles on number-to-text conversion.
|
|
|
|
|
|
If I understood you well, you are asking how to get the name of the number, not the number itself inside a string.
So you are not asking for:
int iNumberSeven = 7;<br />
CString csAux = "";<br />
csAux.Format("%i",iNumberSeven);
you are asking for something like:
if (iNumberSeven == 7)<br />
{<br />
csAux = "seven";<br />
}
If you meant the second option, the only way I can think of is to try to generate the numbers programmatically. And this would mean to study the way the numbers are formed and of course having some basic strings in a vault in order to be able to use them.
|
|
|
|
|
Thank's For all
Never put off till tomorrow what can be done today
|
|
|
|
|
I am trying, with no luck, to get a simple windows application to have XP/Vista style buttons. I am running Vista and vc2005.
I go into vc2005 and create a new Win32 application and have it auto generate the basic code. I compile it and select the "About Box" and the "OK" button in in the old win2000 style.
I followed the direction in this link:
http://codeproject.com/script/Forums/View.aspx?fid=1647&msg=2355190
and I get errors when it links.
What gives? How do I get an application that has the new button styles? Why is this so hard? What is Microsoft thinking here?
Can anyone help?
Tankko
|
|
|
|
|
Is this a UNICODE application? If not, check your stdafx.h file - for some warped reason known only to Microsoft, the inclusion of the manifest in the generated stdafx.h has an #ifdef UNICODE around it. I've always had to only remove the #ifdef from that file (and no other changes) to get the XP style controls.
Judy
|
|
|
|
|
In OnMouseLeave method which is invoked when the WM_MOUSELEAVE message arrives I would like to determine the mouse button states too. Any idea how to do this? Do we have something like GetAsyncKeyState method which is for keyboard state?
Thanks,
Abyss
|
|
|
|
|
Abyss wrote: In OnMouseLeave method
Wrong forum?
Abyss wrote: WM_MOUSELEAVE ?
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.
[my articles]
|
|
|
|
|
I'm not sure why do you think this is in wrong forum. It is a windows message (WINAPI) and used in C++ code. My application uses MFC to route this message.
Which forum do you recommend for this question?
|
|
|
|
|
Sure? I cannot find any reference to WM_MOUSELEAVE on MSDN and OnMouseLeave is typically a method of .NET Framework controls.
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.
[my articles]
modified on Tuesday, January 01, 2008 11:13:41 AM
|
|
|
|
|
|
OK, you're right, my bad .
Anyway have a look to GetAsyncKeyState documentation itself http://msdn2.microsoft.com/en-us/library/ms646293(VS.85).aspx[^]
the following sentence looks promising:
Remarks
The GetAsyncKeyState function works with mouse buttons. However, it checks on the state of the physical mouse buttons, not on the logical mouse buttons that the physical buttons are mapped to. For example, ...
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.
[my articles]
|
|
|
|
|
Wow I was blind !!!
I did not expect that GetAsyncKeyState can handle mouse buttons as well. I just tried and it really works and solved my problem. Many thanks.
Abyss
|
|
|
|
|
Abyss wrote: I did not expect that GetAsyncKeyState can handle mouse buttons as well.
I didn't expect too. I accidentally saw that remark: sometimes luck helps...
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.
[my articles]
|
|
|
|
|
Hi,
I would like to send bytes in chunks to a Exe. It can be an Acrobat Exe AcroRd32.exe or Windows Media Player Exe wmplayer.exe and I need to Play the chunk as well simultaneously.
Is it possible to do that? Any relevant suggestions or links would be helpful.
Thanks
Satya
Today is a gift, that's why it is called the present.
|
|
|
|
|
narayanagvs wrote: It can be an Acrobat Exe AcroRd32.exe
(Due to curiosity) What are you targetting with acrobat?
narayanagvs wrote: Is it possible to do that?
AFAIK it is not possible in general.
|
|
|
|
|
CString sa[10];
_variant_t var;
...
CString s=(LPCTSTR)(_bstr_t)var;
sa[0]=(LPCTSTR)(_bstr_t)var;
It got a runtime error. Why? And how to do it properly?
modified on Tuesday, January 01, 2008 5:25:00 AM
|
|
|
|
|
Are you initialising var ?
Why do you need to cast var to a _bstr_t type? (i.e. cannot you initialise and use directly a _bstr_t variable?)
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.
[my articles]
|
|
|
|
|
Why all this casting? There is a CString constructor that takes a variant .
|
|
|
|
|
here is the "afxapi"define or the "afxwininit"?
|
|
|
|
|
youbo wrote: here is the "afxapi"define or the "afxwininit"?
AfxWinInit.
the AFXAPI macro is defined as
#define AFXAPI __stdcall
|
|
|
|