Click here to Skip to main content
15,910,277 members
Home / Discussions / COM
   

COM

 
QuestionAccess violation in COM object on exit from DLL using it Pin
Jens Winslow28-Dec-05 13:09
Jens Winslow28-Dec-05 13:09 
AnswerRe: Access violation in COM object on exit from DLL using it Pin
Gerald Schwab28-Dec-05 13:58
Gerald Schwab28-Dec-05 13:58 
GeneralRe: Access violation in COM object on exit from DLL using it Pin
Jens Winslow5-Jan-06 9:24
Jens Winslow5-Jan-06 9:24 
AnswerRe: Access violation in COM object on exit from DLL using it Pin
User 2155972-Jan-06 15:29
User 2155972-Jan-06 15:29 
GeneralRe: Access violation in COM object on exit from DLL using it Pin
Jens Winslow5-Jan-06 9:48
Jens Winslow5-Jan-06 9:48 
AnswerRe: Access violation in COM object on exit from DLL using it Pin
sundareswaran.senthilvel13-Jan-06 0:59
professionalsundareswaran.senthilvel13-Jan-06 0:59 
GeneralRe: Access violation in COM object on exit from DLL using it Pin
Jens Winslow13-Jan-06 6:05
Jens Winslow13-Jan-06 6:05 
QuestionProblem when User has selected Chinese Traditional Big5 as international option in outlook2003 Pin
Ganesh_T27-Dec-05 1:51
Ganesh_T27-Dec-05 1:51 
Hi ,
I have developed the com addin for outlook 2003 . I am creating the toolbar in all the folders. I am loading toolbar when we open the mail item. It's working fine loading the toolbar but when i receive the mail item with RichText format and INternationalisation option Set to Chinese Traditional Big5. When i open such mail item the toolbar doesnot loads. I am Getting problem adding the Control for editing the mail and Setting the font size. When i remove these controls the toolbar is loaded smoothly. I wam Attaching the code for your help in code snippet.


This code works but when you remove the comments for Edit This Mail and Font Size it does not wiork. I think when
the user receives the mail with RichText Format and INternation option set Chinese Traditional Big5 we dont get the
controls in standard toolbar itself , so that we cannot add those control so is there anyway to predict which type of mail is this or check if the mail is Ruch Text Edit or Internation Option Set to Chinese Traditional Big5.


// TODO: Add your implementation code here
CComQIPtr <outlook::_inspector> spInspector(OlInsp);
CComPtr <office::_commandbars> spCommandBars;
CComPtr <office::commandbar> spNewBar;
CComPtr <office::commandbar> spNewMenuBar;
CComPtr <office::commandbarcontrols> spBarControls;
CComPtr <office::commandbarcontrols> spMenuBarControls;
CComPtr <office::commandbarcontrols> spDropDownControls;
CComPtr <office::commandbarcontrols> spDropDownControls1;
CComPtr <office::commandbarcontrol> spCmdControl;
CComPtr <office::commandbarcontrol> control;
CComQIPtr <office::_commandbarbutton> spCmdButton(spCmdControl);
CComQIPtr <office::commandbarpopup> spCmdPopup(spCmdControl);
HRESULT hr;
spInspector->get_CommandBars(&spCommandBars);
spBars=spCommandBars;
hr=spCommandBars->get_Item(CComVariant(Name),&spNewBar);
if (SUCCEEDED(hr))
return hr;


IDispatch *TempItem;
CComPtr<outlook::_mailitem> CurrItem;
Outlook::OlObjectClass olmyClass;
spInspector->get_CurrentItem(&TempItem);
CurrItem=reinterpret_cast<outlook::_mailitem*>(TempItem);
hr=CurrItem->get_Class(&olmyClass);
char *str=new char[4];
itoa(olmyClass,str,5);
::MessageBox(NULL,str,"Outlook",MB_OK);


CComVariant vName(Name);
CComVariant vPos(1);
CComVariant vTemp(VARIANT_TRUE);
CComVariant vEmpty(DISP_E_PARAMNOTFOUND, VT_ERROR);

spNewBar=spCommandBars->Add(vName, vPos, vEmpty, vTemp);
spNewBar->Visible=true;

spBarControls = spNewBar->GetControls();
ATLASSERT(spBarControls);


//Declare Variant Types
CComVariant vToolBarType(1); //Simple Button
CComVariant vToolBarDropDown(10); //Drop Down Button
CComVariant vShow(VARIANT_TRUE); //True
CComVariant vType(Office::msoButtonIconAndCaption); //Style for Button

//Previous Mail
control=spCommandBars->FindControl(vToolBarType,CComVariant(359) );
CComQIPtr <office::_commandbarbutton>spCmdPrevMail(control->Copy(CComVariant(spNewBar)));
spCmdPrevMail->PutStyle(Office::msoButtonIconAndCaption);
spCmdPrevMail->Caption= "Previous Mail";

