473,626 Members | 3,031 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 10752
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********@hot mail.com> wrote in message
news:eD******** ******@TK2MSFTN GP11.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.mach in AT dot.state.fl.us > wrote in message
news:#x******** ******@TK2MSFTN GP12.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********@hot mail.com> wrote in message
news:eD******** ******@TK2MSFTN GP11.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
3044
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
4459
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 think this is really the issue. Here is a description of my problem. MathLibrary.dll: - SpaceTimeVector (uses various stuff from this dll)
9
1961
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
1850
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 when I try to run it -- Can not load class MySite._Default. I am using VB to write codes. Does anyone have any idea why this problem happens? Thanks!
5
5478
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
3025
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 array data from 0 to3, I get this {13, JUNK VALUE, 17,38, 18} and JUNK VALUE is like 1.8e831 or something like that. This happens when I use the attach() function and use the current() function to display the values at data I really want to...
2
7689
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
1627
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 MyFunctions Public Class BitHandling
6
391
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
8701
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8637
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8364
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7192
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6122
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4196
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2623
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.