|
Is there any way to "tweak" the output of the classwizard? What I want to do is add some Doxygen comments on "new class", "add member function" and so on. For example, adding a new function does something like this (header):
void myFunc(int hello);
while I would prefer this:
void myFunc(int hello);
Right now I am using a very ugly macro, that does not work very well. Can this be done in a simple way?
Thanks
/moliate
|
|
|
|
|
You should consider beatifying your macro, because modifying the class wizard to do your bidding won’t work. I tried doing something similar a few years back, and I ran into several problems:
1) The resource used to write the function implementation is the same one used to write the declaration. Meaning that you would get duplicates of any additions you make, one in the *.h file and the same in the *.cpp file. Also the one added to the *.h will have to be manually removed, as it messes with the class wizards parser.
2) The resource ‘script’ parser is not very advanced. It simply grabs the stuff out of the reswource string line-by-line without doing any validation. Take for example the following WM_SIZE handler resource;
1: OnSize
2: void
3: UINT nType, int cx, int cy
4: %1::%2(nType, cx, cy);
5:
6: %4 Add your message handler code here
Line 1 is used to name the handler, and as the display string in the class wizard.
Line 2 is the return type
Line 3 is the handler’s parameter list
Line 4 generates code that calls the handler’s base class
Line 5 adds a blank line to the code
Line 6 is that stupid comment you delete instantly
So, you could add your comment into line 2, but you’d have to enter it all on the one line. Then once you used the class wizard to inserted it, you’d have to delete the comment out of the *.h (so that you don’t confuse the class wizard’s parser) and then format the comment in the *.cpp.
If your still interested in taking a look at all of this stuff just look for the MFCCLWZ.DLL file in your Visual Studio installation directory under “Common\MSDev98\Bin”. It’s all in there, under the "STRINGARRAY" resource type.
cheers,
-Ben
|
|
|
|
|
Thanks for the clarification on how mfcclwz.dll is organized. I have fired up ResHacker and started looking at it. You are probably right about it being simpler writing a better macro, but it is nice to get a better understanding on how the classwizard works!
Cheers
/moliate
|
|
|
|
|
I have a modal dialog, but I want to change it into a modaless one.
I must have some controls initilized in OnInitDialog().
...
m_pDC = m_pWnd->GetDC();
m_comboCtl.SetCurSel(0);
...
But modaless dialog can't reply to WM_INITDIALOG message.
How can I change them?
|
|
|
|
|
http://www.codeproject.com/useritems/gettingmodeless.asp
Nish
Yeah that's me down below
|
|
|
|
|
But I still have a question...
Where can I have my controls, like combo control, progress control, etc. initialized?
OnSize(), OnMove() seem not to be a right place.
|
|
|
|
|
You do all initialization in OnInitDialog.
Just like in the modal dialog.
Nish
Yeah that's me down below
|
|
|
|
|
Thank you!
Just so easy!!
Windows98 SE, VC++ 6.0 SP5
|
|
|
|
|
Hi,
I have an edit control & a tooltip window(It is a owner drawn window derived from CWnd).I do display the tooltipwnd when the moves is moved over the edit control.
I do show up the wnd usuing
SetWindowPos(&wndTop,pt.x-(Size.cx/2), rect.bottom,
Size.cx-10, Size.cy+6, SWP_SHOWWINDOW |SWP_NOACTIVATE);
Now the problem is suppose i will set the cursor at the end of editcontrol & move the mouse little bit.Now the cursor will set back to initial position.
Can anyone have any idea?
Neha
|
|
|
|
|
How to run the services MMC ?
|
|
|
|
|
There is something very strange about your head icon, adara. It says your CP ID is -1
It links to http://www.codeproject.com/script/profile/whos_who.asp?id=-1
Nish
Yeah that's me down below
|
|
|
|
|
thank you Nish , but what shell i do with that ?
any suggestions about the topic ?
|
|
|
|
|
I am awfully sorry Adara, but I do not have a clue about what you seem to want to know. I don't even know what an MMC is! I am guessing that it stands for Microsoft Message Center
Buster
Yeah that's me down below
|
|
|
|
|
I try to fix the link thing but no luck ..
MMC :Microsoft Management Console
Microsoft Management Console (MMC) hosts administrative tools that you can use to administer networks, computers, services, and other system components
(OS w2k & later)
|
|
|
|
|
Thanks bud. Now I at least know what it stands for
Nish
p.s. by the way your ID is okay now...
Yeah that's me down below
|
|
|
|
|
use ShellExecute to run C:\Windows\System32\services.msc
Naturally, you would use GetSystemDirectory to find the exact location.
--
David Wengier
TAC ad gone wrong: "Don't fool yourself, you're a bloody idiot."
Sonork ID: 100.14177 - Ch00k
|
|
|
|
|
David Wengier wrote:
Naturally, you would use GetSystemDirectory to find the exact location.
Not required.
ShellExecute(this->m_hWnd,"open","services.msc",
"","",SW_SHOW);
That will do.
It searches the default paths.
Nish
Yeah that's me down below
|
|
|
|
|
Nish [BusterBoy] wrote:
Not required
I would be embarrased to have gotten that wrong, except I dont program in C++ so ner :p
--
David Wengier
TAC ad gone wrong: "Don't fool yourself, you're a bloody idiot."
Sonork ID: 100.14177 - Ch00k
|
|
|
|
|
David Wengier wrote:
I would be embarrased to have gotten that wrong, except I dont program in C++
Actually it's me who should have gotten embarassed cause I didn't know what adara meant by MMC till he told me
Nish
Yeah that's me down below
|
|
|
|
|
|
I am developing an ATL server that will run on several remote systems. How can I pick a server to connect to at run time? I know that I can use DCOM configuration to specify the implementation location before running my application but I want to allow a user to select from a list of computers or IP address that house the server while the client is running. How do I tell ATL where the server is located at run time?
Thanks.
|
|
|
|
|
Take a look at the COSERVERINFO structure in CoCreateInstanceEx.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
What would I have to do to use high color bitmaps in a CToolbar...?
I created a app with the wiz and tried changing the bitmap to a high color, but because CToolbar uses the 192,192,192 RGB color of 16 color toolbar bitmaps as a substitution color i'm assuming high colors won't work...?
Cuz well they didn't when I tried, unless i'm doing something wrong...?
I'm thinking I should just design a toolbar from scratch (CControlbar) and handle the loading of the bitmaps and all that stuff.
Should I pick apart CToolbar in MFC or does anyone know really cool toolbars I can use as example.
Anybody suggestions...?
Thanx!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
You can use CToolBarCtrl::SetHotImageList and CToolBarCtrl::SetImageList to set the double color 24 bit toolbars
Nish
Yeah that's me down below
|
|
|
|
|
I just figured that out.
However i'm in need of something to do so I figure i'll tackle a custom 24 bit toolbar just for the heck of it.
Thanx Nish.
Is that your Johnny Denver...fever...??? what was it...?
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|