The problems is that in Windows Mail the account information is not
stored with each message since Clone only duplicate message that
information is not copied.
You are developing a dll plugin then you should be able to modify the
message within OnNewMessageInOutbox event, before the message is delivered.
I suggest that try the following to make OnNewMessageInOutbox faster
before the message is delivered:
* Create only one global OEFolderManager object.
* Create only one instance of OEFolder for outbox.
* Do not Clone message, modify it while is in outbox.
* Don't call ActivateGlobalNotification, the new events
OnDatabaseChange/OnNewMessageInOutbox don't require it.
Remember to release the global objects when OnShutdownOEAPI event is
called or else WinMail will hang up.
If the problem persist please contact again.
Regards,
Federico
--
Nektra Advanced Computing
http://www.nektra.com
Please, Can you send us a sample project ready to compile? We've tried
with a C++ plugin without problems.
On your project you should move the setting of oFoldMan and oOutbox
objects to the OeInit_OnInitOEAPI function.
This way it works:
Private Sub Class_Initialize()
Set OeInit = New OEAPIInit
End Sub
Private Sub OeInit_OnInitOEAPI()
Set Api = New OEAPIObj
Set oFoldMan = New OEFolderManager
Set oOutbox = oFoldMan.GetOutboxFolder
End Sub
Private Sub Api_OnNewMessageInOutbox(ByVal msgId As Long)
Dim oMes As OEMessage
Dim lBodyHandle As Long, lRet As Long
Set oMes = oOutbox.GetMessage(msgId)
lBodyHandle = oMes.GetBodyHandle(0, OE_IBL_ROOT)
'lRet = oMes.SetBodyProp(lBodyHandle, OE_PID_ATT_PRIORITY, "1")
lRet = oMes.SetBodyPropByName(lBodyHandle, "test", "test-test")
lRet = oMes.Commit
Set oMes = Nothing
End Sub
Private Sub OeInit_OnShutdownOEAPI()
Set Api = Nothing
Set oFoldMan = Nothing
Set oOutbox = Nothing
End Sub
Private Sub Class_Terminate()
Set OeInit = Nothing
End Sub
Thank you for contacting Nektra's OEAPI Support.
We had checked this and worked on C++ and on C# but, as you say, it
fails on VB.
We need some more time to make some research about this problem.
We have found that the Commit function fails on VB on Debug mode
(Executing from Visual Studio 6), but it succeeds when directly using
the compiled DLL (Release mode), this without changing any code, so it
seems a VB6 Debug mode problem.
Please make the TestOeapiPlugin.dll file and, make sure the required key
is placed on the registry, run Windows Mail and test the DLL's
OnNewMessageInOutbox function.
Windows Mail has a different way to store account information than
Outlook Express.
It no longer uses the OE_PID_ATT_ACCOUNT property, so checking the
account used for a message is not supported on Windows Mail.