//Next Mail
control=spCommandBars->FindControl(vToolBarType,CComVariant (360));
CComQIPtr < Office::_CommandBarButton>spCmdNextMail(control->Copy(CComVariant(spNewBar)));
spCmdNextMail->PutStyle(Office::msoButtonIconAndCaption);
spCmdNextMail->PutFaceId(360);
spCmdNextMail->Caption="Next Mail";


//Edit This Mail
/* control=spCommandBars->FindControl(vEmpty,CComVariant (5604),vEmpty,vEmpty);
CComQIPtr < Office::_CommandBarButton> spCmdEditMail(control->Copy(CComVariant(spNewBar)));
spCmdEditMail->PutStyle(Office::msoButtonIconAndCaption);
spCmdEditMail->PutFaceId(31);
spCmdEditMail->Caption="Edit This Mail";
::MessageBox(NULL,"here 2","",0);

//Font Size
control=spCommandBars->FindControl(vEmpty,CComVariant (5571),vEmpty,vEmpty);
CComQIPtr < Office::_CommandBarButton> spCmdFontSize(control->Copy(CComVariant(spNewBar)));
spCmdFontSize->PutStyle(Office::msoButtonIconAndCaption);
spCmdFontSize->Caption="Font Size";
::MessageBox(NULL,"here 3","",0);

*/

//Copy
control=spBarControls->Add(CComVariant(1),CComVariant(19));
CComQIPtr < Office::_CommandBarButton> spCmdCopy(control->Move(CComVariant(spNewBar)));
spCmdCopy->PutStyle(Office::msoButtonIconAndCaption);
spCmdCopy->Caption="Copy";


spButton1->put_Tag(L"InboxLv1");

SaveCloseInbox::DispEventAdvise((IDispatch*)spButton1);

*pNewBar=spNewBar;

return S_OK;


I look forward to your reply,

Regards
Ganesh

hi
QuestionHow to generate custom HRESULT in COM and display message in to MFC Client? Pin
MandiraT27-Dec-05 0:51
MandiraT27-Dec-05 0:51 
QuestionCOM object with CLSID {845FB959-4279-11D2-BF23-00805FBE84A6} is either not valid or not registered. Pin
Mohamed Jaffar Sagir27-Dec-05 0:21
Mohamed Jaffar Sagir27-Dec-05 0:21 
AnswerRe: COM object with CLSID {845FB959-4279-11D2-BF23-00805FBE84A6} is either not valid or not registered. Pin
PhilWilson4-Jan-06 6:56
PhilWilson4-Jan-06 6:56 
QuestionCannot open include file: 'Wbemidl.h': No such file or directory Pin
abhiramsss26-Dec-05 23:32
abhiramsss26-Dec-05 23:32 
QuestionProblem in Chinese Traditional Charset.. in com addin Pin
Ganesh_T26-Dec-05 18:29
Ganesh_T26-Dec-05 18:29 
QuestionDirectShow: Getting the window handle of a panel Pin
Ramow26-Dec-05 5:20
Ramow26-Dec-05 5:20 
QuestionOut of Proc exe and Win NT service Pin
misha_grewal25-Dec-05 20:06
misha_grewal25-Dec-05 20:06 
QuestionEnterprise services Pin
psantoshkumar25-Dec-05 19:26
psantoshkumar25-Dec-05 19:26 
Questionhelp on ATL COM first-chance exeption problem Pin
hardworkboy22-Dec-05 15:23
hardworkboy22-Dec-05 15:23 
AnswerRe: help on ATL COM first-chance exeption problem Pin
Stephen Hewitt10-Jan-06 14:13
Stephen Hewitt10-Jan-06 14:13 
QuestionActiveX Pin
Rajesh R Subramanian20-Dec-05 19:29
professionalRajesh R Subramanian20-Dec-05 19:29 
AnswerRe: ActiveX Pin
Aamir Butt22-Dec-05 23:47
Aamir Butt22-Dec-05 23:47 
GeneralRe: ActiveX Pin
vishalmore28-Dec-05 20:03
vishalmore28-Dec-05 20:03 
GeneralRe: ActiveX Pin
lemur211-Jan-06 9:55
lemur211-Jan-06 9:55 
QuestionCreating a COM Pin
vidyarani_14120-Dec-05 10:26
vidyarani_14120-Dec-05 10:26 
AnswerRe: Creating a COM Pin
MarcelDijk20-Dec-05 12:44
MarcelDijk20-Dec-05 12:44 
GeneralRe: Creating a COM Pin
vidyarani_14121-Dec-05 5:03
vidyarani_14121-Dec-05 5:03 

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.