Solved

Outlook._NameSpace oNameSpace;

Posted on 2004-04-13
5
344 Views
Last Modified: 2010-04-15
What is the difference between

Outlook._NameSpace oNameSpace;

and

Outlook.NameSpace oNameSpace;



both are available via "code completion" in C# when I type Outlook.
0
Comment
Question by:knowlton
  • 4
5 Comments
 
LVL 12

Accepted Solution

by:
vascov earned 500 total points
ID: 10822789
Actually that's a COM "legacy" :)

In COM, the Namespace is a coclass that implements the interface _Namespace (plus a dispinterface NameSpaceEvents). (You'll actually notice that in managed code NameSpace itself implements _NameSpace and also the Events interface.
In COM the interface was prefixed with _ as a convention so that in VB6 it wasn't intellisensed. (VB6 hiddes interfaces prefixed with _)

When you import the COM typelib to .NET, it imports everything including that interface.

You should get by using Namespace, _Namespace or NameSpaceClass without problems.

hth

Vasco
0
 
LVL 5

Author Comment

by:knowlton
ID: 10824224
Thank you,

Tom
0
 
LVL 5

Author Comment

by:knowlton
ID: 10825064
0
 
LVL 5

Author Comment

by:knowlton
ID: 11120009
UPDATE:

Well, guess what?

I finally had a major breakthrough on this @!#$^% problem that has been driving me crazy for the last few weeks!!!!!!!


It is a very small change.

Apparently the method   MoveFirst(   ) does not work so well with Exchange.

This was the cause of my COMException:   "Interface not registered" error message this entire time.


The solution is to use    Move(1,0)     instead of MoveFirst(  ).


That's it.   Simple.

This answer came courtesy of Tom Rizzo, an author who was kind enough to correspond with me and help me figure-out finally what the problem was.:

Looking for a good book on programming Exchange, Outlook, ADSI and
SharePoint?  Check out http://www.microsoft.com/MSPress/books/5517.asp

My I also reommend:

.NET and COM: The Complete Interoperability Guide  ISBN:067232170X
http://www.amazon.ca/exec/obidos/ASIN/067232170X/componentsnot-20/701-9386310-4703553
0
 
LVL 5

Author Comment

by:knowlton
ID: 11120305
More on the MoveFirst problem I described:

http://support.microsoft.com/default.aspx?scid=kb;en-us;273791


If you are getting into Event Sinks....I recommend the following tutorial:

http://www.codeproject.com/csharp/CsManagedEventSinksHooks.asp

Make sure and read the article questions and follow-ups at the bottom!

There are a few caveats.  E-mail me at my Profile e-mail address and we can talk about them.  :)
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now