N
Nico Debeuckelaere
Hi all,
I have a class in VB.NET in an assembly like:
----------------------------------
Public MustInherit Class MyBaseClass
Public Function GetBitmap(Name As String) As System.Drawing.Bitmap
Dim img As System.Drawing.Bitmap
Dim p As System.Reflection.Assembly = _
System.Reflection.Assembly.GetExecutingAssembly
img = New
System.Drawing.Bitmap(p.GetManifestResourceStream(Me.GetType, Name))
img.MakeTransparent()
Return img
End Function
Public MustOverride Property Name() As String
End Class
------------------------------------
Then I have a class in a seperate assembly that inherits the previously
created class:
----------------------------------
Public Class MyImplementedClass
Inherits MyBaseClass
Public Overrides Property Name() As String
Get
Return "MyImplementedClass"
End Get
End Property
End Class
------------------------------------------
The MyImplemented class has also some bitmap files defined as Embedded
Resource.
Now ... what I want to do is return a bitmap with a given name by calling
MyImplementedClass.GetBitmap("myimplementedclass.bmp")
When I look at the variable p in the function GetBitmap, it return the
assembly location refering to MyBaseClass and not the location of
MyImplementedClass.
How can I reflect to the MyImplementationClass?
Regards,
ND
I have a class in VB.NET in an assembly like:
----------------------------------
Public MustInherit Class MyBaseClass
Public Function GetBitmap(Name As String) As System.Drawing.Bitmap
Dim img As System.Drawing.Bitmap
Dim p As System.Reflection.Assembly = _
System.Reflection.Assembly.GetExecutingAssembly
img = New
System.Drawing.Bitmap(p.GetManifestResourceStream(Me.GetType, Name))
img.MakeTransparent()
Return img
End Function
Public MustOverride Property Name() As String
End Class
------------------------------------
Then I have a class in a seperate assembly that inherits the previously
created class:
----------------------------------
Public Class MyImplementedClass
Inherits MyBaseClass
Public Overrides Property Name() As String
Get
Return "MyImplementedClass"
End Get
End Property
End Class
------------------------------------------
The MyImplemented class has also some bitmap files defined as Embedded
Resource.
Now ... what I want to do is return a bitmap with a given name by calling
MyImplementedClass.GetBitmap("myimplementedclass.bmp")
When I look at the variable p in the function GetBitmap, it return the
assembly location refering to MyBaseClass and not the location of
MyImplementedClass.
How can I reflect to the MyImplementationClass?
Regards,
ND