|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Acessing DLL members which differ only in Case from VB.netdifferent post. The base code is written in C# and is contained in a DLL. In reproducing one of the small sample programs, I ran into the following difficulty. From the meta-data in the DLL: public abstract class GraphicalObject { ... protected Cover cover; public Cover Cover { get; } ... } In the derrived class (PrimitiveRectangle) Public Class PrimitiveRectangle Inherits MoveGraphLibrary.GraphicalObject Public Overrides Sub DefineCover() Dim lclCover As MoveGraphLibrary.Cover Dim node As CoverNode = New CoverNode(0, Auxi_Geometry.CornersOfRectangle(rc)) node.Clearance = True lclCover = New Cover(New CoverNode() {node}) Me.Cover = lclCover End Sub I get the error that property Cover is read only. Since VB is not case sensitive, I have not been able to access the member "cover" to which I am required to assign a value. Is there a way to access a case sensitive member from VB when another member in the class differs only in case? Thank you for any help. -- Robert E. Styma Principal Engineer (DMTS) Alcatel-Lucent, Phoenix Am 25.03.2010 21:41, schrieb Bob S:
Show quoteHide quote > I am accessing the MoveableGraphicsLibrary which was suggested in a "Names cannot differ by case alone." Taken from (bottom most bold line):> different post. The base code is written in C# and is contained in a DLL. > In reproducing one of the small sample programs, I ran into the following > difficulty. > > From the meta-data in the DLL: > > public abstract class GraphicalObject > { > ... > protected Cover cover; > > public Cover Cover { get; } > ... > } > [...] http://msdn.microsoft.com/en-us/library/ms229043.aspx Seems somebody didn't follow the rules. So you can't use the Dll the way you intended. -- Armin Hello,
You could perhaps try to do that by using System.Reflection and more specifically the GetField method (and then FieldInfo.SetValue that allows to define the value for this field on a particular instance) : http://www.switchonthecode.com/tutorials/csharp-tutorial-using-reflection-to-get-object-information If it works (which is IMO likely) you could then inherit from this class and fix first its bad design. Then inherit again from a "cleaner" class and have your real code. If or once the author fixes this you'll get rid of the intermediate "fixing" level... -- Patrice
Minimise button on title bar and resize
Reference to a DLL on the network Insert Record in DataContext without upgrading the database Context Menus combobox compiled on visual studio 2003 on windows XP, want to install on windows 7, error Can anyone recommend a print contol library please? Configure Properties of Windows User (Terminal Server Eviroment) issue of assigning a double variable in .net. Can be done? |
|||||||||||||||||||||||