|
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
|
|
|
|
|
While going through C++ object model book by Stanley Lippman, I came across a statement "inline functions have static linkage"
Now if inline function code is expanded into the source where it is used, then this statement is perfectly correct.
But if the compiler is unable to replace this function call with appropriate code, then it will behave like ordinary function call.
So I tried declaring and defining this function in a header file inside class.
// a.h
class ABC
{
public:
void MyInlinefunction()
{
// some code which forces this function not to be inline
}
};
When I analyzed assembly code of my 2 source files where this header is included.
b.cpp,c.cpp.
I found two instances of the same function(MyInlinefunction) in two source files. Is this behavior is correct?
|
|
|
|
|
vikrams wrote: Now if inline function code is expanded into the source where it is used, then this statement is perfectly correct.
No. At least IMHO: if they are expanded there is no standard function in the corrensponding code.
vikrams wrote: When I analyzed assembly code of my 2 source files where this header is included.
b.cpp,c.cpp.
I found two instances of the same function(MyInlinefunction) in two source files. Is this behavior is correct?
Yes, this correnspond to static linkage.
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]
|
|
|
|
|
So How linker handle this situation ?
|
|
|
|
|
I think that's not a linker problem, the static behaviour is resolved by the compiler and , in the end, there is only one function in the executable, called by both sources.
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 don't think the compiler can optimize this. because when this files are compiled separately and object files are linked together. Linker has to do the rest work.
|
|
|
|
|
Well, you're right. Each of the two object files contains a definition for MyInlineFunction , hence must be the linker to do the magic and I don't know why...
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 all,
I've create a window as follows,
void CRtf::Initialize(void)
{
HWND m_hwnd_RTFBox = CreateWindowEx(
WS_EX_APPWINDOW,
RICHEDIT_CLASS,
"RichTextWindow",
WS_BORDER|ES_MULTILINE,
0,
0,
100,
100,
::GetConsoleWindow(),
NULL,
0,
NULL);
}
After doing all the process, I've destroyed the window as well.
My question is this. I use the above handler iteratively within a loop. So all the time call the Initialize() in each processing step. Simply create and destroy to the equal number of looping process. I want to avoid it.
According to the MSDN, if the CreateWindowEx() is succeeds, the return value is a handle to the window. If it is failed the return value is NULL. So I've tried something like this.
while(m_hwnd_RTFBox != NULL)
{
}
But it doesn't work. Can you guys give me a clue on this.
I appreciate your help all the time...
Eranga
|
|
|
|
|
How bad me. I can do it within Constructor and Destructor.
I appreciate your help all the time...
Eranga
|
|
|
|
|
Have a good new year whole peoples.[^]
Bitte tun Sie mir nicht antworten, wenn Sie nicht wissen, die Ursache des Problems wirklich oder nur als Antwort. Was ist das? Dies ist das Buch sitzen.
|
|
|
|
|
Little late, but nonetheless, Merry Christmas.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Uh, one your are late. Two, wrong forum!
|
|
|
|