|
|
Comments and Discussions
|
|
 |

|
Thanks for your article about doxygen. I started with version 1.5.6 in 2008 with VC++6 professional and I'm using now version 1.8.2 as tool in visual studio 2010. I have installed doxygen, grapviz, fart and html help workshop. In the external tools I call a cmd-file to create submaps in my project add add the doxygen-file, mainpage-file and project-logo. Fart replaces default text with the TargetName in both files. It goes to far to show all the details, but setup the documentation for a new project is done in just two mouse clicks!
I have these external tool entries used:
1. Create DoxyDoc (html)
2. Create DoxyDoc (chm)
3. View DoxyDoc (html)
4. View DoxyDoc (chm)
5. Clean-up DoxyDoc (html)
6. Add DocyDoc Files into ProjectDir
Here you see the entry "Add DocyDoc Files into ProjectDir":
Tools->External Tools->Add
Title: Add DocyDoc Files into ProjectDir
Command:%systemroot%\system32\cmd.exe
Arguments: /C call "%homedrive%%homepath%Visual Studio 2010\doxydoc\addDoxyDoc.cmd" $(ProjectDir) $(TargetName)
Initial directory: $(ProjectDir)
Use Output window [v]
Here below is my addDoxyDoc.cmd:
@echo off
setlocal
:: AddDoxyDoc.cmd
:: call with: "%homedrive%%homepath%Visual Studio 2010\doxydoc\AddDoxyDoc.cmd" $(ProjectDir) $(TargetName)
if {%1}=={} (
echo ProjectDir parameter is missing
goto :end
)
if {%2}=={} (
echo TargetName parameter is missing
goto :end
)
set "SRC=%~dp0"
set "DST=%~dp1"
set "TARGET_NAME=%~2"
set "MAP1=__doxydoc__\"
set "MAP2=__handbook__\"
if not exist "%DST%%MAP1%" ( md "%DST%%MAP1%" && (echo submap "%MAP1%" is created))
if not exist "%DST%%MAP2%" ( md "%DST%%MAP2%" && (echo submap "%MAP2%" is created))
:: don't overwrite the existing files
if not exist "%DST%%MAP1%default.doxygen" (
copy "%SRC%default.doxygen" "%DST%%MAP1%" >NUL && (
set "P1=PROJECT_NAME ="
set "P2=CHM_FILE ="
fart -w "%DST%%MAP1%default.doxygen" "%P1% \"NO NAME\"" "%P1% \"%TARGET_NAME%\""
fart -w "%DST%%MAP1%default.doxygen" "%P2% \"..\..\__handbook__\doc.chm\"" "%P2% \"..\..\__handbook__\%TARGET_NAME%Doc.chm\""
echo default.doxygen is added to project
))
if not exist "%DST%%MAP1%ProjectLogo.bmp" (
copy "%SRC%ProjectLogo.bmp" "%DST%%MAP1%" >NUL && (
echo ProjectLogo.bmp is added to "%MAP1%"
))
if not exist "%DST%%MAP1%create-chm.cmd" (
copy "%SRC%create-chm.cmd" "%DST%%MAP1%" >NUL && (
echo create-chm.cmd is added to "%MAP1%"
))
if not exist "%DST%%MAP1%cleanup.cmd" (
copy "%SRC%cleanup.cmd" "%DST%%MAP1%" >NUL && (
echo cleanup.cmd is added to "%MAP1%"
))
if not exist "%DST%%MAP1%mainpage.txt" (
copy "%SRC%mainpage.txt" "%DST%%MAP1%" >NUL && (
fart -w "%DST%%MAP1%mainpage.txt" "[NO NAME]" "%TARGET_NAME%"
echo mainpage.txt is added to project
))
:: edit default.doxygen
"%DST%%MAP1%default.doxygen"
echo AddDoxyDoc is ready!
:end
endlocal
Here you see the entry "Create DoxyDoc (html)":
Tools->External Tools->Add
Title: Create DoxyDoc (html)
Command:C:\Program Files (x86)\doxygen\bin\doxygen.exe
Arguments: $(ProjectDir)__doxydoc__\default.doxygen
Initial directory: $(ProjectDir)
Use Output window [v]
The file default.doxygen is generated by doxywizard.exe and I have set the project name to "NO NAME".
This project name is changed to the real project name by fart which is called in addDoxyDoc.cmd.
modified 23 Oct '12 - 4:34.
|
|
|
|

