Click here to Skip to main content
15,917,473 members
Home / Discussions / COM
   

COM

 
GeneralRe: Types, types, types Pin
Aaron Schaefer1-Oct-01 6:14
Aaron Schaefer1-Oct-01 6:14 
GeneralRe: Types, types, types Pin
1-Oct-01 6:57
suss1-Oct-01 6:57 
QuestionCan I use GDI+ lib in my ATL projects Pin
joyle29-Sep-01 19:26
joyle29-Sep-01 19:26 
Questionhow to set IE default homepage and error pages in VC? Pin
Amit Dey29-Sep-01 12:49
Amit Dey29-Sep-01 12:49 
AnswerRe: how to set IE default homepage and error pages in VC? Pin
Amit Dey3-Oct-01 0:31
Amit Dey3-Oct-01 0:31 
GeneralActiveX for Internet Explorer and versioning Pin
29-Sep-01 0:56
suss29-Sep-01 0:56 
QuestionHow to create an ActiveX in a CView (MFC) help or URL or Books wanted Pin
Remi Morin27-Sep-01 4:46
Remi Morin27-Sep-01 4:46 
AnswerRe: How to create an ActiveX in a CView (MFC) help or URL or Books wanted Pin
Remi Morin28-Sep-01 3:42
Remi Morin28-Sep-01 3:42 
Hi to Myself,
it look like anybody is able to answer me so I will (because I've find) so

To create a ActiveX in a CView (just to create it to make it work properly... maybe later)

First add a CWnd member in you'r class
class MyView : public CView
{
//... 
	CWnd m_ActiveXControl;
//...
	//override create
	virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD 
//...
	//override On_Size
	//{{AFX_MSG(CTestViewAsAContainerView)
	afx_msg void OnSize(UINT nType, int cx, int cy);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

then in the create function you must create you'r activeX control. The CWnd is the wrapper for you'r active X so you do that way :

BOOL CTestViewAsAContainerView::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext) 
{
	// TODO: Add your specialized code here and/or call the base class
	BOOL Ok;
	//to be sure it clip children, I didn't try without
	dwStyle |= WS_CLIPCHILDREN;
	//create the windows
	Ok = CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
	//then create the control
	Ok &= m_ControlWrapper.CreateControl("MYACTIVEX.MyActiveXCtrl.1", //this string is the identifiant string that you find in the registry
													 "",
													 WS_VISIBLE,
													 CRect(0,0,100,100), //the size of this rect don't bother, the On_Size function will size it properly
													 this,
													 5000,  //change this for a ressource ID
													 NULL,
													 FALSE,
													 NULL);  
	
	return Ok;
}

then the on_size to size if
void CTestViewAsAContainerView::OnSize(UINT nType, int cx, int cy) 
{
	CRect r;
	CView::OnSize(nType, cx, cy);
	GetClientRect(&r);
	//this function is call before the document is attach to the view, in that case 
	//the size of the view is 0 so we must'not call the moveWindow function because
	//we have create this control with WS_VISIBLE (it's why we have create it with a
	//dummy rect)
	if(!r.IsRectEmpty())
	{
		m_ControlWrapper.MoveWindow(&r); 	
	}
}


so that it's
thanks to myself
hehehehe,

Remi Morin
Rmorin@Operamail.com
Remi.Morin@Lyrtech.com
GeneralThe interface contract Pin
Andrew McGrath27-Sep-01 2:00
Andrew McGrath27-Sep-01 2:00 
GeneralRe: The interface contract Pin
Not Active27-Sep-01 6:35
mentorNot Active27-Sep-01 6:35 
GeneralRe: The interface contract Pin
In-At23-Oct-01 20:35
In-At23-Oct-01 20:35 
GeneralRe: The interface contract Pin
Andrew McGrath23-Oct-01 21:09
Andrew McGrath23-Oct-01 21:09 
GeneralRe: The interface contract Pin
In-At23-Oct-01 23:59
In-At23-Oct-01 23:59 
Questionhow to pass USER_LOGON variable to ActiveX developed in VC++? Pin
Bartek27-Sep-01 0:26
Bartek27-Sep-01 0:26 
QuestionThe initial size in the resurce editor? Pin
George26-Sep-01 21:19
George26-Sep-01 21:19 
Questionhow to transfer Interface Pointer? Pin
maya26-Sep-01 16:05
maya26-Sep-01 16:05 
GeneralNewbie, please help Pin
Rob Brown26-Sep-01 9:25
Rob Brown26-Sep-01 9:25 
GeneralRe: Newbie, please help Pin
Daniel Turini29-Sep-01 3:30
Daniel Turini29-Sep-01 3:30 
GeneralExport function Pin
Jose Fco Bonnin26-Sep-01 4:47
Jose Fco Bonnin26-Sep-01 4:47 
GeneralRe: Export function Pin
Not Active26-Sep-01 5:22
mentorNot Active26-Sep-01 5:22 
GeneralDCOM access denied Pin
Ali Issa25-Sep-01 1:16
Ali Issa25-Sep-01 1:16 
GeneralRe: DCOM access denied Pin
maya26-Sep-01 15:56
maya26-Sep-01 15:56 
GeneralRe: DCOM access denied Pin
Shadi Al-Kahwaji2-Oct-01 22:23
Shadi Al-Kahwaji2-Oct-01 22:23 
GeneralRe: DCOM access denied Pin
Shadi Al-Kahwaji8-Oct-01 0:33
Shadi Al-Kahwaji8-Oct-01 0:33 
Generalcomparioson of VB COM and ATL COM Pin
Ganesh Ramaswamy24-Sep-01 6:39
Ganesh Ramaswamy24-Sep-01 6:39 

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.