By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,330 Members | 1,277 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,330 IT Pros & Developers. It's quick & easy.

Use other class member function in same namespace

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.