Click here to Skip to main content
15,912,329 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRE: Hold redraw until view resizing is finished Pin
Anonymous4-Mar-00 16:23
suss Anonymous4-Mar-00 16:23 
GeneralRE: Hold redraw until view resizing is finished Pin
Liahim5-Mar-00 9:02
sussLiahim5-Mar-00 9:02 
GeneralRE: RE: Hold redraw until view resizing is finished Pin
Anonymous7-Mar-00 14:42
suss Anonymous7-Mar-00 14:42 
GeneralVirtual Overloaded Function Question... Pin
John Mancini2-Mar-00 11:43
John Mancini2-Mar-00 11:43 
GeneralRE: Virtual Overloaded Function Question... Pin
Mike Dunn2-Mar-00 15:16
Mike Dunn2-Mar-00 15:16 
GeneralRE: Virtual Overloaded Function Question... Pin
Prabhat Tripathi13-Mar-00 22:02
Prabhat Tripathi13-Mar-00 22:02 
GeneralATL-release problem Pin
kai2-Mar-00 5:56
kai2-Mar-00 5:56 
GeneralOnDrawItem / OnPaint problem... Pin
Catherine1-Mar-00 13:18
Catherine1-Mar-00 13:18 
Hi,

I've been able to create an activeX control and to change its background color and font using OnDrawItem.

Now my problem is that everytime I put this activeX in a composite control and then use this composite control as an ActiveX over the Internet, I can see everything being drawn and disappear...

First I just implemented the OnPaint function in the composite control with just 'return 0' in it
-> my activeX control shows up, the onSize function works great, but of course, if I switch from a window to another one, the activeX control disappears and is not refreshed...

Here is some code:
From the activeX:
BEGIN_MSG_MAP(CSRAxControl)
MESSAGE_HANDLER(WM_CREATE, OnCreate)
MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)
MESSAGE_HANDLER(WM_DRAWITEM, OnDrawItem)
CHAIN_MSG_MAP(CComControl<csraxcontrol>)
ALT_MSG_MAP(1)
END_MSG_MAP()

From the composite control:
LRESULT OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) {
_axViewControl.SetFocus();
return 0;
}

LRESULT CIdefixView::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled){
HRESULT hresult=0;
CLSID clsid;

CWindow hwndParent = NULL;
hwndParent = GetParent();

CComPtr<idispatch> myIDispatchView;
CComBSTR progID = OLESTR("Ctrls.SRAxControl");
hresult = CLSIDFromProgID(progID, &clsid) ;
if (SUCCEEDED(hresult)){
hresult = CoCreateInstance(clsid, 0, CLSCTX_ALL, IID_IDispatch, (void**)&myIDispatchView);
if(SUCCEEDED(hresult)) {
_axViewControl.Attach(GetDlgItem(IDC_VIEW));
_axViewControl.ModifyStyle( NULL, WS_CLIPSIBLINGS, SWP_SHOWWINDOW );
hresult=_axViewControl.AttachControl(myIDispatchView, NULL);
_pViewControl = myIDispatchView;

RECT rc;
hwndParent.GetClientRect(&rc);
_axViewControl.MoveWindow( 0, 0, rc.right - rc.left, 26, TRUE );
}
}
return S_OK;
}

Please Help !!

Thanks,

Catherine.
GeneralTrying to extend autocomplete combobox Pin
Anonymous1-Mar-00 5:30
suss Anonymous1-Mar-00 5:30 
GeneralRE: Trying to extend autocomplete combobox Pin
Anonymous9-Mar-00 20:43
suss Anonymous9-Mar-00 20:43 
GeneralCrystal Report Pin
Valentin Rozescu1-Mar-00 2:56
Valentin Rozescu1-Mar-00 2:56 
GeneralRE: Crystal Report Pin
Anonymous1-Mar-00 5:22
suss Anonymous1-Mar-00 5:22 
GeneralRE: Crystal Report Pin
Anonymous6-Mar-00 4:08
suss Anonymous6-Mar-00 4:08 
GeneralRE: Crystal Report Pin
thuannc8-Mar-00 17:52
thuannc8-Mar-00 17:52 
GeneralRE: RE: Crystal Report Pin
Member 44948-Mar-00 22:20
Member 44948-Mar-00 22:20 
GeneralPasting into another application. Pin
Pär28-Feb-00 23:53
Pär28-Feb-00 23:53 
GeneralMFC Static Build for Ax controls Pin
Scott B. Lewis26-Feb-00 19:56
sussScott B. Lewis26-Feb-00 19:56 
GeneralThe Shell Recycle Bin Pin
Bob Dinah25-Feb-00 16:30
sussBob Dinah25-Feb-00 16:30 
GeneralRE: The Shell Recycle Bin Pin
ljp2-Mar-00 4:24
ljp2-Mar-00 4:24 
GeneralRE: RE: The Shell Recycle Bin Pin
Bob Dinah2-Mar-00 11:50
sussBob Dinah2-Mar-00 11:50 
GeneralRE: RE: RE: The Shell Recycle Bin Pin
Bob Dinah2-Mar-00 11:53
sussBob Dinah2-Mar-00 11:53 
QuestionHow to make a frame for an irregular shape ? Pin
Buck25-Feb-00 11:28
Buck25-Feb-00 11:28 
Questionhow to serialise MFCGridCtrl Pin
Anonymous25-Feb-00 11:01
suss Anonymous25-Feb-00 11:01 
GeneralComposite Control Pin
Anonymous25-Feb-00 4:53
suss Anonymous25-Feb-00 4:53 
GeneralSchedule and Gantt Diagramm Pin
A.Ortmanns25-Feb-00 2:07
sussA.Ortmanns25-Feb-00 2:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.