Breaking into Windows Form-based apps with VC++

Started by
5 comments, last by Skizz 17 years, 5 months ago
Ok, ive done C++ for quite some time now, and i feel the urge to move on from the console world. Ive decided to go into the programming of form-based Windows apps using VC++EE, and Ive got a question. I notice when I try and use a function for a control, its placed in the header instead of the source file. I understand that headers are used mainly for the creation and definition of classes and thier methods, but it seems to confound me. I try to access a controls property with all four different types of operators the "." "->" "::" and ":", but nothing. Usually when you try to access a property, like in VC#EE, it opens up a little menu with the different functions and whatnot, but nothing of the sort comes up. I try making the "Click" event, or whatever it is, set the Text property of a label to some incomprehensible jargon, but it throws an error, basically saying "wtf are you tryin ta do here, punk?!". Anyone got a solution to this problem? What am I doing wrong here?
Advertisement
I too found this quite disturbing, I don't think there is really anything you can do. I tried looking for options to not make inlining default, etc... But I swallowed my pride and learned C# which to my surprise, I liked even more than C++ (When it comes to .NET applications)
yeah, thats true, I too like C# more than C++ at the moment for making visual apps. The reason Im asking is because I have a prog that i wrote in C#, an Elite Skill Map for Guild Wars, and Ive gotten 1.0 almost done (mixed a skill or two up), and wanted to make it so where my users wouldnt have to download the .Net framework as well. I can get the basic code for the form/control construction from VC++, and copy it over into DevC++ (so I dont have to worry about .Net), and work with the functions and whatnot from there. C# is great, i just want to apply my knowledge of C++ into the truly visual environment, the more i learn, the better.

man, this is a far cry from the days of VB6, aint it? heh heh...
Quote:
yeah, thats true, I too like C# more than C++ at the moment for making visual apps. The reason Im asking is because I have a prog that i wrote in C#, an Elite Skill Map for Guild Wars, and Ive gotten 1.0 almost done (mixed a skill or two up), and wanted to make it so where my users wouldnt have to download the .Net framework as well. I can get the basic code for the form/control construction from VC++, and copy it over into DevC++ (so I dont have to worry about .Net), and work with the functions and whatnot from there.


If you use Windows Forms from C++ (then you're really writing in Managed C++ or C++/CLI, depending, and DevC++ won't compile either), you are still writing against the .NET framework and your users will still need it installed. You're not solving that problem.

The only way to quit yourself of the .NET framework is to not write against it. Which means pure Win32 or some other windowing wrapper that doesn't depend on the .NET framework.

Which are you using, Windows Forms, or the Win32 API? The wording of your post makes it hard for me to tell.

Quote:
basically saying "wtf are you tryin ta do here, punk?!".

If you posted the real error message and the corresponding code, you might be able to get some help. As it stands there are far too many things you could be doing wrong.

Quote:
C# is great, i just want to apply my knowledge of C++ into the truly visual environment, the more i learn, the better.

C# is the better tool for the job in this case. Writing GUI applications in C++, even with some of the available windowing toolkits like wxWidgets or Qt, is really like pulling teeth.
Well... that makes sense, actually. Correct me if im wrong, but Python can compile all of the code into a normal .exe, which can be installed by simply copying the .exe, or are there some other files that I would need to include with the package, and would it also be smaller than sending a zipped up C# install prog w/ the .Net framework installer included?

Ive got a handle of Python, admittadly not as good as i do with C# or C++, and ive got some examples of form-based progs, what im trying to do here is make a visual program that doesnt require the .Net framework, or another VM, so i can make things simpler for my users. Keep in mind that a number of my potential users arent as computer savvy as I am, so keeping things as simple as possible would be a definite boon.

Hmmm.... well... I could turn it into a console program, its not THAT complex, just a few large switch statements, for the most part. I think i may have a different direction to making this as opposed to making it a form-based app...

(for those of you who play Guild Wars, tell me if you think this would work well.)
Quote:
Correct me if im wrong, but Python can compile all of the code into a normal .exe

There are tools that can create "dependancy-less" Python applications. To my knowledge they simply embed the interpreter and all dependancies into the .exe.

Proliferation of the .NET framework is unavoidable on Windows, so you may as well do your part to encourage people who don't have it yet to get it over with already. You can fairly trivially provide two downloads: one with the .NET framework redistributable bundled into the install process (for those who don't have it) and one without (for those who do). The extra size of the framework is rarely an issue nowadays. Especially to Guild Wars players, the majority of whom I suspect have high-speed connections anyway.

This really shouldn't be the deciding factor as far as language goes for your project.

Quote:
(for those of you who play Guild Wars, tell me if you think this would work well.)

I play Guild Wars, but I have never seen a need for tools of this type.
A console program is a bad idea. The (lack of a) user interface would ensure your tool is never used; there are already GUI tools achieving similar goals out there, you wouldn't be competitive in any way.
It has to be said that Form Designer really is a huge pile of steaming poo. Especially when doing C++/CLI. The generated code is really horrible. I've found that just writing the code manually is better, and not difficult since the framework makes it really easy to do. Plus, you can put the functions into the .cpp file. The final nail in the coffin for the Form Designer for what I'm currently doing is the total lack of support for foreign languages (unless I've missed something). If you want your controls to have multiple language support then you'll need to bypass the Form Designer UI for setting the text and do your own thing, which is a bit rubbish.

Skizz

This topic is closed to new replies.

Advertisement