|
If you play a bit with templates, it makes a sense then. But I'd wait for the newcoming version (2003), which have to be more compliant.
I have no further info, but it should support also partial template specialization etc. Related to business papers it should be 98% compliant with standard. Personally I am waiting for that (should be soon there)
For current .NET version, my comments, related to using old plain C++:
IDE is much better, especially the Intellisense stuff is enhanced a much (altough nobody is perfect). Except the annoying Dynamic help stuff, always turning on
Good thing is that you can use F12 to find any symbol, without building the symbol database. If the symbol is not present in the current project symbol database, it is able to switch to normal full text search through include directories.
Debugger, I learned with .NET how to use the .pdb files together with dumps - the .NET developer can open the .dmp files from client and then you have the exactly the same situation as your client had when the program crashed - this is a great great thing - this feature saved me a lot of time.
Finally the ATL7 is much better that ATL3, and the STL library is finally updated to something useful.
Bad things is the managing of the multiple projects - if you have more than one project in a "Solution" it will always try to compile the dependent projects, even when the first one collapsed totally
These were my personal opinions to the .NET while using only C++.
|
|
|
|
|
I'd like to thank everyone that commented. It was quite helpful.
We're really a shop of plain old C++. Since we write server software, we can be really bad control freaks. We don't use MFC and we don't use STL -- we're into not being too dependent on Windows... "Fast / Dependable / Debuggable / Controllable" are important things to us. But someday we'll port it....
Anyhow, I do love upgrading to new stuff. And it seems like VisualStudio is getting old. But, for us, it seems that now is not the time to upgrade to the new dev environment.
Thanks again!
|
|
|
|
|
I'm new to programming with Visual C++ and MFC. I've tried to figure this out by myself, but have had no luck. Any help would be appreciated.
I've made an AppWizard application for a RichEdit/Text editor and can't get the file extension when MFC loads the file. I want to change the serialization from RTF to TXT depending on the extension of the file. Do I need to write my own OpenFile procedure, and if so how do I do it?
Thanks
|
|
|
|
|
If your doing this in your serialize function you should be able to do:
CString filename = ar.GetFile()->GetFileName();
char ext[_MAX_EXT];
_splitpath(filename, NULL, NULL, NULL, ext);
You should then have the correct extension in ext.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
Hi there, I´ve looked through the Shell API doc´s and searched through the MSDN, but cannot find any doc´s about programmatically using the "open with" dialog box. Here´s my problem...
Using ::ShellExecuteEx(...) I´m opening a file (with the path, filename etc.),
I get notification from ::ShellExecuteEx if the associated program was successfully started, or an error if no application is asscoiated with the particular file. On recieving this error, I woukd like to show the "Open with" dialog. Anyone got any ideas?
Thanks in advance
Phil
bum... and I thought I´d got rid of all the bugs
|
|
|
|
|
it's shell32.dll!OpenAs_RunDLL, but i don't know the parameters...
i hope this will help!
|
|
|
|
|
When a date field mapped to the CDateTimeCtrl has no data, the DateTime controls pops up with 12/31/1969 instead of system date. Can this be fixed so that it pops up with current system date?
-Elizabeth
Eilzabeth
|
|
|
|
|
dtCtrl.SetTime();
Regards,
Alvaro
When birds fly in the right formation, they need only exert half the effort. Even in nature, teamwork results in collective laziness. -- despair.com
|
|
|
|
|
I tried this, but it will not work. The time will get saved to the database even with no user interaction to the control. I don't want to save if no change.
-Elizabeth
Eilzabeth
|
|
|
|
|
Elizabeth Chang wrote:
The time will get saved to the database even with no user interaction to the control.
I don't understand. How is it that your date control is tied to a field in the database?
Without knowing anything about what you have there, I'll venture to say that the underlying code detects changes to the controls and sets the record's flag to "Modified" or "Dirty", or something like that.
There's gotta be a way for you to do something like this:
bool bModified = GetModified();
if (date field in database is Null)
dtCtrl.SetTime();
SetModified(bModified);
Regards,
Alvaro
When birds fly in the right formation, they need only exert half the effort. Even in nature, teamwork results in collective laziness. -- despair.com
|
|
|
|
|
I map the field to the control in DoDataExchange(). When an UpdateData(TRUE) is sent, the field is marked as dirty because of SetTime function. The value from the control is saved to the database.
-Elizabeth
Eilzabeth
|
|
|
|
|
In that case, you can do the same thing I explained, but use IsFieldDirty and SetFieldDirty instead of GetModified/SetModified.
Regards,
Alvaro
When birds fly in the right formation, they need only exert half the effort. Even in nature, teamwork results in collective laziness. -- despair.com
|
|
|
|
|
I am not sure if I get it all. I created a class CDateTimeCtrlEx (drived from CDateTimeCtrl) and created a public member variable BOOL m_modified. I have Date fields in almost every form. Am I going to have to do this for each Date field?
--------------begin program code--------------------
void CDateTimeCtrlEx::OnDatetimechange(NMHDR* pNMHDR, LRESULT* pResult)
{
m_modified = TRUE;
*pResult = 0;
}
void CDateTimeCtrlEx::DisplayNullDate()
{
SetTime(&CTime::GetCurrentTime());
SetFormat("''");
}
void CDateTimeCtrlEx::ResetFormat()
{
SetFormat("M'/'dd'/'yyyy");
}
-----------------end program code-------------------
In my application OnDataExchange event:
--------------begin program code--------------------
void CTest_dateView::DoDataExchange(CDataExchange* pDX)
{
CRecordView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CTest_dateView)
DDX_Control(pDX, IDC_DATETIMEPICKER_END, m_dtEnd);
DDX_Control(pDX, IDC_DATETIMEPICKER_BEGIN, m_dtBegin);
DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKER_END, m_pSet->m_DATE_END);
DDX_FieldText(pDX, IDC_EDIT_NAME_1, m_pSet->m_NAME_1, m_pSet);
DDX_FieldText(pDX, IDC_EDIT_NAME_2, m_pSet->m_NAME_2, m_pSet);
//}}AFX_DATA_MAP
m_dtBegin.ResetFormat();
if (!m_dtBegin.m_modified && m_pSet->m_DATE_BEGIN == 0)
{
m_dtBegin.DisplayNullDate();
}
else
DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKER_BEGIN, m_pSet->m_DATE_BEGIN);
m_dtBegin.m_modified = FALSE;
}
-----------------end program code-------------------
Eilzabeth
|
|
|
|
|
I am trying to write some code that will loop in a specified directory to check for some file extentions and then delete them. I Know how to open , delete and so on. But i do not know if there is a way to get the directory list of file names so that i can then Iterate through that.
Any help would be great!
|
|
|
|
|
Take a look at the CFileFind class in MFC - it is designed to do exactly that. Alternatively if you are just using the Windows API, you can use the FindFirstFile() and FindNextFile() API functions.
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
|
Use the CFileFind object.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Look at the class CFileFind. And specifically the FindFile and FindNextFile member functions.
Good luck.
Always remember the building blocks of the universe:
Electrons, protons, neutrons, morons.
|
|
|
|
|
I've write a program that can build a decision tree model, so training
rules are made. But now, i dunno how to feedback the instances to the
model in order to calculate the training and testing errors. My
program is written in c++.
hkbeckham
|
|
|
|
|
I haven't got a clue what you're talking about ...
This is not a simple problem to diagnose without understanding the domain, the algo and the code
Can you be really more precise as to what is not working ? is it the code, is it the design, is it the specs, is it the algorithm ?
Thanks.
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
I have two or more non-window objects (doesn't matter what kind...generic). The objects can be instances of different classes. I want one of the objects to signal the other objects when a change has occured in its state. (such as the change in one of the member variables...modified thru a Set function).
How is the best way to signal the other objects that a change event has occured?
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
give each object a pointer to the other object, so that each can call a member function on the other when the 'event' occurs. maybe you could derive them both from a common "event handler" class with methods for singalling events.
(off the top of my head)
-c
Image tools: ThumbNailer, Bobber, TIFFAssembler
|
|
|
|
|
Chris Losinger wrote:
give each object a pointer to the other object
I wanted to avoid doing that.
Chris Losinger wrote:
maybe you could derive them both from a common "event handler" class with methods for singalling events.
That has posibilites...I'll have to think about it.
Thanks
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
Have a look at the Observer Pattern.
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
Maximilien wrote:
Observer Pattern
Those are new to me...what are they? The only reference I find to Observer in msdn is Java related.
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|