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 |
|
Dmitry Kostochko
Add-in Express team
Posts: 2880
Joined: 2004-04-05
|
Hi Victor,
Try to use interface instead of class.
[B]var[/B]
MeetingItem: _MeetingItem;
...
|
|