|
Hi all,
I have been programming in Visual C++/MFC for some time now and it can be a frustrating experience. Often I find myself implementing various workarounds for deficiencies in container classes, controls, dialogs and serialization. Also, documentation seems to be very fragmented. Sometimes I get hung up for days on something which should be very simple. Of course I know that every environment has it's quirks but hopefully things have improved with C#/.NET as opposed to a whole new, possibly bigger set of problems.
I thought I would list a few of my most frustrating experiences with C++/MFC to elicit comments comparing C#/.NET. I have started reading up on C#/.NET and I know it has many improvements but it's nice to hear from those using it before I jump in.
1. Container classes - I know that C# has reworked these. I use C++ CArrays extensively and although they work well for the basics, it's gets very tiring having to write workarounds or pure C code for things like multidimensions, sorting and serialization. Everytime I want to serialize a CArray with mixed types (CStrings), I have to implement a template override and depending in what MFC generated class the array/template lives, it may not be called and I have to cross my fingers that serialization will be reliable. As if this wasn't bad enough, MS documentation on this workaround consists of one poorly worded paragraph - took me ages to realize why serialization of Array based CStrings was not reliable.
2. Tabbed dialogs - I once had to make a fairly complicated tabbed dialog that was able to save user settings(via serialization) and restore them automatically on initialization - you can't believe how much code this required because of quirks in the behavior of property sheets/pages and inconsistent behavior of serialization from the property page class. Implementing the same behavior in a simple dialog would be trivial. It seems that MS .NET tabbed dialogs behave just like regular dialogs which would be a godsend.
3. Serialization - in addition to the problems with arrays, it seems like an excessive number of poorly documented macros are required. The whole IMPLEMENT_SERIAL/DYNAMIC/DYNCREATE macros are very confusing. I know most people use alternate methods but I hate to reinvent the wheel.
4. Lack of useful controls. I once needed to display lots of data in a grid format and ended up using Flexgrid which it seems was never intended for general useage. Also, implementing controls in the mainframe border area (ex. a color picker like the one in paint) is extremely difficult.
5. Modifying behaviour of framework - I often need slightly different behavior with regards to the mainframe/childframe. A lot of this knowledge seems to be tribal. For example, I recently had to modify the child window title based on various program conditions. This is fairly common - many apps will place a '*' next to the filename if source is modified. I found a webpage on methods of doing this. They presented several possible methods but they basically admitted that none worked well or at all due to framework code unknowns. Luckily I saw that someone gave a reply to the article that gave me a working solution. I could not find any documentation on MS.
|
|
|
|
|
Is there a question (or even a point) here? I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Good grief Mark,
We can only ask specific coding questions?
My intent was to get some idea if these types of issues are less likely to be an issue with .net as my projects tend to encounter the listed issues frequently.
|
|
|
|
|
Your post looks and sounds more like a rant that should be in the soapbox or the lounge than an actual question. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I tried for years, but never mastered C++/MFC. I gave up trying for a few years because of the frustration of trying to learn it, and make sense of the garbage Microsoft passes off as documentation. I even bought the 4-volume set of MFC documentation from Microsoft, and it's just as fragmented and useless as the online trash.
I recently started over, trying instead to learn C# and the .Net Framework, and I can assure you that it is a relative joy to work with. I only have a couple of nights a month available to work on learning it, but I'm already accomplishing things that I found impossible to do after many years of trying in MFC. No doubt those who love C++ will be offended by my remarks, but I'm finding C# a pleasure to learn and use, though it will probably take a lifetime to learn the Framework. The selection of controls is vast, and you can modify anything you like to get the behaviors you need.
Give it a go for a few months. I don't think you'll look back..."A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Why bring this here? It has nothing to do with .NET and really needs to be directed at Microsoft. My experience of MFC was that although seemingly complex for a beginner it worked well once you mastered the basics. I used it quite extensively in my professional life as a developer and did not have any real issues with it. MVP 2010 - are they mad?
|
|
|
|
|
The release candidate for Visual Studio 2010 and .NET Framework 4 is available for download. The downloadable release candidate was offered to MSDN subscribers on Monday. Non-members can get it on Wednesday.
For more information about the Go Live license, how to get free developer training, and get your copy of the release candidate, see Visual Studio 2010, .NET 4 Release Candidate Ships[^]
|
|
|
|
|
We have a legacy Visual Basic application. It references a third party .Net DLL and that requires few keys to be set in the application's APP.Config. That DLL reads those keys from the APP.Config.
Not sure how to create APP.Config and add those keys. Any help is greatly appreciated.
Thanks,.RamDili
|
|
|
|
|
.NET first looks for a config file named for the executable with the config extension.
So if your app is myapp.exe then the config file would be myapp.exe.config. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
hi
i want to read linux os information with vb.net. but i dont know how do it?
can you help me?
thx
|
|
|
|
|
I didn't know you could run .net applications on linux ...
Or are you trying to get the os version by remote?
|
|
|
|
|
ddecoy wrote: I didn't know you could run .net applications on linux
There's a project called Mono that lets you run .NET on Linux (as well as other OSes)."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I expect the Environment and SystemInformation classes should provide some info.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
Hi,
Is there any way which I can get Visual Studio 2008 with Sql Server Express edition? I need the new features like WPF, WCF, Ajax and Silver Light also. I need to install this in my home for learning purpose only.
Eventhough I installed from microsoft site, I have to install each langauage piece by piece,ie, Visual C# , then web applications, windows applications, visual web developer etc, but not sql server.
Is anybody provide any site that gets the full version which installs all the above at one shot?
This site will give the full downloads, but only for 30 days. So after 30 days, we need to register. Does it mean that we need to pay for it? Will it include SQL Server ( which contains Sample database like AdventureWorks) also?
Please provide any suggestions.
Thanks,
meeram395.Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
SQL Server 2008 Express Edition[^]
The Express editions are free, forever. They just want you to register so they can bother you with rubbish.I don't speak Idiot - please talk slowly and clearly
'This space for rent'
Driven to the arms of Heineken by the wife
|
|
|
|
|
Thanks a lot Andy. Since this is free, they are bothering with those rubbishes.
That is fine with me. Atleast I can learn something. So that is good.
Thanks anyway. Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
The only real issue you run into is that many of the Microsoft sample solutions come with a unit tests project in MSTest format. This is not supported in the Express editions. However, it is very straightforward to replicate such projects using NUnit or whatever, just find and replace all the test attributes with the appropriate ones for NUnit and they work OK. Or, of course, you can just ignore the unit test projects.
It's good that Visual Web Dev Express supports both Silverlight and ASP.NET MVC. They could have chosen not to support them. Kevin
|
|
|
|
|
You do not need to pay for any of these products; I have been using them for 3 or 4 years and find them excellent for all forms of development and learning. MVP 2010 - are they mad?
|
|
|
|
|
Thanks very much Richard. Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Hi,
I would like to know how to create a custom control in which I have one trackbar but with two thumbs (sliders) one at extreme left and one at extreme right.
How tough it will be ?
Will I have to write it from scratch or I can modify the existing trackbar to implement this ?
Thanks in advance
|
|
|
|
|
cooljeba1 wrote: I would like to know how to create a custom control in which I have one trackbar but with two thumbs (sliders) one at extreme left and one at extreme right.
How tough it will be ?
From scratch would probably be faster. Two small Panels that you can (horizontally) position with the mouse?I are Troll
|
|
|
|
|
Hi,
Thanks for your reply.. I was looking for something like this:
http://img28.imageshack.us/img28/2306/slider.jpg
|
|
|
|
|
As a programmer, I see a control with two little controls on it. The little controls can slide.
As an end-user, I'd say it would be confusing. What's the current setting? Is it set to the minimum, the maximum or both?I are Troll
|
|
|
|
|
yeah...
It will be used to scroll through a graph.. the left slider will be set to min and the right slider to the max by default.
User can slide either controls so select a range.. in graph.. lets say the min year he sets to 2005 and max year he sets to 2009. so he can generate graph for data inbetween these years
|
|
|
|
|
Hi i am developing an vb.net erp solution and want to know if there is any performance testing tool for windows appication available in market from which i can check how my appication doing.???
|
|
|
|