D
DenisSSSS
Hello.
We found that PrepareForm generates access violation in Office 2003 SP3.
It will generate access violation if you try to call it from external
process. In our case we have to call PrepareForm from uninstallation. It
requires to republish custom forms.
Everything worked properly till Office 2003 SP3 was released.
Please, see code below that generates access violation if you execute it
from external process(test application in our case).
The same code works properly if you run from COM Add-in.
void external_publish_access_violation()
{
MAPIInitialize(NULL);
Outlook::_ApplicationPtr ol_app =
Outlook::_ApplicationPtr(L"Outlook.Application");
Outlook::MAPIFolderPtr type_root =
ol_app->Session->GetDefaultFolder(Outlook:lFolderTasks);
_variant_t fd_v;
Outlook::FormDescriptionPtr fd;
Outlook::_TaskItemPtr task = ol_app->CreateItem(Outlook:lTaskItem);
fd = task->FormDescription;
_variant_t vt = fd->Name;
fd->Name = str2bstr(L"new_task_item");
fd->PublishForm(Outlook:lPersonalRegistry);
IMAPIFormMgrPtr form_manager;
IMAPIFormInfoPtr fi;
::MAPIOpenFormMgr((IMAPISessionPtr)ol_app->Session->MAPIOBJECT,
&form_manager);
// message class is resolved succesfully
HRESULT hr=
form_manager->ResolveMessageClass("IPM.Task.new_task_item",
MAPIFORM_EXACTMATCH, 0, &fi);
// ACCESS VIOLATION
hr = form_manager->PrepareForm(0, 0, fi);
}
----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.
http://www.microsoft.com/office/com...c2a&dg=microsoft.public.outlook.program_forms
We found that PrepareForm generates access violation in Office 2003 SP3.
It will generate access violation if you try to call it from external
process. In our case we have to call PrepareForm from uninstallation. It
requires to republish custom forms.
Everything worked properly till Office 2003 SP3 was released.
Please, see code below that generates access violation if you execute it
from external process(test application in our case).
The same code works properly if you run from COM Add-in.
void external_publish_access_violation()
{
MAPIInitialize(NULL);
Outlook::_ApplicationPtr ol_app =
Outlook::_ApplicationPtr(L"Outlook.Application");
Outlook::MAPIFolderPtr type_root =
ol_app->Session->GetDefaultFolder(Outlook:lFolderTasks);
_variant_t fd_v;
Outlook::FormDescriptionPtr fd;
Outlook::_TaskItemPtr task = ol_app->CreateItem(Outlook:lTaskItem);
fd = task->FormDescription;
_variant_t vt = fd->Name;
fd->Name = str2bstr(L"new_task_item");
fd->PublishForm(Outlook:lPersonalRegistry);
IMAPIFormMgrPtr form_manager;
IMAPIFormInfoPtr fi;
::MAPIOpenFormMgr((IMAPISessionPtr)ol_app->Session->MAPIOBJECT,
&form_manager);
// message class is resolved succesfully
HRESULT hr=
form_manager->ResolveMessageClass("IPM.Task.new_task_item",
MAPIFORM_EXACTMATCH, 0, &fi);
// ACCESS VIOLATION
hr = form_manager->PrepareForm(0, 0, fi);
}
----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.
http://www.microsoft.com/office/com...c2a&dg=microsoft.public.outlook.program_forms