Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

Getting the file path

<< < (2/2)

oBFusCATed:
What object have you used as this project or a target?

threeS:
We don't really know what you mean but we are creating a plugin.  :)

threeS:
After a lot of trials and errors, we derive on these one:

--- Quote ---wxString activetarget = Manager::Get()->GetProjectManager()->GetActiveProject()->GetActiveBuildTarget();

    wxString outputfile = Manager::Get()->GetProjectManager()->GetActiveProject()->GetBuildTarget(activetarget)->GetOutputFilename();
    wxString basepath = Manager::Get()->GetProjectManager()->GetActiveProject()->GetBasePath();
    wxString executable = basepath  + outputfile;
    executable.replace(executable.find(_(".")), 4,_(".cpp"));

--- End quote ---

and we successfully get what we're looking for, getting the
--- Quote --- /file/project/location/file.cpp
--- End quote ---
.
thanks a lot  :)

oBFusCATed:
I don't know what project you have loaded, but this is the output for the following script run when the codeblocks-unix.cbp project is open:

--- Code: ---> print(GetProjectManager().GetActiveProject().GetBuildTarget(_T("src")).GetOutputFilename())
devel/codeblocks

--- End code ---

Have you search the code of C::B to see how GetOutputFilename is used?

Navigation

[0] Message Index

[*] Previous page

Go to full version