Hey, i've written a ActiveX-control using MFC. The control creates a CWnd which hosts a CListCtrl. All works fine, in Ms Testcontainer but not e.g. in Ms Access/Excel. When I use a form in Access and place my control on the form, no key events reach my control (even if the control has focus). All mouse-events works well. How can I send the keystrockes to my control (eg. move cursor on my listctrl)? Thank you for helping me...
AnTri
Posts
-
ActiveX loose focus -
Problem with global var in MFCThanks your for your answer. But when I delete the static keyword, I get a lot of compiler errors like (...already defined in ... object).
-
Problem with global var in MFCHallo, I tried to use some global vars to define some application wide settings. So I defined a group of global vars in my MyApp.cpp like this: MyApp.h:
#pragma once
....
static bool bSetOutputToDebugWindow;
....All my (*.cpp) files include the MyApp.h file. In all files "bSetOutputToDebugWindow" was accessable and the applicaction compiles with no error. But when I set "bSetOutputToDebugWindow" (e.g. in my Apps InitInstance-Method) to true, and tried to read the value later in debugger or function the value is false! Why???? Please help to find my error`...
-
Problem with MFC ActiveX and ExcelHey, i've written a simple ActiveX-Control which shows a Dialog (CDialog) with some CEdit Controls. All works fine in TestContainer, but when I us the control for e.g. in Excel (2003, 2007) i can't write text to my edit controls. All text is shows on my worksheet. Help me please...
-
Print Preview and "x"-ButtonHey, how can I prevent closing my whole SDI-App when the "X"-button in PrintPreview is pressed. All works fine, when i push the close-botton (preview closes, and CView is shown) but not by presseing the "X"?
-
2 Rows in CListCtrl HeaderHey, is there any way to wrap text in a CListCtrl Header? I know I can subclass and do some CustomDraw, but with this method I loose the XP style. Thanks for your help!
-
Change View in SDI-Applicationthank you!
-
Using extendes MFC-Dll for my controlWhen I link my (control) dll I'll get a lot of compiler-warnings: resource already defined, duplicated resource ... e.g. in dll is a dialog with edit-control ID: IDC_EDIT1 = 1001 when I link the dll to my application e.g. Dialog with the same ID for edit-control I can't open the dialog! It seems that there is only one resource-list for the application an my dll!
-
Change View in SDI-ApplicationHey, how can I change (dynamic) the view from e.g. CView to CFormView? I know I have to do it in mainfrm but how?
-
Using extendes MFC-Dll for my controlHey, i've made some good controls and dialogs for me. From that time on, i'd copied all my files and resources to my new projects. Now I decided to make an DLL. So I started the project assistant and created a extended MFC-Dll and added my custem files and resources. So i build my DLL... OK, but now (after linking to my new projects) I have probleme with my resources. Is there any to way to split resources or better use separate resources (one resource for application, one for dll). Thank you for helping me....
-
Problem with mirrored bitmapThanks, this works fine for me (only the position is shifted), but why is the bitmap mirrored?
-
Problem with mirrored bitmapHey, I use my printer dc to paint some text and graphic to my printer. I use MM_LOMETRIC as Mapmode because of the easy way of positioning. Now I have a big problem to print bitmaps. All bitmaps are mirrowed (around X-axis). I use the following code to paint the bitmap:
.... CBitmap *pBitmap = new CBitmap(); HBITMAP hBitmap; hBitmap = (HBITMAP)::LoadImage(AfxGetInstanceHandle(),szPathToBitmap,IMAGE_BITMAP,0,0,LR_LOADFROMFILE|LR_CREATEDIBSECTION); pBitmap->Attach(hBitmap); ... CRect reRect; reRect.left = 10; reRect.right = 300; reRect.top = -100; reRect.bottom = -1000; CDC dcMem; BITMAP bm; pBitmap->GetBitmap(&bm); dcMem.CreateCompatibleDC(pDC); dcMem.SelectObject(pBitmap); pDC->BitBlt(reRect.left, reRect.top, bm.bmWidth, bm.bmHeight, &dcMem,0,0, SRCCOPY);
What's wrong, and how could I fix it? -
ActiveX: Transfer between Control and PropertyPageHey, please help me. I've written a ActiveX-Control. How can I transfer data between the control and propertypage. I know the DDP Makro, but with this makro I can only transfer values from controls. I need to transfer "calculated" value. Is there a function to store/transfer data from propertypage to the membervars in the control?
-
Registry settings for all users (with user privileges) [modified]Hey, I want to write some status variable to the registry HKLM\Software. This works fine with admin privileges but not with user privileges (and VISTA UAC). Where can I store values for all users in registry or should I use files (e.g. counter for a trial period)? Please help me... -- modified at 12:45 Saturday 21st July, 2007
-
How to prevent window to get focusI tried your suggestion, but with partial success. When my dialog has the focus before I select an item on the listbox it works fine, but if the focus is on my formview or mainfrm and I select on item, the focus wents to my formview for a second and then switched back to my dialog...
-
How to prevent window to get focusHey, please help me. I've got a SDI-App with a non modal dialog. The dialogs only task is to choose parameter (e.g. in a listbox) for my application. After selecting an item in the listbox (on dialog) the focus should move to my a control (choosen by listbox) in my cformview(e.g. CEdit - Control). I handle the OnLvnItemChangedList message in my dialog. In this function I post a message (WM_SETFOCUS) to my (formview) window. But the focus returns immediately back to my dialog. When I set the focus to my mainwnd (by mouseclick) the focus is in the right control. But how can I set the focus to my mainfrm automatically? Thanx for your help
-
Cut Digits from 0.1000000000001I need this for displaying the result value (e.g. in a diagram)
-
Cut Digits from 0.1000000000001Hey, how can I cut needless decimal digits from a calculation result e.g. calculation with pow(10.0,-1.0) 10^-1 = 0.100000000001 but I need to have 0.1
-
Problem with SetFocusHey, I've an application with 2 dialogs. The first dialog holds a couple of controls, the second dialog a listbox with handles to the controls (on the first dialog). Now I want to set the focus to the control on the first dialog by selecting an item in the listbox. My problem is that the focus jumps back to my listbox after I set it to the control. Code after selecting an item in listbox (all pointers are valid!)
CWnd* pWnd = GetHandleToDialogControl(iIndex); //Get CWnd* information from selected item pWnd->SetFocus() //Set focus to my control on first dialog
I can see that the control get the focus, but it jumps back to listbox immediately... -
Invalid CWnd* pointerDo you mean a pointer to CEdit - Object? (the CEdit Object itself is located in my CFormView class). I thought CEdit is dervied from CWnd and thats why I originally stored the CWnd* pointer... What do you think about my previous question?
Ok, but when nothing happens with my CFormView (Controls) why is my (stored) pointer invalid. I thought the CWnd* is valid as long as the window exits.