PC Review


Reply
Thread Tools Rate Thread

Acessing DLL members which differ only in Case from VB.net

 
 
Bob S
Guest
Posts: n/a
 
      25th Mar 2010
I am accessing the MoveableGraphicsLibrary which was suggested in a
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; }
...
}

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

 
Reply With Quote
 
 
 
 
Armin Zingler
Guest
Posts: n/a
 
      25th Mar 2010
Am 25.03.2010 21:41, schrieb Bob S:
> I am accessing the MoveableGraphicsLibrary which was suggested in a
> 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; }
> ...
> }
> [...]


"Names cannot differ by case alone." Taken from (bottom most bold line):

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
 
Reply With Quote
 
Patrice
Guest
Posts: n/a
 
      26th Mar 2010
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/tutor...ct-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




 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't find short cut for changing case ... upper case .... lower case JERRY Microsoft Word New Users 7 23rd Aug 2007 05:29 PM
Distribution list that members don't view the other members email. =?Utf-8?B?Z3RvM3Jk?= Microsoft Outlook Discussion 2 26th Apr 2005 04:59 PM
Distribution list that members don't view the other members email. =?Utf-8?B?R1RPLUlJSQ==?= Microsoft Outlook Discussion 0 26th Apr 2005 04:38 PM
Process.StartInfo.EnvironmentVariables problem when there are twoenv variables that differ only in letter case Szymon Madejczyk Microsoft Dot NET 3 14th Jan 2005 10:33 AM
Possible Version mismatch. Type System.Collections.Comparer has 1 members, number of members deserialized is 0 Matt G Microsoft Dot NET Framework 0 8th Dec 2003 05:45 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:28 PM.