Solved

Outlook._NameSpace oNameSpace;

Posted on 2004-04-13
5
359 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Need to pass connection string through config 2 26
SQL Login 17 40
C# parent child form 5 19
C# guarantee sql connection close 6 32
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 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

28 Experts available now in Live!

Get 1:1 Help Now