Re: Calling an internal constructor



Pete,

Unfortunately, there is nothing you can do to call this constructor from
your constructor in code (even through reflection) so that your class can
derive from that class correctly.

I would recommend going to the Product Feedback center and creating an
entry there regarding the issue. I'll definitely vote for it. The Product
Feedback center is located at (watch for line wrap):

http://lab.msdn.microsoft.com/productfeedback/default.aspx

I'll also see what I can do about raising awareness at MS about this
issue.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx

"Pete Davis" <pdavis68@xxxxxxxxxxxxxxxxxx> wrote in message
news:ArGdnSPCFrng3sjfRVn-rg@xxxxxxxxxxxxxxx
>I know I can use reflection to call internal, protected, and private
>methods
> in a class, but I need to instantiate an object that is public but has an
> internal constructor (The CurrencyManager class).
>
> Is there a way to do this with reflection?
>
> I'm so mad at MS about the CurrencyManager design it makes me want to
> scream. It's been causing me headaches for months.
>
> All of this would be easily fixable if I could create my own
> CurrencyManager
> derived from BindingManagerBase, and though the documentation has a "Note
> to
> inheritors" section, BindingManagerBase actually has internal virtual
> methods, so there's no way to derive from it outside of S.W.F. ARGH.
>
> Pete
>
>


.



Relevant Pages

  • Calling an internal constructor
    ... I know I can use reflection to call internal, protected, and private methods ... I'm so mad at MS about the CurrencyManager design it makes me want to ... derived from BindingManagerBase, and though the documentation has a "Note to ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Calling an internal constructor
    ... The CurrencyManager one? ... reflection, but the correct fix would be for them to simply provide a method ... I didn't realize that invoking the constructor would create an object. ... BindingManagerBase actually has internal virtual ...
    (microsoft.public.dotnet.languages.csharp)
  • Generics and reflection
    ... I have this really ugly thing regarding generics and reflection (and ... doStuffWith() ), which means I have to check the ... may still throw some kind of access violation exception (from ... I don't know how to catch that in the constructor (the ...
    (comp.lang.java.programmer)
  • Re: Reflection, how to understand
    ... I'm trying understand jdk 5 reflection. ... Then it proceeds to get a constructor for said class, ... Then it proceeds to instantiate the object using said constructor, ... I use that code snippet for persistence of simple objects ...
    (comp.lang.java.programmer)
  • Re: Reflection
    ... Alternatively you can use Reflection, ... > constructor, how do i go about instantiating it. ... > but for some odd reason i never am able to instantiate my objects ...
    (microsoft.public.dotnet.languages.csharp)