Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / October 2007

Tip: Looking for answers? Try searching our database.

.NET 2.0 and VB

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chuck Douglas - 18 Oct 2007 20:09 GMT
I have a VB assembly which contains a web control
(System.Web.UI.WebControls).  I am using Visual Studio 2005 and I am
compiling with the .NET 2.0 compiler (VC++ 8.0).  This project has a
reference to a C# assemby, which has a netmodule linked into it.  This other
managed C++ code contains a type called UNIT.  My VB code contains a line,
such as below, which makes reference to the Width property on
System.Web.UI.WebControls.WebControl, which returns a type called
System.Web.UI.WebControls.Unit.  However, since VB is not case sensitive, it
gives me an error at compile time, saying that type UNIT is not accessible
because it is private (for the line below).  It seems to be finding the UNIT
type in the netmodule, before the Unit type in System.Web.UI.WebControls.

Public Overrides Property Width() As Unit

Is there any way to make VB look in a certain order for the references?  Or,
can I suppress the UNIT type in my managed C++ code, using some directive
such as a pragma?

Any help would be appreciated.

Thanks
Chuck
Phill W. - 19 Oct 2007 12:37 GMT
> since VB is not case sensitive, it gives me an error at compile time,
> saying that type UNIT is not accessible because it is private
> (for the line below).  It seems to be finding the UNIT type in the
> netmodule, before the Unit type in System.Web.UI.WebControls.

> Public Overrides Property Width() As Unit
>
> Is there any way to make VB look in a certain order for the references?  

Tell VB which class you /really/ mean by fully-qualifying the Type you
want, as in

   Public Overrides Property Width() As System.Web.UI.WebControls.Unit

If that seems a bit cumbersome, try "aliasing" it with an Import:

Imports SWC=System.Web.UI.WebControls

Public Overrides Property Width() As SWC.Unit

HTH,
   Phill  W.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.