|
Hi,
I have an MFC app with ActiveX controls as child views.
The frame's accelerator handling seems to catch hotkeys and translate them into menu commands (e.g. Ctrl-C --> ID_EDIT_COPY), even though the ActiveX has the focus.
One of the controls needs a fairly extensive keyboard handling, that might in certain cases even interfere with the "application" hotkeys.
Now I see three solutions, and am looking for recommendations which route to take:
a) adding all accelerators to the MFC application, and handling the WM_COMMAND's. Doesn't sound like a good design though (as the ActiveX'es should be allowed to define their own hotkeys)
b) "somehow" separate the accelerator tables - the nicest would be one for the applicaiton, and one provided by the ActiveX - is this possible?
c) Usign a keyboard hook as long as one of activeX has focus.
d) Other ideas?
TIA
Peter
So many people long for eternity that don't know what to do on a rainy sunday afternoon. [sighist] | [Agile Programming] [doxygen] If you look for evil in me you will find it whether it's there or not.
|
|
|
|
|
hi,
i want to send a message from a thread to my Dialog, but how do i get the HWND value from my dialog? I created the dialog by doing DoModal()
thanks in advance,
[]D [] []D []
|
|
|
|
|
does GetSafeHwnd() not work?
Bryce
|
|
|
|
|
nope, it gives back a NULL value... so i need to get it in another way...
i don't even know if the dialog has its own HWND, maybe i need to get it in a different way.
[]D [] []D []
|
|
|
|
|
lets see...fromthe help files
CWnd::GetSafeHwnd
HWND GetSafeHwnd( ) const;
Return Value
Returns the window handle for a window. Returns NULL if the CWnd is not attached to a window or if it is used with a NULL CWnd pointer.
are you getting the hwnd before you start the thread?
Bryce
|
|
|
|
|
Sorry, i got the solution(STUPID STUPID!!!), i wanted to get the HWND value BEFORE i did a DoModal() on my dialog,
no wonder it didn't work! Now i set the HWND value of the thread at the OnInitDialog with GetSafeHwnd() and it works fine! ;)
thanks for your help!
[]D [] []D []
|
|
|
|
|
hi, how does one hide the title bar in an SDI app?
cheers
Bryce
|
|
|
|
|
ModifyStyle(WS_CAPTION, 0);
SetWindowPos(NULL, 0, 0, 0, 0, SWP_DRAWFRAME |
SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER);
rechi
|
|
|
|
|
Hi all,
I need a little help here . I have a simple program using Common control stuffs that require commctlr.h and comctl32.lib.
I created the project using Visual Studio .Net default template for Win32 Console application that includes stdafx.h precompiled header. Somehow this precompiled header makes the compiler not recognize the INITCOMMONCONTROLSEX structure defined in commctlr.h even though I've set up the project appropriately (correct path etc.)
I noticed in the commctlr.h the INITCOMMONCONTROLSEX is surrounded by conditional (_WIN32_IE >= 0x0300). I thought that my project re-defined _WIN32_IE to be less that 0x0300 somewhere, but after I did intensive search, it's nowhere to be found.
Anyway, does anybody know what's happening here? Could you help me please?
NOTE: If I start the project from the scratch (i.e. without using the precompiled header), it compiles fine and smooth.
Thanks alot,
d-man
|
|
|
|
|
|
|
Hi,
I need to implement uint40, where the compiler I am using (in an embedded environment) only supports up to uint32. It would be interesting to have a look at C++ implementations (or even C) for int40 or int64. The only one I found was the Putty C implementation of int64.
Regards,
Victor
phpWebNotes is a page annotation system modelled after php.net.
http://webnotes.sourceforge.net/demo.php[^]
|
|
|
|
|
__int64 is a built-in type in VC++.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Am not sure if this might help, but it need a good Assembly programmer(I barely know it myself).
This is how VC++ implement the __int64 using Assembly, remember that all processors register are 32 (except 64 bit CPU of course) and all operations are done on them at the processor level.
Anyway these are C++ statements with corresponding Assembly, it you may be able to implement using Assembly.
__int64 l1, l2, l3;
l1 = 256;
00417053 mov dword ptr [l1],100h
0041705A mov dword ptr [ebp-14h],0
l2 = 128;
00417061 mov dword ptr [l2],80h
00417068 mov dword ptr [ebp-24h],0
l3 = l1 + l2;
0041706F mov eax,dword ptr [l1]
00417072 add eax,dword ptr [l2]
00417075 mov ecx,dword ptr [ebp-14h]
00417078 adc ecx,dword ptr [ebp-24h]
0041707B mov dword ptr [l3],eax
0041707E mov dword ptr [ebp-34h],ecx
l3 = l1 - l2;
00417081 mov eax,dword ptr [l1]
00417084 sub eax,dword ptr [l2]
00417087 mov ecx,dword ptr [ebp-14h]
0041708A sbb ecx,dword ptr [ebp-24h]
0041708D mov dword ptr [l3],eax
00417090 mov dword ptr [ebp-34h],ecx
l3 = l1 * l2;
00417093 mov eax,dword ptr [ebp-24h]
00417096 push eax
00417097 mov ecx,dword ptr [l2]
0041709A push ecx
0041709B mov edx,dword ptr [ebp-14h]
0041709E push edx
0041709F mov eax,dword ptr [l1]
004170A2 push eax
004170A3 call @ILT+1330(__allmul) (411537h)
004170A8 mov dword ptr [l3],eax
004170AB mov dword ptr [ebp-34h],edx
l3 = l1 / l2;
004170AE mov eax,dword ptr [ebp-24h]
004170B1 push eax
004170B2 mov ecx,dword ptr [l2]
004170B5 push ecx
004170B6 mov edx,dword ptr [ebp-14h]
004170B9 push edx
004170BA mov eax,dword ptr [l1]
004170BD push eax
004170BE call @ILT+5340(__aulldiv) (4124E1h)
004170C3 mov dword ptr [l3],eax
004170C6 mov dword ptr [ebp-34h],edx
l3 = l1 % l2;
004170C9 mov eax,dword ptr [ebp-24h]
004170CC push eax
004170CD mov ecx,dword ptr [l2]
004170D0 push ecx
004170D1 mov edx,dword ptr [ebp-14h]
004170D4 push edx
004170D5 mov eax,dword ptr [l1]
004170D8 push eax
004170D9 call @ILT+5345(__aullrem) (4124E6h)
004170DE mov dword ptr [l3],eax
004170E1 mov dword ptr [ebp-34h],edx
there are some function for multiplication and division, but I could not get their code.
|
|
|
|
|
Hi,
I'm overriding the WM_NCLBUTTONDOWN event for my dialog. I found out that I need to send the WM_SYSCOMMAND message so the buttons (min,max,close) still work. Everything is ok but when I want to resize, the cursor is moved at the center of the dialog so it's nearly impossible to resize the window.
What I am doing wrong???
Thanks!
LRESULT CBlankDlg::OnNcLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
if( GetAsyncKeyState( VK_LCONTROL ) || GetAsyncKeyState( VK_LCONTROL ) )
{
INT i=0;
}
LONG msg;
switch( wParam )
{
case 2:
msg = SC_MOVE;
break;
case 20:
msg = SC_CLOSE;
break;
case 9:
if( m_isMaximized )
{
m_isMaximized = FALSE;
msg = SC_RESTORE;
}
else
{
m_isMaximized = TRUE;
msg = SC_MAXIMIZE;
}
break;
case 8:
m_isMaximized = FALSE;
msg = SC_MINIMIZE;
break;
case 17:
msg = SC_SIZE;
break;
}
SendMessage( WM_SYSCOMMAND, msg, lparam );
return 0;
}
---------------
Tired of Spam? Introducing InboxShield® for Microsoft® Outlook®
http://www.edovia.com
|
|
|
|
|
How do you remove the default icon that appears in the upper left hand corner of a child frame window on the title bar in an MDI style application?
LIFE IS COOl
|
|
|
|
|
It's an icon in your app. You can change it.
Also, when you create the window you can adjust the create struct to not include the app icon. CS_something.
|
|
|
|
|
Remove the WS_SYSMENU style from your window. Keep in mind that this will also disable Alt-Space as well.
--Mike--
The Internet is a place where absolutely nothing happens.
-- Strong Bad
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I have a static library I have compiled with VS.Net -- the library compiles correctly. However, when I try to link against it I get link errors for multiply-defined symbols such as:
CWPDataManager error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >::operator+=(char)" (??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@D@Z) already defined in MyDateD.lib(MyDate.obj)
My library makes use of std::string (as you can see above) and I've put the approriate #ifndef include guards in the library .h file. So, why do I get these link errors when I build my app and link against my libray? Anyone know where my problem is?
Thanks,
--Dean
|
|
|
|
|
Are there functions in the DLL that returns a pointer or reference to a string object? If so, one solution is to do return by value.
Kuphryn
|
|
|
|
|
Well, it's not a DLL - it's a static library. I have one function that takes a string by reference (consequently this is where the link errors arise from -- it's the only function that uses string). The function return is void and the string that is passed by reference is modified within the function.
The function (inside the library) looks like this:
void CMyClass::format(const char* fmt, string& dest)
{
...
(modify dest)
...
}
--Dean
|
|
|
|
|
Okay.
See if you can pass in a const string and return the modified string instead of void.
Kuphryn
|
|
|
|
|
That's usually caused by the build settings for the LIB using one form of CRT linking (static or DLL) and the executable using the other.
--Mike--
The Internet is a place where absolutely nothing happens.
-- Strong Bad
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
in my OnPaint, i am drawing to a memory DC, then blitting to the screen. if i do memDC.DrawFocusRect(...), then Blt, the rectangle turns out light blue (ie. wrong). but if i Blt then draw the focus rect onto the screen DC, it comes out black-and-white dashed (as it should).
memDC.DrawFocusRect(CRect(10,10,100,100));
dc.BitBlt(frameRect.left, frameRect.top, frameRect.Width(), frameRect.Height(), &memDC, 0,0, SRCCOPY);
memDC.SelectObject(ob);
dc.DrawFocusRect(CRect(10,10,100,100));
-c
Be very, very careful what you put into that head, because you will never, ever get it out. --Thomas Cardinal Wolsey
|
|
|
|
|
play around with SetTextColor and SetBkColor for that device, i'm not exactly sure which parameters you'll need but changing those affects the focus rect
- Roman -
|
|
|
|
|