Solved

Outlook._NameSpace oNameSpace;

Posted on 2004-04-13
5
399 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:Tom Knowlton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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:Tom Knowlton
ID: 10824224
Thank you,

Tom
0
 
LVL 5

Author Comment

by:Tom Knowlton
ID: 10825064
0
 
LVL 5

Author Comment

by:Tom 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:Tom 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Suggested Courses

739 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