|
It is better to include doxywizard because this is the tool for editing doxygen config.
Also a better way to running doxygen (can abort doxygen).
doxywizard.exe "path to your doxyfile"
Unfortunately, this only included in installer version
Also the another important is including doxygen help since you will want to look at this to tweak your documentation
No one can prevent me to learn something
|
|
|
|

|
Back when I wrote that article, doxywizard
doxywizard has become "a bit more bearable" since I wrote that article. Back then, it was more like a less convenient way to edit the file.
|
|
|
|

|
After "Add DocyDoc Files into ProjectDir" I have in my project the map __doxydoc__ where is default.doxygen.
With "Open With" it is set default to doxywizard.exe.
So, if I double click on default.doxygen in the Solution Explorer, it is opened with doxywizard.exe.
|
|
|
|

|
First time user of doxygen.
Found your tut informative and useful. (Canada) Tx.
|
|
|
|
|

|
I use doxigen as an external tool and it works fine (1.5.8)
I have a C++ MFC VC6.0 project in witch there is something like this:
static DWORD WINAPI ThreadCalibN(LPVOID arg){...}
and in the CMyClass::OnOK() code I execute this Line:
threadCalibN=CreateThread(NULL,0,ThreadCalibN,(void*)this,0,&id_threadCalibN);
How can I document the ThreadCalibN code ?
I am able to document the class but not the function ThreadCalibN
I Tried with something like:
///////////////////////////////////////////////////////////////////////////////
/*! \file MyClass.cpp
* \version 2.2
* \date 06/2009
* \fn static DWORD WINAPI ThreadCalibN(LPVOID arg)
* \brief external thread
*/
but it does not include anything.
thank you
|
|
|
|

