Overrides Declare Function "X.dll"?

  • Thread starter Thread starter Joe HM
  • Start date Start date
J

Joe HM

Hello -

I was wondering what I need to do in order to Overrides a Function
that is Declare'd?

Here it what I have

Class Base
Public Overridable XYZ(ByVal A As String)
End Class

Class Derived
Inherits Base

Public Overrides Declare Function XYZ Lib "X.dll" (ByVal A As
String)
End Class

Dim X As Base

If ...
Base = New Derived
End If

The reason why I need to do this is that I have different X.dll that
need to be used depending on some conditions.

How can I make this work so that a ...
X.XYZ("")
.... will call the Derived.XYZ Function?

Thanks,
Joe
 
Joe HM said:
I was wondering what I need to do in order to Overrides a Function
that is Declare'd?

Here it what I have

Class Base
Public Overridable XYZ(ByVal A As String)
End Class

Class Derived
Inherits Base

Public Overrides Declare Function XYZ Lib "X.dll" (ByVal A As
String)
End Class

Dim X As Base

If ...
Base = New Derived
End If

Make the 'Declare' private and define an overridable method which wraps the
declared function.
 
Hello -

That works ... thanks! I called the function XDelegate and used the
Alias to point to "X" inside of the *.dll.

Thanks again,
Joe
 
Back
Top