Click here to Skip to main content
15,903,030 members
Home / Discussions / COM
   

COM

 
GeneralRe: How do i convert BSTR to DATE Pin
User 2155974-Nov-03 3:05
User 2155974-Nov-03 3:05 
AnswerRe: How do i convert BSTR to DATE Pin
lxwde9-Nov-03 14:39
lxwde9-Nov-03 14:39 
AnswerRe: How do i convert BSTR to DATE Pin
Abhishek Srivastava10-Nov-03 0:23
Abhishek Srivastava10-Nov-03 0:23 
GeneralAutomation Outlook Pin
paul111-Nov-03 20:34
paul111-Nov-03 20:34 
GeneralRe: Automation Outlook Pin
paul113-Nov-03 4:25
paul113-Nov-03 4:25 
Generalcom+ and dlls Pin
RedSunBeer1-Nov-03 1:14
RedSunBeer1-Nov-03 1:14 
Generalconvert CTime data (C++) to Date data (VB) Pin
rajdawg31-Oct-03 15:40
rajdawg31-Oct-03 15:40 
GeneralC#: COM Interop - Objects become invalid after a while??!! Pin
Corinna John31-Oct-03 2:20
Corinna John31-Oct-03 2:20 
We have an .NET service (written in C#, running in the LocalService account), which impersonates an account, opens a CDO session and then reads/writes mails and tasks from/to folders only accessible by the impersonated user.

If the service calls windowsImpersonationContext.Undo() after the CDO session has logged on, it usually can read public folders and their content without a problem. But every once in a while (average after 20 objects have been read), it throws a System.NullReferenceException at System.Runtime.InvokeDispMethod.

If the service does not undo the impersonation and runs in the account which is logged on to Exchange, the NullPointerException is thrown exactly when the fourth CDO object is retrieved. I have already tried opening a new session before opening a folder, but then the Exception is thrown while logging on the fourth session.

If the fourth action is reading the contents of a folder, the NullreferenceException occurs in MAPI.Folder.get_Messages(). If I try to read a message, it occurs in MAPI.Message.get_Text(),
MAPI.Message.get_Attachments() or another get-method.

Here is a typical stack trace for reading message properties:

System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at MAPI.Message.get_Attachments()
at Vita.Bk.SecureItem.CopyFrom(Message message)

And here is a typical stack trace for listing folder items:

System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at MAPI.Folder.get_Messages()
at Vita.Bk.OutlookService.OutlookService.ListUserTodoItems(Object[] parameters) in c:\visual studio-projekte\mba kataster\outlookservice\outlookservice.cs:line 529

That is how the service behaves on .Net Framework 1.0 without service packs. I have installed Service Pack 2, now the NullReferenceExceptions always occur at random, no matter if the service is still impersonating a user or not.
The "Outlook EMail Security" stuff has been configured to allow all MAPI and CDO actions, but there is still no change, the CDO objects are throwing Exceptions after a while.

Does anyone know what happens here? Is is a problem of CDO or .NET Interop?

Thanx in advance,
corinna
GeneralRe: C#: COM Interop - Objects become invalid after a while??!! Pin
Heath Stewart31-Oct-03 4:59
protectorHeath Stewart31-Oct-03 4:59 
GeneralDHTM binary behavior Pin
jackalwisdom30-Oct-03 21:48
jackalwisdom30-Oct-03 21:48 
GeneralRe: DHTM binary behavior Pin
Heath Stewart31-Oct-03 4:50
protectorHeath Stewart31-Oct-03 4:50 
GeneralRe: DHTM binary behavior Pin
jackalwisdom31-Oct-03 16:31
jackalwisdom31-Oct-03 16:31 
GeneralLocal Machine Software Firewall (Windows) Pin
entr0py_29-Oct-03 12:30
entr0py_29-Oct-03 12:30 
GeneralRe: Local Machine Software Firewall (Windows) Pin
Niels Penneman12-Jan-04 10:30
Niels Penneman12-Jan-04 10:30 
GeneralIStorage, IStream and folder copying to Clipboard Pin
Nathan_RR28-Oct-03 1:33
Nathan_RR28-Oct-03 1:33 
GeneralHTMLDocumentEvents2 Pin
JDasari27-Oct-03 12:25
JDasari27-Oct-03 12:25 
GeneralRe: HTMLDocumentEvents2 Pin
Heath Stewart28-Oct-03 16:53
protectorHeath Stewart28-Oct-03 16:53 
GeneralRe: HTMLDocumentEvents2 Pin
JDasari30-Oct-03 11:11
JDasari30-Oct-03 11:11 
QuestionHow to Create my Automation Object Pin
Sara Burns22-Oct-03 21:51
Sara Burns22-Oct-03 21:51 
AnswerRe: How to Create my Automation Object Pin
Heath Stewart27-Oct-03 3:03
protectorHeath Stewart27-Oct-03 3:03 
QuestionHow can I manipulate BSTR typed string in ATL3COM? Pin
Atif Bashir22-Oct-03 5:02
Atif Bashir22-Oct-03 5:02 
AnswerRe: How can I manipulate BSTR typed string in ATL3COM? Pin
Steve S22-Oct-03 5:55
Steve S22-Oct-03 5:55 
AnswerRe: How can I manipulate BSTR typed string in ATL3COM? Pin
lxwde9-Nov-03 14:45
lxwde9-Nov-03 14:45 
GeneralSMTP Server Extension (Mail Sink) performance Pin
Paul Ingles21-Oct-03 5:10
Paul Ingles21-Oct-03 5:10 
GeneralC# AsyncCallBack and COM+ Pin
rick close20-Oct-03 8:10
rick close20-Oct-03 8:10 

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.