Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3457940
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:55:18+00:00 2026-05-18T09:55:18+00:00

I have a class, lets say CAppPath which has a static method: public: static

  • 0

I have a class, lets say CAppPath which has a static method:

public:
    static CString GetAppPath();

and in CAppPath.cpp it’s defined as:

CString CAppPath::GetAppPath()
{

    return "C:\..\MypAth";
}

Now I have another class CXMLHandler, and I have included CAppPath.h in it. But how do I call the GetAppPath() method? I’ve tried:

#include "CAppPath.h"
void CXMLHandler::MyMethod
{
CNDSClientDlg->GetAppPath();
}

but it doesn’t work. How should I access this method? Since it is a static method, do I need to create a object of the class or should I make the class itself static?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T09:55:19+00:00Added an answer on May 18, 2026 at 9:55 am

    You only need to use the scope resolution operator :: to qualify the method with the name of the class that exposes it:

    CString appPath = CAppPath::GetAppPath();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

lets say I have class : foo { public: static const foo Invalidfoo; foo();
Lets say you have a class SomeClass which has its own implementation of toString()
Lets say I have: class Zebra{ public static function action(){ print 'I was called
Lets say I have a class, which implements a generic interface public interface IItem
Lets say I have class C which has attribute a . What is the
I have FrameChangeAnimation class which takes multiple spritesheets and duration. So lets say I
Lets say I have a LunchBox class with a property for FreezerPack that has
Lets say I have the following class: public class Provider { ... public sealed
Lets say I have the code: class NoneDict(dict): def __getitem__(self, name): try: return super(NoneDict,
Lets say I have a class like this in class1.vb: Public Class my_class Public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.