Common Environment Object Model: getting the path to the cpp file a certain class is implemented in

From: Flaviu Matan (flazoon_at_nospam.nospam)
Date: 01/23/05


Date: Sun, 23 Jan 2005 19:45:40 +0200

Say we have a CodeClass object and call AddFunction() on it. Among other
parameters, AddFunction() requests a file path for the new function to be
placed. I noticed that if the *.cpp file for that class is passed to
CodeClass::AddFunction(), the call will end up with the function declaration
in the header file for that class and the implementation in the cpp file. If
the header file is passed, then both declaration and implementation will be
placed in the header file.

My question is how do one gets the path to the *.cpp file for a given class
when the following are known: CodeClass (for the class we want the cpp path
for) and the ProjectItem coresponding to the header file in which the class
is declared.

P.S if there is any other way to add a function to a certain class where the
function declaration will be in the header and the implementation in the cpp
file in some other way than the one mentioned above, please let me know.

Thanks in advance,
Flaviu



Relevant Pages

  • Re: Internal Complier Error in VC++ 1.52
    ... > working on an existing code base where the no of lines is around 100,000, ... > function declaration for an existing class in a header file and function ... > implementation in the .cpp file i am getting an error as given below ...
    (microsoft.public.vc.mfc)
  • Re: Novice - Advice required
    ... > a seperate .cpp file (or header file?) and then whenever I want to ... int XYX::doTask ...
    (microsoft.public.vc.language)
  • Re: C++ header file
    ... Why not just have 1 CPP file and include the CPP file instead of ... In Java, there is no header file, each object is .java file. ... Separation of declaration and definition is very practical thing. ... It is sufficient to see only function's declaration in order to successfully compile a code that calls it. ...
    (microsoft.public.vc.language)
  • Re: Importing a type library into unmanaged code with /clr switch - linker errors
    ... I made some progress by just enabling /clr on the module (cpp file) ... but when I add managed code into the header file like: ... I get the compiler error: ...
    (microsoft.public.dotnet.languages.vc)
  • Re: call c++ function from c
    ... header file from the cpp file. ... In the header file the function is ... that lie to get a job, then dog it for as long as they can with a constant ... actually ever writing any type of useful software. ...
    (comp.lang.c)

Loading