A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Compiler Error: Does not like Outlook.CommandBarControls.CommandBarControlPtr.Ad d



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 21st 10, 01:43 AM posted to microsoft.public.outlook.program_addins
Shawn[_3_]
external usenet poster
 
Posts: 11
Default Compiler Error: Does not like Outlook.CommandBarControls.CommandBarControlPtr.Ad d

I have a sample program below that I'm trying to convert to the newer mso.tlh (the code has not been updated for years). So, I had to add all of the "Outlook::" and "Office::" since the old tlh did not have the namespace defined in the tlh file.

Down on the bottom of this code that I have extracted, I keep getting the compiler error that it does not how I'm trying to use "Add". I have tried various parameters with no success. What is wrong with it before I burn my hair off my head. :/


Outlook::_Explorer *pExp;
Office::_CommandBars *pCBs;
Office::_CommandBarButton *pBtn;
Office::CommandBar *pOurBar;
Office::CommandBarControls *pApplicationCommandBar;
long buttonpos;
HRESULT hResult;
string toolbar_name;

buttonpos = 1;

toolbar_name = "Application";

if (m_pOutlookApp == NULL) {
return S_FALSE;
}

try {
hResult = m_pOutlookApp-ActiveExplorer(&pExp);
} catch (_com_error) {
debugoutput("[%s:%d] Exception when trying to get active explorer\n", __FILE__, __LINE__);
}

if (pExp == NULL) {
debugoutput("[%s:%d] Could not get a active explorer\n", __FILE__, __LINE__);
return S_FALSE;
}

try {
hResult = pExp-get_CommandBars(&pCBs);
} catch (_com_error) {
debugoutput("[%s:%d] Exception when trying to get pointer to command bar\n", __FILE__, __LINE__);
}

if (pCBs == NULL) {
debugoutput("[%s:%d] Cannot load command bar.\n", __FILE__, __LINE__);
return S_FALSE;
}

try {
pOurBar = pCBs-GetItem(toolbar_name.c_str());
pOurBar-Delete();
} catch (_com_error) {
}

m_pApplicationCmdBar = pCBs-Add( toolbar_name.c_str(),
_variant_t((long)Office::msoBarTop),
vtMissing,
_variant_t(VARIANT_TRUE, VT_BOOL));
m_pApplicationCmdBar-Protection = Office::msoBarNoCustomize;

pApplicationCommandBar = m_pApplicationCmdBar-Controls;

// Add a button

Compiler barfs on the following "Add"...
pBtn = pApplicationCommandBar-Add( _variant_t((long) Office::msoControlButton),
vtMissing,
vtMissing,
_variant_t(buttonpos++),
_variant_t(VARIANT_TRUE, VT_BOOL));

Complier error below is generated for the "Add" above... why?!
error C2679: binary '=' : no operator defined which takes a right-hand operand of type
'class _com_ptr_t

class _com_IIID

struct Office::CommandBarControl,&struct __s_GUID _GUID_000c0308_0000_0000_c000_000000000046

'

(or there is no acceptable conversion)
  #2  
Old April 21st 10, 04:50 PM posted to microsoft.public.outlook.program_addins
Shawn[_3_]
external usenet poster
 
Posts: 11
Default Compiler Error: Does not like Outlook.CommandBarControls.CommandBarControlPtr.Ad d

Nobody has a clue to help me out? Am I'm leaving something out to help me? Do I have a bad tlh/tli files? Where can I get the latest tlh/tli files to make sure that I have the correct version?.
Submitted using http://www.outlookforums.com
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot instantiate abstract class - Compiler error. KarthikonIT via OfficeKB.com Add-ins for Outlook 3 December 3rd 09 04:35 PM
Redemption Compiler problem Byron Add-ins for Outlook 7 January 13th 09 08:41 PM
Compiler warning CS0467 for Inspector.Close Lucy Outlook - Using Forms 2 September 2nd 08 12:05 AM
How to provide Hyperlink in commandbarcontrols in Outlook Inspecto newToOutlookProgramming Add-ins for Outlook 0 June 15th 07 02:08 AM
commandbarcontrols collection working with Outlook 11 Tim Bolton Outlook and VBA 0 January 12th 06 09:07 PM


All times are GMT +1. The time now is 12:34 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.