Overrides Declare Function "X.dll"?

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
 
H

Herfried K. Wagner [MVP]

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.
 
J

Joe HM

Hello -

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

Thanks again,
Joe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top