Maybe I'm crazy for wanting to try to do all this:
1. I want to fix major bugs in my non-visual classes before trying to integrate them into the GUI.
2. I want to be able to test further refinements to my non-visual classes after integrating them with my GUI app.
3. I don't want to move my class source back and forth between a project that has the Windows link options and a project that has console options. (I'm kind of assuming it would be bad to have a source file in multiple projects, but maybe I'm wrong about that.) In fact, sometimes I'd like to have a single project with my multipurpose class and my Windows source file and my console testing source file.
4. (probably unrealistic) I would like to able to be able to switch easily between Standard Library stuff and wxWidgets stuff as possible, because I am weak in both areas, and I like being able to ask using standard-looking source code that I can ask about on comp.lang.c++ and the like if I have non-wxWidgets related difficulties. This is probably impossible, I got way too many surprises converting all my std::strings to wxStrings today.
For example, I was using things like std::ostringstream with std::string but with wxString, certain functionality is within the string itself, not a separate class:
(I had some code here in the post, but I deleted it because it's not right exactly)
Probably #4 is not going to happen. But I would like to know if I am the only one who is trying to do the other things, and if not are there any good tips for organizing 1 - 3 (and 4, if there's any ideas.)
I'm using wx-devcpp but maybe there are some ideas in general that I could apply, hence I posted it here instead of in wx-devcpp forum.
Organizing source for use with Windows and console Topic is solved
-
- Super wx Problem Solver
- Posts: 307
- Joined: Fri Oct 08, 2004 8:21 am
- Location: Area 51
- Contact:
What you are trying to do is actually quite common. Maybe instead of thinking of it as sharing the source, think of it as three different projects GUI, CHUI and non-Visual.
You can acomplish that by putting your non-Visual stuff into a library project. This can be a statically linked library (.lib) or dynamically linked library (.dll). Then you reference this common library from your two Visual projects without even any source.
HTH
You can acomplish that by putting your non-Visual stuff into a library project. This can be a statically linked library (.lib) or dynamically linked library (.dll). Then you reference this common library from your two Visual projects without even any source.
HTH
- Santiago
http://www.metalogicsw.com
http://www.metalogicsw.com
-
- Filthy Rich wx Solver
- Posts: 214
- Joined: Wed Jun 15, 2005 3:31 am
- Location: United States
- Contact:
metalogic: I have put each non-visual class in its own project (and folder) as you suggested and made up a separate console_test project, cleaning up the code and dependencies in the process. Also I pledge never to use std::string again, just wxString.
My console tests still work after adding #include <stdio.h> to the source (that idea from the console sample). I had to do that because I got no output otherwise, even when I set my project as a console project.
So I am much happier now. I was getting a little frustrated. Thanks for your help. If anyone has any other tips for code organization, those will be nice to have, too.
My console tests still work after adding #include <stdio.h> to the source (that idea from the console sample). I had to do that because I got no output otherwise, even when I set my project as a console project.
So I am much happier now. I was getting a little frustrated. Thanks for your help. If anyone has any other tips for code organization, those will be nice to have, too.