Click here to Skip to main content
15,913,187 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
QuestionHow to prevent binding a Type library to a ATL Attributed DLL ? need help!!! Pin
talhalfon21-Jul-03 22:37
talhalfon21-Jul-03 22:37 
QuestionHow to prevent to write to registry from ActiveX controls? Pin
vgrigor20-Jul-03 22:45
vgrigor20-Jul-03 22:45 
QuestionCOleDocObjectItem::OnPrint(this, pInfo, TRUE) ? Pin
Mardigin19-Jul-03 12:14
Mardigin19-Jul-03 12:14 
AnswerRe: COleDocObjectItem::OnPrint(this, pInfo, TRUE) ? Pin
Mardigin19-Jul-03 13:07
Mardigin19-Jul-03 13:07 
GeneralComboBox Error in ATL Pin
TRZ19-Jul-03 0:42
TRZ19-Jul-03 0:42 
QuestionMay i retrieved inner object through outer object Pin
El'Cachubrey16-Jul-03 4:58
El'Cachubrey16-Jul-03 4:58 
AnswerRe: May i retrieved inner object through outer object Pin
valikac17-Jul-03 4:42
valikac17-Jul-03 4:42 
QuestionHow To Embed Excel and Remove Menu Pin
Mardigin15-Jul-03 15:51
Mardigin15-Jul-03 15:51 
The following is a snippet is the code that actually embeds excel into my application and then attempts to remove the insert menuitem. I have read through more then one tutorial, but the most important one to note here is the following: http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q180/6/25.asp&NoWebContent=1

If anyone has anyideas of what is wrong with this code please reply.

Note: The above tutorial instructs to create a dlg based application, Mine is an MDI application. The above tutorial controls excel, my application embeds and then attempts to control excel. It works fine right up until it calles cbPop.SetVisible(FALSE);

Then it falls into the catch:
CException e.m_bAutoDelete = 1
CException e.m_bReadyForDelete = 0

The code I have included here shows how I embed excel and display it on the screen. This is all that i do differently from the above tutorial.

<br />
       CBPReportCntrItem		*pItem	= NULL;<br />
	CBPReportDoc			*pDoc	= NULL;<br />
	CLSID					clsid;<br />
	TRY<br />
	{<br />
	//Get the document associated with this view, and be sure it's<br />
        //valid.<br />
		pDoc = GetDocument();<br />
        ASSERT_VALID(pDoc);<br />
<br />
		//Create a new item associated with this document, and be sure<br />
        //it's valid.<br />
        pItem = new CBPReportCntrItem(pDoc);<br />
        ASSERT_VALID(pItem);<br />
<br />
		// Get Class ID for Excel sheet.<br />
        // This is used in creation.<br />
        if(FAILED(::CLSIDFromProgID(L"Excel.sheet",&clsid)))<br />
		{<br />
			AfxMessageBox("Failed to create Excel.sheet");<br />
			//Any exception will do. We just need to break out of the<br />
			//TRY statement.<br />
			AfxThrowMemoryException();<br />
		}<br />
<br />
		// Create the Excel embedded item.<br />
        if(!pItem->CreateNewItem(clsid))<br />
		{<br />
			AfxMessageBox("Failed to create the excel embeded item");<br />
			//Any exception will do. We just need to break out of the<br />
			//TRY statement.<br />
			AfxThrowMemoryException();<br />
		}<br />
<br />
        //Make sure the new CContainerItem is valid.<br />
        ASSERT_VALID(pItem);<br />
<br />
		// Launch the server to edit the item.<br />
        pItem->DoVerb(OLEIVERB_SHOW, this);<br />
<br />
		// As an arbitrary user interface design, this sets the<br />
        // selection to the last item inserted.<br />
        m_pSelection = pItem;   // set selection to last inserted item<br />
        pDoc->UpdateAllViews(NULL);<br />
	<br />
		//Query for the dispatch pointer for the embedded object. In<br />
        //this case, this is the Excel worksheet.<br />
        lpDisp = pItem->GetIDispatch();<br />
<br />
	app.AttachDispatch(lpDisp, TRUE);<br />
        	<br />


Then further down I did the following
<br />
                cbPop.AttachDispatch(app.DetachDispatch(), TRUE);<br />
		//cbPop.SetEnabled(FALSE);<br />
		cbPop.SetVisible(FALSE);<br />


Sincerely,

Mardigin
QuestionWhat thread type should I use in ATL object if I develop a BHO for IE? Pin
kydfru15-Jul-03 6:58
kydfru15-Jul-03 6:58 
AnswerRe: What thread type should I use in ATL object if I develop a BHO for IE? Pin
El'Cachubrey16-Jul-03 5:03
El'Cachubrey16-Jul-03 5:03 
GeneralDownload ActiveX Pin
Anonymous15-Jul-03 5:35
Anonymous15-Jul-03 5:35 
GeneralRe: Download ActiveX Pin
Anonymous15-Jul-03 5:49
Anonymous15-Jul-03 5:49 
QuestionHow to get pointer to MainFrame window in WTL? Pin
jiang-lei13-Jul-03 16:55
jiang-lei13-Jul-03 16:55 
AnswerRe: How to get pointer to MainFrame window in WTL? Pin
Michael Dunn13-Jul-03 18:55
sitebuilderMichael Dunn13-Jul-03 18:55 
AnswerRe: How to get pointer to MainFrame window in WTL? Pin
El'Cachubrey13-Jul-03 21:26
El'Cachubrey13-Jul-03 21:26 
GeneralWTL and Windows CE Pin
Joshua Nussbaum12-Jul-03 12:51
Joshua Nussbaum12-Jul-03 12:51 
GeneralRe: WTL and Windows CE Pin
Mike Dimmick13-Jul-03 7:18
Mike Dimmick13-Jul-03 7:18 
GeneralRe: WTL and Windows CE Pin
Tim Smith13-Jul-03 15:36
Tim Smith13-Jul-03 15:36 
GeneralATL7 Attributes and Registry Pin
Paul A. Howes12-Jul-03 7:09
Paul A. Howes12-Jul-03 7:09 
GeneralHTML parsing... Pin
nw6031211-Jul-03 6:47
nw6031211-Jul-03 6:47 
GeneralRe: HTML parsing... Pin
Heath Stewart11-Jul-03 8:30
protectorHeath Stewart11-Jul-03 8:30 
GeneralWindow Class :: richedit implementation error! Pin
tareqsiraj10-Jul-03 20:23
tareqsiraj10-Jul-03 20:23 
GeneralRe: Window Class :: richedit implementation error! Pin
Michael Dunn11-Jul-03 17:15
sitebuilderMichael Dunn11-Jul-03 17:15 
Generalcommand_id_handler Pin
harishv10-Jul-03 11:15
harishv10-Jul-03 11:15 
GeneralRe: command_id_handler Pin
Heath Stewart11-Jul-03 8:40
protectorHeath Stewart11-Jul-03 8:40 

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.