|
Another question would be: is
C:\Testfolder really a file, or is it a folder.
If I recall correctly (and it's been years since I looked) del will not delete folders - you would need to use rd instead (remove directory) and the folder would have to be empty. Of course you could empty the folder with
"del /S /Q /f c:\\testfolder\*.*"
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
The current program I'm working on has a requirement for the GUI and functionality code to be in seperate classes. So far I've managed to split this functionality up however I now need to add messaging into it so that when the user clicks a button on the GUI the functionality class is informed and performs the appropriate action.
I've found the following example on this site, http://www.codeproject.com/dialog/messagehandling3.asp, however it doesn't quite cover what I need.
Can anyone supply code snippets or links to articles which cover this?
cheers,
|
|
|
|
|
What do you need to do beyond calling a function/method in response to the appropriate window
messages?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
hi, thanks for your reply, I originally did put set/get methods in however I've now been told to completely seperate my functionality and gui classes so windows messaging seems to be one possibly solution to this (see my reply to my main question for a *hopefully* clearer explination)
Andy,
|
|
|
|
|
mcsherry wrote: I've now been told to completely seperate my functionality and gui classes
There's no way to completely separate them. You still have to make a call to the functionality
class method from the message handler so they are still tied to each other.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
ok, re-reading my original post I don't think I was very clear so here goes again!
FunctionalityClassA is responsible for starting GUIClassA. When the user clicks a button on GUIClassA I want FunctionalityClassA to be informed using the normal windows messaging. So in my FunctionalityClassA I assume I need to register an interest in the ON_BN_CLICKED messages. However this is the part I don't know how to do! Is it just a case of adding a BEGIN_MESSAGE_MAP block or is it more involved (my FunctionalityClassA is just a normal class).
Hopefully I've explained a bit more clearly and haven't dirtied the mud even more
thanks,
Andy
|
|
|
|
|
I do not understand the question.
When the user presses a button a message is sent to the GUI message handler and then it calls some other piece of code that does the processing. This is how all message handling is accomplished, more or less.
If you write an equation parser, it is separate from the GUI:
1) Enter equation. (GUI)
2) Press calculate button. (GUI)
3) Calculate message is passed to message handler. (GUI)
4) Message handler calls parser, which returns result. (NOT GUI)
5) The handler then prints, stores, or does something else with result.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
thanks for your reply, its the step 4 that I'm aunsure how to achieve. When I've added a message map block to my functionality class I get the following compilation error:
error C2440: 'static_cast' : cannot convert from 'void (__thiscall FunctionalityClassA::* )(void)' to 'AFX_PMSG'
my message map looks like this:
BEGIN_MESSAGE_MAP(FunctionalityClassA, FunctionalityClassA)
ON_BN_CLICKED(IDC_BUTTONA, OnBnClickedButtonA)
END_MESSAGE_MAP()
any ideas what I'm doing wrong?
|
|
|
|
|
Using VS2005 "Team Edition" (I assume this has VS2005 SP/1 installed as well)...
I'm seeing some REALLY bizarre behavior regarding COledateTime objects. It seems that despite the m_dt member having a valid non-zero value, the status is being returned as COleDateTime::null. This is breaking several thousand lines of code for me (ASSERTS everywhere where we use dates).
Has anyone else seen this?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Are you setting m_dt directly without setting m_status?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Honestly, I haven't gone through all 750,000 lines of the code to see.
At this point, I'm thinking I'm going to have to write a class derived from COleDateTime to fix it, and then do a global search/replace with the new class name.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: At this point, I'm thinking I'm going to have to write a class derived from COleDateTime to fix it, and then do a global search/replace with the new class name.
Ouch How about a global search for m_dt? Of course, if it isn't set directly anywhere then
error checking wasn't done when setting the value through a method/constructor.
I always wonder why the ATL/MFC classes have a rich set of methods and operators yet they make
all the member variables public, just daring us to use them incorrectly
Good luck!
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Well, this code is about 6 years old, and I'm not the original author. I'm reconsidering the derived class idea and just doing like you said and do a search for m_dt... What a pain in the ass.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I just did a search for m_dt in the project - it was found on 1525 lines... I'm in hell. :/
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: it was found on 1525 lines
Nice.
Did the older version of COleDateTime have less ASSERTs?
Have fun
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Before we switched to VS2005/SP1, there were *no* asserts.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: Before we switched to VS2005/SP1, there were *no* asserts.
Ouch - yeah....I just dug up old source code. There's just alot of "if (GetStatus() == valid)"
checks without the ASSERTs
Enjoy!
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Recently we upgraded from VS6.0 to VS2005. If you do a sizeof of a structure it looks like it pads to 8 byte. Structures that were returning 16 are now 24. Is this right or am I crazy?
Programmer
Glenn Earl Graham
Austin, TX
|
|
|
|
|
1) One (or more) of the members in the struct may be of an intrinsic type that changed size in newer runtime library.
2) Your byte alignment may need to be adjusted in the project's properties.
3) The sizeof function could have been changed by MS, but I doubt it.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
You should use WM_NEXTDLGCTL in a dialog instead of SetFocus().
::SendMessage(hDlg, WM_NEXTDLGCTL, (WPARAM)hwndControl, 1);
(CDialog::GotoDlgCtrl(CWnd* pWndCtrl) is the MFC wrapper)
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Mark Salsbery wrote: You should use WM_NEXTDLGCTL in a dialog instead of SetFocus().
But this still does not explain the "Selecting the edit box by clicking on it and then writing does not work." problem. Something is definitely awry here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: Something is definitely awry here
Yep
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I agree.
Time to come clean...
Vive y deja vivir / Live and let live
Javier.
|
|
|
|
|
garfield185 wrote: Time to come clean...
Yes! Are you withholding important information from us??
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Oh no!
"Time to come clean" is just my signature.
Well, I love Desperate Housewives...
Time to come clean...
Vive y deja vivir / Live and let live
Javier.
|
|
|
|