|
I am not sure about the \file \version \date elements in the comment block.
Are you trying to put the documentaiton into another file than the fuinction itself? (that's what \fn is for)
I've got that working a few times, but it may be a bit brittle. Might be some problems with the WINAPI etc. macros (try for a simple funciton if it works there).
otherwise, if you put this directly above the method
- remove the \fn
- try the "build" options (though I'd assume it should always be exported with EXPORT_ALL checked)
Personally, I love the idea that Raymond spends his nights posting bad regexs to mailing lists under the pseudonym of Jane Smith. He'd be like a super hero, only more nerdy and less useful. [Trevel] | FoldWithUs! | sighist | µLaunch - program launcher for server core and hyper-v server
|
|
|
|

|
Thanks for the article. I was using doxygen as a separate tool; it's good to have it integrated. I have two questions:
1. I'm using VS2005 (and 8 and 10) and would like to use VS as the browser for the documents rather than IE. How do I set this up?
2. I keep getting "output races" where lines like this show up:
Creating members for teC:/Documents and Settings/Steve/My Documents/Visual Studio 2005/Projects/OSLOske/OSLOske/apmanguilib/ammwsfnt.c(46): Warning: Compound AMgbdat is not documented.
Is there any way to avoid this? Thanks.
|
|
|
|
|

|
Excellent article and some really useful tools for making it easy to produce good documentation, much appreciated.
dba
|
|
|
|

|
Hi peter, can you tell me how can I find C#/ASP.NET related jobs in Germany. I am very interested in moving there. any ideas/hints are welcome
nabeelkhan132 at gmail dot com
|
|
|
|

|
I have a project with a library in another directory (projects\app and projects\lib), any idea how to link in the second directory automatically?
Great BTW, 5.
|
|
|
|

|
If you have them in one solution, and the solution file resides in project\, you can make all the paths in the command relative to the solution.
Alternatively, if you have your solution in the \project\app directory, you can add ..\lib\ to the search directories in the doxygen file.
Third chance, there are some tools that merge .CHM files.
Good luck
|
|
|
|

|
Very nice article and the installation worked like a charm.
I appreciate it!
|
|
|
|

|
Hi!
I work with cross-platform code, and i guess /// - comment block probably will not pass gcc compilation.
If i put /// - comment block
within #ifdef _MSC_VER
#endif
would doxygen still recognize a comment block?
Thanks.
There is nothing impossible.
|
|
|
|

|
Why not? As per standard, everything on the line after the // is ignored, includign the third /
We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP blog: TDD - the Aha! | Linkify!| FoldWithUs! | sighist
|
|
|
|

|
Right, i was thinking about C standart /* */.
Thanks.
There is nothing impossible.
|
|
|
|

|
Can Doxygen be used to detect self referential (circular) #includes?
|
|
|
|

|
Thanks for your brief tutorial of doxygen.
I notice that your default.doxygen file is for the 1.3-rc version.
When generatating a new default.doxygen I overlooked the option WARN_FORMAT which becomes "$file:$line: $text".
To make the warning clickable in the output window to open the source, change it to "$file($line): $text" like you did.
|
|
|
|

|
This tutorial was what got me to actually try and use Doxygen
because it convinced me it would be worth the effort invested to make it go.
|
|
|
|

|
I compile my chm files fine on Windows, except when I move the *.chm file to another location I get the following: "The window name "main" passed to HH_GET_WIN_TYPE has not been specified." Why does this happen?
|
|
|
|

|
I discovered why this happens. On the HTML tab on the DoxyWizard I had se the "GENERATE_CHI" checkbox. Turning this off includes the indexing information in with the generated *.chm file. I hope this helps someone else who might have the same problem.
|
|
|
|

|
It took me a little while, but I finally got the doxygen warning messages to show up in the "Task List" in VS.NET 2003 so I could double-click them (I could double-click them in the "Output" pane, but it's nicer to be able to do it from the task list along with all the compilation errors and warnings ).
I set WARN_FORMAT to "$file($line) : warning : $text". The quotes are needed, because you lose the spaces without them, which causes VS.NET to ignore the messages. Here's what I had in my doxyfile:
WARN_FORMAT = "$file($line) : warning : $text"
We've found doxygen very useful at my job -- I also like the ability to generate PDF's (if you install Ghostscript and a LaTeX distribution and maybe GraphViz).
Phillip
|
|
|
|

|
HI,
I have test your solution and it does not work. I can double click in output view and get the corresponding line but no task is added to "Task List". Does I missed some configuration point?
Thanks in advance.
Olivier
|
|
|
|

|
I just tested this with Visual Studio .NET 2003, and it worked fine for me. It's been a while since I wrote it, but I believe that the spaces had to be exactly right or it would be ignored. Here's what I have in the configuration file where it worked just now:
WARN_FORMAT = "$file($line) : warning : $text"
I get lines like this in my output window:
foo.h(93) : warning : Warning: Compound Foo not documented.
I also just tested with VS.NET 2005, and it also added them to the task list (once I clicked on the "Warnings" button to have it show warnings as well as errors).
|
|
|
|

|
I have respected exactly your WARN_FORMAT and it still not work. I am using Visual Studio 7.1 and doxygen 1.5.3. Here is an example output I have in the Output view
D:/DEV/DevBroadcast_VC7/P_SERVERS/P_Sapphire/sapphireserver/Processing/CSnmpAgent/SnmpAlarm.cpp(156) : warning : Warning: parameters of member CSnmpAlarm::AddToActiveTable are not (all) documented
but no line is added in task list.
Any Idea ?
|
|
|
|

|
I'm not sure what's going on. It looks like it's the same, but it's hard to tell with the word wrap. I think the important thing is the spaces around the colons. I can't find anything in the settings that looks like it would affect whether or not warnings are shown. Here's an example from my build that showed up in the task list: (I replaced the beginning of the path with "..." to make it shorter)
.../gil_png_opc_io_private.hpp(283) : warning : Warning: Compound detail::png_opc_writer is not documented.
I'm using VS.NET 2003, which is 7.1, as far as I know. I don't know what else to tell you. Sorry.
Phillip
|
|
|
|

|
Hello,
I dont' succeed working in VC7.
For doxygen I set the arguments as $(ProjectDir)\default.doxygen (without quotes)
and inititial directory as $(ProjectDir)
sometimes it works, sometimes it freezes
For view with IE7 I always got an url like
file://%22//C:\projets\essai\doxydoc\index.html witch obviously doesnt' work
If someone could help, thanks !
regards
JJC
|
|
|
|

|
The Wizard runs well. (it generates html output)
I Couldn't quite get it to work with Borland Builder 6, though. (No, I did not mean Builder 2006) Any Ideas?
The Graphical Diagrams do not seem to work?
Thanx for this 1 minute guide, though. It helped a lot...
paper, not paper
|
|
|
|

|
For the graphics, you need to install graphviz[^] separately - and specify it in the options.
If you have problems, I think the best way is to close your IDE, and then toy around with the settings using the doxygen wizard. (This can be a bit overwhelming, and some things have changed since I prepared the files for this article)
If it works with the wizard, but not from the IDE, you are close Just check the commands and especially the parameters you pass. I guess this is quite different from Visual Studio for you.
Good luck!
We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
Linkify! || Fold With Us! || sighist
|
|
|
|
|

|
How to dox e.g. the following code, espacially the inserted AFX_ parts? ///////////////////////////////////////////////////////////////////////////// // CAboutDlg dialog used for App About class CAboutDlg : public CDialog { public: CAboutDlg(); // Dialog Data //{{AFX_DATA(CAboutDlg) enum { IDD = IDD_ABOUTBOX }; //}}AFX_DATA // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CAboutDlg) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: //{{AFX_MSG(CAboutDlg) //}}AFX_MSG DECLARE_MESSAGE_MAP() }; TIA "doxygen runs in 10 min - but how to use?"-Friedhelm Schuetz
|
|
|
|

|
Hi,
I'm currently on the road, so I can't help zou much.
Generally, doxygen doesn't work quite well with the AFX_ stuff (well enough to ignore this, at least)
I never tried to doxy-commented (doxymented?) MFC-specific macros - Help is good enough for them For the handler methods, I typically doxyment the implementation part only, though I rarely need to: normally I use a "condensed single-class MVC", so the message handlers themselves are merely forwarders to actual methods, which can be documented normally.
Also, doxygen supports separating entity documentatyion fom the entity - i.e. you can put a doxygen comment anywhere you want, and mark it as (e.g.) "belongs to CFunnyDialog::StopJoking". see doxygen docs for info.
Of course, you have a harder question lurking: What needs to be documented, what not?
Pecularities of a library IMO need no documentation - as the poor guy who has to work with it should know these.
Class Properties - like Dyncreatable - should be documented with the class itself (and/or referenced in the constructor docs, if any)
For the virtual function/message handler declarations: The wizard respects on-lline comments, and IIRC doxygen can extract them. So you technically could turn the // DDX/DDV support into a ///< DDX/DDV support - but that doesn't help anyone, does it?
OK, maybe I should think about a followup article - "How to comment" code.
Friedhelm Schuetz wrote: "doxygen runs in 10 min - but how to use?"-Friedhelm Schuetz
correctly, of course
We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
Linkify! || Fold With Us! || sighist
|
|
|
|

|
Say you have a function that you want to document in the class but isnt coded in the class definition. For example...I am using MSChart and which is a class created from the Visual Studios C++ 6.0 and it has a bunch of functions. It is missing the event functions and I would like to document them with DOxygen. How do I accomplish this?
Chris
|
|
|
|

|
You can document certain entities separate from their code (I usually havea separate "doxygen only" source file that contains no code, just additional doxygen comments)
See here[^] and scroll down to "Documentation at other places".
I don't know if you can document an individual member function this way, or a function that is not available as source. But it's worth a try.
Some of us walk the memory lane, others plummet into a rabbit hole
Tree in C# || Fold With Us! || sighist
|
|
|
|

|
Thanks for the response. I dont think you understand my question or I didnt fully understand your response. Say there is a function called "void function1()" that is NOT coded in any of my classes but it exists. This "function1()" is an event that exists for the MSChart class developed by Microsoft Visual Studios. I would like to document it because there is no formal documentation in C++ about the MSChart Class (It only exists in VB). How do I do this? I have tried just putting a function definition in a class where the function doesn't exist and no output for that function is created.....I tried putting the following in a class where there is no "read" function and it doesn't put a read function in the DOxygen output even through I declared that I wanted it in the DOxygen output.
/*! \fn int read(int fd,char *buf,size_t count)
\brief Read bytes from a file descriptor.
\param fd The descriptor to read from.
\param buf The buffer to read into.
\param count The number of bytes to read.
*/
Chris
|
|
|
|

|
I have a code here, i want doxygen understand PSmileys have list of Smiley and show on
diagram as Collaboration diagram or Inheritance diagram
/**
* @class PSmileys
* @brief
* List of smileys.
*
* @author Duy Trinh
* @version 1.0.1
* @date 17 Feb 2006
*/
class PSmileys
{
public: // Define Child classes
/**
* @class PSmiley
* @brief
* Smiley.
*
* @author Duy Trinh
* @version 1.0.1
* @date 17 Feb 2006
*/
class PSmiley
{
public:
/**
* A constructor
*/
PSmiley();
/**
* A destructor.
*/
virtual ~PSmiley();
private:
};
public:
/**
* A constructor
*/
PSmileys();
/**
* A destructor.
*/
virtual ~PSmileys();
private:
CArray m_cSmileyList;
};
--------------------------
ERP VN: www.erpvn.net
|
|
|
|

|
Hello, I don't know how to make 'doxygen' to understand your list of elements, but I recomend you to use Graphviz for drawing the Collaboration diagram and Inheritance diagram in your project. It can be downloaded from: http://www.graphviz.org/[^] Good luck!
|
|
|
|

|
Ya, thanks.
I downloaded Graphviz, to integrate to Doxygen, but it dn't still understand the list as my above code.
With my above code, i think it have one - many relationship.
--------------------------
ERP VN: www.erpvn.net
|
|
|
|

|
Hi,
Nice article to get started !!! I just wanted to clarify a doubt...
Suppose I have 100s of files within my project and I change only the signature of one of the functions in a class, is there any way that doxygen can update the documentation for only this class/file or should I run doxygen for the whole project?
Thanks
Anand
|
|
|
|

|
I haven't seen such a feature. Maybe you ask the author of doxygen
[edit] But I found recent versions of doxygen quite fast (exceptthe .chm generation which is slowed down by the MS HTML Help compiler)
We say "get a life" to each other, disappointed or jokingly. What we forget, though, is that this is possibly the most destructive advice you can give to a geek.
boost your code || Fold With Us! || sighist
-- modified at 4:40 Saturday 14th January, 2006
|
|
|
|

|
Some reason i like looking at that xml ontop of my functions lol
|
|
|
|

|
Thanks or this great article, you have made using Doxygen straight forward and easy.
While trying this out I noticed I as missing some classes. Doxygen does not seem to handle class __declspec(dllexport) CClassName.
Have you been able to determne a fix for this?
|
|
|
|

|
I found the answer in the Doxygen manual. For those who are interested ...
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
PREDEFINED = __declspec(x)=
Will make things right. See the documentation for more complicated examples of using the Doxygen preprocessor.
Great tool, thanks for the article.
|
|
|
|

|
Hi,
I tried all steps to configure my vc++ tool menu and everything works fine!
The problem verifies when I try to process a workspace that is stored under C:\Documents and Settings\etc.....
And i observe this both to generate the document (doxygen.exe) and to view it (iexplore.exe)...
For processing phase i get the message
The error message is:
Error: configuration file C:\Documents not found!
Tool returned code: 1
For the exploring phase i get an error from Explorer.
It seems it's not able to understand C:\Documents and Settings.
It tries to look in C:\Documents%20and%20Settings\....
What's matter??
thanks
giusi
|
|
|
|

|
I think you forgot the quotes around the arguiments:
Add VC++ Tool: "doxygen"
- Add a new custom tool, called "DoxyGen", with the following parameters:
- Command: c:\program files\doxygen\bin\doxygen.exe (or where you installed it)
- Arguments: "$(WkspDir)\default.doxygen" (the config file - include the quotes!)
Pandoras Gift #44: Hope. The one that keeps you on suffering. aber.. "Wie gesagt, der Scheiss is' Therapie" boost your code || Fold With Us! || sighist | doxygen
|
|
|
|

|
Oooooooooops!!!!
It's Ok now!!!
Thanks
giusi
|
|
|
|

|
I'm by no means a professional programmer, but the project I'm working at the moment has grown somewhat fat, so I installed Doxygen and gave it a try. And it works really good! It's a kick to see all those classes nicely together, with all the colours and stuff...
|
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
Setting up doxygen, a free tool to document your code, in a few simple steps.
| Type | Article |
| Licence | CPOL |
| First Posted | 19 Jan 2003 |
| Views | 744,405 |
| Downloads | 5,636 |
| Bookmarked | 391 times |
|
|