Home All Groups Group Topic Archive Search About

VB.NET throws "Application is ambiguous" exception

Author
23 Mar 2006 10:01 PM
Silver Oak
Hello,

Could someone tell me how I can get around this issue, please?  My
application has to call a COM object that exposed 'Application' class. 
unfortunately, I also have a line of code "Application.Exit()" where in this
instance, 'Application means the main application (system.forms namespace). 
But it is making the compiler to throw 'Application' is ambiguous, imported
from the namesapces or types 'SomeCOM.ApplicationClass'. 

How can I differentiate the two?  Thank you.

Peter

Author
23 Mar 2006 10:04 PM
Ken Halter
"Silver Oak" <Silver***@discussions.microsoft.com> wrote in message
news:2943B8A2-7410-473D-9CCF-859D8C516EE5@microsoft.com...
>
> How can I differentiate the two?  Thank you.

One set of groups has dotNet it their names and one doesn't ;-)

> Peter

You'll want to post that question in a .Net group.
They all contain "dotnet" or "vsnet" in their names.
This and all other groups on the MS server that start with
"microsoft.public.vb"
are for VB Classic (mostly VB5/6) and were in existance long before any .Net
products were released. While some of the code looks the same, they are very
different products and require a different set of groups.

Try one of these:
news://news.microsoft.com/microsoft.public.dotnet.general
news://news.microsoft.com/microsoft.public.dotnet.languages.vb
news://news.microsoft.com/microsoft.public.dotnet.languages.vb.controls
news://news.microsoft.com/microsoft.public.dotnet.framework.interop


--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
Author
24 Mar 2006 8:30 AM
Michael C
Show quote Hide quote
"Silver Oak" <Silver***@discussions.microsoft.com> wrote in message
news:2943B8A2-7410-473D-9CCF-859D8C516EE5@microsoft.com...
> Hello,
>
> Could someone tell me how I can get around this issue, please?  My
> application has to call a COM object that exposed 'Application' class.
> unfortunately, I also have a line of code "Application.Exit()" where in
> this
> instance, 'Application means the main application (system.forms
> namespace).
> But it is making the compiler to throw 'Application' is ambiguous,
> imported
> from the namesapces or types 'SomeCOM.ApplicationClass'.
>
> How can I differentiate the two?  Thank you.

System.Windows.Forms.Application.Exit()

and/or

NameOfMyComLibrary.Application.Exit

remove the "imports NameOfMyComLibrary" (I think the keyword is imports for
vb.net)


Show quoteHide quote
>
> Peter
Author
26 Mar 2006 10:56 PM
Silver Oak
Michael, 

Thank you very much for your response.  It works!!

Peter

Show quoteHide quote
"Michael C" wrote:

> "Silver Oak" <Silver***@discussions.microsoft.com> wrote in message
> news:2943B8A2-7410-473D-9CCF-859D8C516EE5@microsoft.com...
> > Hello,
> >
> > Could someone tell me how I can get around this issue, please?  My
> > application has to call a COM object that exposed 'Application' class.
> > unfortunately, I also have a line of code "Application.Exit()" where in
> > this
> > instance, 'Application means the main application (system.forms
> > namespace).
> > But it is making the compiler to throw 'Application' is ambiguous,
> > imported
> > from the namesapces or types 'SomeCOM.ApplicationClass'.
> >
> > How can I differentiate the two?  Thank you.
>
> System.Windows.Forms.Application.Exit()
>
> and/or
>
> NameOfMyComLibrary.Application.Exit
>
> remove the "imports NameOfMyComLibrary" (I think the keyword is imports for
> vb.net)
>
>
> >
> > Peter
>
>
>