Use current "MeetingRequest" item

Add-in Express™ Support Service
That's what is more important than anything else

Use current "MeetingRequest" item
 
Victor Ulloa


Guest


Hi,

I'm trying to get access to a MeetingRequest item in response to the user pressing a button. My code looks like this


procedure TAddInModule.adxQueries1Controls1Click(Sender: TObject);
var
   Item : IDispatch;
   MeetingItem : TMeetingItem;
   MeetingConversationIndex : string;
begin
   Item := OutlookApp.ActiveExplorer.Selection.Item(1);
   if Assigned(Item) then begin
      if Item.QueryInterface(IID__MeetingItem, MeetingItem) = S_OK then begin
         if Assigned(MeetingItem) then begin
            ShowMessage('I can see this');
            MeetingConversationIndex := MeetingItem.ConversationIndex;
            ShowMessage('But I cant see that');
         end;
      end;
   end;
end;


When the button is pressed the program generates an error at the assignment sentence...

"the add-in has fired an exception. Access violation at address 09E3621E in module "mydll.dll". Read of address 01C6AA58".

Why? The item appears to be a valid MeetingItem, but I can't refers to any property cause the error fired.

Any ideas? Thanks
Posted 18 Jul, 2006 23:57:35 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Victor,

Try to use interface instead of class.


[B]var[/B]
  MeetingItem: _MeetingItem;
...


Posted 19 Jul, 2006 04:36:26 Top
Victor Ulloa


Guest


Thanks Dmitry!
Posted 19 Jul, 2006 10:31:21 Top