Is it possible to change a reference in the code?
Someone can help me with that???
Isabelle
Printable View
Is it possible to change a reference in the code?
Someone can help me with that???
Isabelle
Oups!!!
Sorry, it's changing!!!
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