Re: Build error in overloaded function
- From: "Vish" <Vish@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 29 Nov 2005 10:49:06 -0800
Hi Nick,
I am going to be calling the overloaded function from the form but never
using the parameter referenced in the external assembly. The form is always
going to use the string parameter. The function will be called with the other
parameter type in other projects and never in the form so why should a
reference to the external assembly be needed in the form. Also why does the
build error happen when i call the function and not when i create class with
the function.
-Vish
"Nicholas Paldino [.NET/C# MVP]" wrote:
> Vish,
>
> That's the thing though, it is going to use that type. Once you decide
> to call the overload that uses the type from the other assembly, the
> compiler needs the type information to make the call (not to mention the
> fact that you are probably going to create an instance of that type if you
> are going to pass it to an overload that expects it).
>
> So in the end, you have to set a reference to that assembly if you want
> to call that overload.
>
> Hope this helps.
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx
>
> "Vish" <Vish@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:3380778A-01A4-4E5A-93FD-E0E6956016BA@xxxxxxxxxxxxxxxx
> > Hi all,
> >
> > I am having a build error in one of the overloaded functions in my class.
> > The function takes either a string as a parameter or a type referenced in
> > another dll as a parameter. My class references the dll where the type of
> > the
> > parameter is defined. I am able to create to create my class in a form
> > without any build errors and without any references to the DLL where the
> > other parameter type is defined. The form only uses the function with the
> > string parameter and not the other one. But when i try to call the
> > overloaded
> > function with a string parameter, i get an build error saying a reference
> > to
> > the DLL containing the other parameter type should be added to the form.
> >
> > I dont understand why the build error happens only when the function in my
> > class is called and not when it is created. Also i quite dont get why i
> > should add a reference in the form to the external parameter type when the
> > form is never gonna use it.
> >
> > If the question seems confusing i will be happy to give out more details.
> > Has anybody faced this kind of error before. I would appreciate it if
> > somebody can let me know if and how the above problem can be fixed.
> >
> > Thank You,
> > -Vish
>
>
>
.
- References:
- Re: Build error in overloaded function
- From: Nicholas Paldino [.NET/C# MVP]
- Re: Build error in overloaded function
- Prev by Date: Re: information from internet-explorer
- Next by Date: Re: Color control vs2005
- Previous by thread: Re: Build error in overloaded function
- Next by thread: MenuStrip funny in Application Desktop Toolbar when docked?
- Index(es):
Relevant Pages
|