CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2000
    Location
    canada
    Posts
    124

    Adding or chanching a reference in the code

    Is it possible to change a reference in the code?

    Someone can help me with that???

    Isabelle


  2. #2
    Join Date
    Jan 2000
    Location
    canada
    Posts
    124

    Re: Adding or chanching a reference in the code

    Oups!!!

    Sorry, it's changing!!!


  3. #3
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: Adding or chanching a reference in the code

    Referenes are 'hard-coded' at compile time to take advantage of COM early binding. What is it you are trying to do ?

    If you know the interface that a component supports, you can use late binding (with a *lot* of error handling) to manage external components, eg:


    Dim o as Object
    '
    on error Goto WhereEver
    '
    set o = CreateObject("SomeThirdPartyProgram.AClassModule")
    '
    Call o.DoSomethingYouKnowAbout (somevalue, andanothervalue)
    '
    set o = nothing
    '




    Of course, if you know the interface that the external component supports (say it's a third-party DLL that uses an Interface from your code) :



    Dim o as IMyOwnInterface
    '
    ' Where 'AClassModule' Implements IMyOwnInterface
    '
    set o = CreateObject("SomeThirdPartyProgram.AClassModule")
    '
    o.YourInterfaceMethod
    '
    set o = nothing
    '





    Chris Eastwood

    CodeGuru - the website for developers
    http://codeguru.developer.com/vb

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured