|
|
I define some class that inherit from the class CWnd - and i want to define right mouse click event on the inherit class.
How can i do it ?
Thanks.
|
|
|
|
|
You can handle the right mouse button click event by implementing the
WM_RBUTTONDOWN (or WM_RBUTTONUP ) message handler in the inherited class.
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]
|
|
|
|
|
Thanks,
But i have some problem ...
This inherit class locate in some CView class ( the CView is create the CWnd ) and i can't catch the event because the event catch by the CView.
What to do ?
|
|
|
|
|
Yanshof wrote: This inherit class locate in some CView class ( the CView is create the CWnd ) and i can't catch the event because the event catch by the CView
Can you please explain it better?
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]
|
|
|
|
|
The inherit class is open as child class of some CFormView ( doc/view style).
And when i try to get the event in the chinld class i see that the event is stoped in the CFormView class and not in the child class - this make the right click button to not happand event if i add the WM event.
|
|
|
|
|
How are you adding the message handler (code please)?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: (code please)
Today, posters aren't too much expansive.
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 still haven't received my Code Project Mind Reading Unit (CPMRU)
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: I still haven't received my Code Project Mind Reading Unit (CPMRU)
I know, because I've.
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]
|
|
|
|
|
!!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hello,
Is there an easy way to get the name of currently logged windows user??
Thank you
|
|
|
|
|
You mean something like GetUserName() ?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
<br />
char c = 0xA0;<br />
<br />
if(c == -96)<br />
{<br />
cout << "why does c==-96 but not equals 160?" << endl;<br />
}<br />
|
|
|
|
|
A char is a signed byte. Which means it goes from -127 to +127, with the first bit being the sign bit.
|
|
|
|
|
When a char is a signed 8 bit integer then (char)160 (10100000) is equal to (char)-96 (10100000)
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
so, to finalize the others' answers, if you want to see 160, either declare c as being an unsigned char or cast it into an unsigned char when testing it.
|
|
|
|
|
hanlei0000000009 wrote: "why does c==-96 but not equals 160?"
because -96 and 160 are quite different numbers.
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]
|
|
|
|
|
OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus
Best wishes to Rexx[^]
|
|
|
|
|
ROTFLMAO
Maxwell Chen
|
|
|
|
|
Hi,
i'm trying to pass a LPCSTR from a C++ Dll to a VB Code.
I'm getting no Error Message but the String will not appear in the Msg Box of the VB code ! I'm really drivin Crazy with this.
Here are some lines of the code:
VB
<br />
Option Explicit<br />
<br />
Private Declare Function fnWin32DLL02 Lib "Win32DLL02.dll" () As Integer<br />
<br />
Private Sub Form_Load()<br />
<br />
Dim x As String<br />
<br />
x = Space$(3)<br />
x = fnWin32DLL02()<br />
MsgBox "X ist: " & x<br />
<br />
End Sub<br />
Cpp:
<br />
WIN32DLL02_API LPCSTR fnWin32DLL02(void)<br />
{<br />
LPCSTR s = "abc";<br />
<br />
return s;<br />
}<br />
Many Thx for your answers,
Best Regards
Croc
|
|
|
|
|
Strings in VB are a little more involved underneath than strings in C++. Try changing the Dll end to return a BSTR allocated with SysAllocString or a related API. If BSTRs (BeeStings ) just seem way to awkward ATL provides the very useful CComBSTR class which deals with many of the painful bits for you. BSTRs have the length written into 2 bytes on the front of the string followed by the string which may or may not be NULL or even double NULL terminated.
This is what VB does for you when you use it's friendly string type.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Matthew Faithfull wrote: BeeStings
Beasters!
|
|
|
|
|
Matthew Faithfull wrote: BSTRs (BeeStings
Bastard ...
Maxwell Chen
|
|
|
|
|
AFAIK you also have to use __stdcall calling convention.
Does your WIN32DLL02_API already contain it?
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]
|
|
|
|