|
-
February 15th, 2000, 10:19 AM
#1
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
-
February 15th, 2000, 10:24 AM
#2
Re: Adding or chanching a reference in the code
Oups!!!
Sorry, it's changing!!!
-
February 15th, 2000, 10:50 AM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|