473,394 Members | 1,718 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

2 objects with same name

Hi,

I have a System.Windows.Forms.Application and a MapPoint.Application. How
tell the compiler that if I type: Application, that I mean
System.Windows.Forms.Application ?

Of course I can declare a var for it but I wonder if there are other ways ?

--
rgds, Wilfried
http://www.mestdagh.biz
Nov 16 '05 #1
5 1241
>I have a System.Windows.Forms.Application and a MapPoint.Application. How
tell the compiler that if I type: Application, that I mean
System.Windows.Forms.Application ?


Include

using System.Windows.Forms;

and remove any

using MapPoint;

statements from the file.


Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 16 '05 #2
There are two ways as far as I know.

1. You can have 'using' directive for one of the namespaces and use fully
qualified names for the other.

2. You can shorten the name space path like that:

I think that syntax is as follows:

using Windows.Forms WF;
using MapPoint;

then you can refer to MapPoint:

Application app1;

and to Windows.Forms:

WF.Application app2;


"Wilfried Mestdagh" wrote:
Hi,

I have a System.Windows.Forms.Application and a MapPoint.Application. How
tell the compiler that if I type: Application, that I mean
System.Windows.Forms.Application ?

Of course I can declare a var for it but I wonder if there are other ways ?

--
rgds, Wilfried
http://www.mestdagh.biz

Nov 16 '05 #3
> using Windows.Forms WF;

unfortionally this dont works in my IDE. I'm using C#2005 beta, so probably
the reason :( Other ways ? (precide typing the whole namespace for one of
the 2)
Nov 16 '05 #4
> > using Windows.Forms WF;

unfortionally this dont works in my IDE. I'm using C#2005 beta, so probably the reason :( Other ways ? (precide typing the whole namespace for one of the 2)


no the correct syntax is

using WF = System.Windows.Forms;

thats why is didn't work for you.
Nov 16 '05 #5
yes this works :) thanks

"cody" wrote:
using Windows.Forms WF;


unfortionally this dont works in my IDE. I'm using C#2005 beta, so

probably
the reason :( Other ways ? (precide typing the whole namespace for one

of
the 2)


no the correct syntax is

using WF = System.Windows.Forms;

thats why is didn't work for you.

Nov 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

115
by: junky_fellow | last post by:
What is a C object ? If i have some function "func()" in my C program, then can i say that "func()" is a C object ? or if i have some function pointer (ptr) which contains the address of...
14
by: vince | last post by:
Can I add (append) to an xml file that already contains a serialized object, and be able to deserialize to either or both objects from the same file...??? How is this done...?? thanks, vince
0
by: Nashat Wanly | last post by:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaskdr/html/askgui06032003.asp Don't Lock Type Objects! Why Lock(typeof(ClassName)) or SyncLock GetType(ClassName) Is Bad Rico...
38
by: Radi Radichev | last post by:
Hi! I'm making a database application and i heard from a friend that it is more proffecional and easy to do this with bussines objects. Can anyone tell me where i can find more info on bussines...
7
by: Jay Douglas | last post by:
In C# 2.0 I need to compare instances of an object to see if they are equal based on an id property. The object properties are class Cat { int CatId; string CatName; }
161
by: KraftDiner | last post by:
I was under the assumption that everything in python was a refrence... so if I code this: lst = for i in lst: if i==2: i = 4 print lst I though the contents of lst would be modified.....
14
by: Jess | last post by:
Hello, I learned that there are five kinds of static objects, namely 1. global objects 2. object defined in namespace scope 3. object declared static instead classes 4. objects declared...
16
by: Wayne | last post by:
I've read that one method of repairing a misbehaving database is to save all database objects as text and then rebuild them from the text files. I've used the following code posted by Lyle...
23
by: raylopez99 | last post by:
A quick sanity check, and I think I am correct, but just to make sure: if you have a bunch of objects that are very much like one another you can uniquely track them simply by using an ArrayList...
2
by: BobLewiston | last post by:
The concept of delegates (references to methods) per se is new to me (although I used function pointers in C years ago), and although the literature acknowledges that there are significant...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.