473,396 Members | 1,996 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,396 software developers and data experts.

Use other class member function in same namespace

Hi,

I have 2 questions:

How to call a class member function from another class and these 2 classes
are in the same namespace?

Also, how to use another project's dialog box and this 2 projects are in the
same VS.NET solution?

Thanks for any help,

CT
Nov 13 '05 #1
2 10739
Hi Chi,

1: How to call a class member function from another class and these 2
classes are in the same namespace?

You can call a class's member if this member is declared as public static,
if they are in the same namespace, then you do not have to include a "using"
directive or fully quilify it. If the method is declared only as "public"
then it's a method instance and you will need to call it using an instance
of that class.

2: Also, how to use another project's dialog box and this 2 projects are in
the same VS.NET solution?

Well that depend, the second project must be of type Class Library to be
included in the first project, if the sboth projects are of type "Windows
Project" , then AFAIK there is not way of doing so, at least directly in the
IDE, you could use reflection to load the assembly and instantiate the class
at runtime, but again, I do not know for sure that this is possible, I will
search for it.
Please provide more info regarding the projects types.

Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Chi Tang" <ch********@hotmail.com> wrote in message
news:eD**************@TK2MSFTNGP11.phx.gbl...
Hi,

I have 2 questions:

How to call a class member function from another class and these 2 classes
are in the same namespace?

Also, how to use another project's dialog box and this 2 projects are in the same VS.NET solution?

Thanks for any help,

CT

Nov 13 '05 #2
Thanks for the reply. For the 2nd question boht projects are windows
application so I think I should put some common function into a class
library and used by both projects. I just try to use some dialog box
resource (or forms) in both projects. Anyway, really appreciate all
help...

CT

"Ignacio Machin" <ignacio.machin AT dot.state.fl.us> wrote in message
news:#x**************@TK2MSFTNGP12.phx.gbl...
Hi Chi,

1: How to call a class member function from another class and these 2
classes are in the same namespace?

You can call a class's member if this member is declared as public static,
if they are in the same namespace, then you do not have to include a "using" directive or fully quilify it. If the method is declared only as "public"
then it's a method instance and you will need to call it using an instance
of that class.

2: Also, how to use another project's dialog box and this 2 projects are in the same VS.NET solution?

Well that depend, the second project must be of type Class Library to be
included in the first project, if the sboth projects are of type "Windows
Project" , then AFAIK there is not way of doing so, at least directly in the IDE, you could use reflection to load the assembly and instantiate the class at runtime, but again, I do not know for sure that this is possible, I will search for it.
Please provide more info regarding the projects types.

Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Chi Tang" <ch********@hotmail.com> wrote in message
news:eD**************@TK2MSFTNGP11.phx.gbl...
Hi,

I have 2 questions:

How to call a class member function from another class and these 2 classes are in the same namespace?

Also, how to use another project's dialog box and this 2 projects are in

the
same VS.NET solution?

Thanks for any help,

CT


Nov 13 '05 #3

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

Similar topics

3
by: Robert | last post by:
Python doesn't know the class of a method when container not direct class attribute: >>> class X: .... def f():pass .... g=f .... l= .... >>> X.g <unbound method X.f>
3
by: David Komanek | last post by:
Hi all, I am trying to learn more about how to use g++/Cygwin to produce dll files on WinXP. And I have a problem which at the first look seems to be an obvious dll-export problem, but I don't...
9
by: Ian | last post by:
Can it be done? If so, what's the syntax. For example a full specialisation, template <typename T> struct X { template <typename C> void foo( C a ) {} };
13
by: Duron | last post by:
I created a new folder using VS.NET 2003. Then I created a new web form under that folder, say, \Member\Default.aspx. However, even if I didn't do anything to that page, a run-time error appears...
5
by: Marcin Gil | last post by:
Hi! I have the code like this (obvious things like ctor/dtor removed) typedef struct _NODE { int val; int index; } Node;
1
davydany
by: davydany | last post by:
Hey guys...a n00b Here for this site. I'm making a sequence class for my C++ class. And The thing is in the array that I have, lets say i put in {13,17,38,18}, when i see the current values for the...
2
by: Barry | last post by:
The following code compiles with VC8 but fails to compiles with Comeau online, I locate the standard here: An explicit specialization of any of the following:
5
by: tshad | last post by:
I have the following class in my VS 2008 project that has a namespace of MyFunctions. ********************************* Imports System Imports System.Text.RegularExpressions Namespace...
6
by: Gaijinco | last post by:
I'm trying to do a template class Node. My node.hpp is: #ifndef _NODE_HPP_ #define _NODE_HPP_ namespace com { namespace mnya { namespace carlos { template <typename T>
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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.