Re: overloading

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Landley (news_at_creations-software.co.uk)
Date: 12/13/04


Date: Mon, 13 Dec 2004 22:23:01 -0000

This cannot be erroring in the method's signature. If the value of the
argument is null, this can be passed into the method. It just needs
checking before it is used.

Landers

"Dave" <dave_Please_reply_to_group_only@stic.net> wrote in message
news:uuj1d$U4EHA.1404@TK2MSFTNGP11.phx.gbl...
> I have a function 'Private MyFunc(ByVal dbS as String) As Boolean' where
dbS
> is a database value determined by the database reader method.
>
> I was having some difficulty when dbS is null, so I decided to create an
> overloaded function: 'Private Overloads MyFunc(ByVal dbS as DBNull) As
> Boolean'. I added the Overloads keyword to the original also, of course.
>
> This resulted in the run-time error "Public member 'MyFunc' on type
> 'MyClass' not found."
>
> This did not make sense, but on a whim, I changed the Private declarations
> to Public, and it worked fine. Can anyboday explain this? Why does
> overloading change the requirements of Private/Public?
>
> Thanks,
>
> Dave
>
>



Relevant Pages

  • overloading
    ... I have a function 'Private MyFunc(ByVal dbS as String) As Boolean' where dbS ... is a database value determined by the database reader method. ... I added the Overloads keyword to the original also, ...
    (microsoft.public.dotnet.languages.vb)
  • Recursive WebRequest.Create()
    ... The WebRequest class implements IWebRequestCreate and hence, ... This method has two other overloads, one of which is a private method. ...
    (microsoft.public.dotnet.framework)
  • Re: Late binding -- Calling a static method
    ... meaning the constructor is ... private, ... There are other overloads of GetMethod that allow you to pass the types ...
    (microsoft.public.dotnet.framework)
  • Overloads/Shadows question
    ... I'm developing a form which is to be used as an enhanced MessageBox(). ... a parameterless version of Show. ... have even worked) to simply make a Private version of Showand only ... the other overloads? ...
    (microsoft.public.dotnet.languages.vb)