Late Binding in C#


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Late Binding in C#

  1. #1
    Frank Oquendo Guest

    Late Binding in C#

    I have an object that can only be communicated with via late binding (I'm
    assuming it's all about the IDispatch interface). It's type library is of no
    use as this object cannot be cast to any of the types listed in the TLB
    file.

    I already know how to operate this object in VB6 but I can't figure out how
    to work with it in C#. For example this object has an Items collection. In
    VB6 it was simple as obj.Items("nth"). How can I do the same in C#?

    --
    "There are 10 kinds of people:
    Those who understand binary and those who don't"
    http://www.acadx.com
    http://vbxtender.sourceforge.net



  2. #2
    Frank Oquendo Guest

    Re: Late Binding in C#

    Okay, I've come across <object>.GetType().InvokeMethod and it looks rather
    promising. But there's a problem: some of the methods I need to invoke
    require an out parameter. InvokeMethod accepts an arry of objects as
    arguments to the method you're invoking.

    Any idea how I can pass an out parameter via an array?

    --
    "There are 10 kinds of people:
    Those who understand binary and those who don't"
    http://www.acadx.com
    http://vbxtender.sourceforge.net



  3. #3
    Eric Gunnerson Guest

    Re: Late Binding in C#

    I *think* that the out parameter will be in the array you passed when the
    call returns.

    --
    Visit the C# product team at http://www.gotdotnet.com/team/csharp

    This posting is provided "AS IS" with no warranties, and confers no rights.

    "Frank Oquendo" <nospam@please.com> wrote in message
    news:3d55c1a8@10.1.10.29...
    > Okay, I've come across <object>.GetType().InvokeMethod and it looks rather
    > promising. But there's a problem: some of the methods I need to invoke
    > require an out parameter. InvokeMethod accepts an arry of objects as
    > arguments to the method you're invoking.
    >
    > Any idea how I can pass an out parameter via an array?
    >
    > --
    > "There are 10 kinds of people:
    > Those who understand binary and those who don't"
    > http://www.acadx.com
    > http://vbxtender.sourceforge.net
    >
    >




  4. #4
    Frank Oquendo Guest

    Re: Late Binding in C#

    Eric Gunnerson had this to say:

    > I *think* that the out parameter will be in the array you passed when
    > the call returns.


    Found it: pass null for the args parameter.

    --
    There are 10 kinds of people:
    Those who understand binary and those who don't
    http://www.acadx.com
    http://vbxtender.sourceforge.net



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center