In 1990, I designed a small calculator-like program written for DOS. A friend, who has passed away, coded it in C++. I have the complete source code for it with these exceptions. Let me add I know absolutely nothing about C++ other than I can spell "compilor" (just kidding). I do know the source code contains only one *.h (header?) file which begins with

The five files I do not have. I know the stdio.h file is available but I can find no reference to any of the "cw" files.

I want to upgrade my program to Windows interface (I hope you understand what I want to do since I don't know the correct terminology) and make some minor "label" like changes and perhaps, rearrange or remove certain modules, such as remove the "Length Calculator module" and the like.

Am I out of luck without those four files?

Thank you very very much for your expertise.

05-21-2007

swgh

dos.h is an old header that compilers like turbo C++ would have in their library. I have never seen cw before but can only assume it was included with sperfic compiler the original code was created on. The only way you can do this is move the code into a newer stable editor with a modern compiler and find somway of ironing out the errors you will get from uncreconisable header files. No easy task.

Im sure sombody here will be able to highlight for you what the cw is, It looks very pre-standard, stdio.h is a C header file.

05-21-2007

Salem

The first step would be to create a console project in your new compiler (have you got one in mind?), and add the source file(s) to that project.

Then comment out those 4 'cw' files and see what complains. That will give you some idea as to how much work is involved. You'll just end up with a list of 'undeclared' and 'unresolved' error messages.

TBH, converting a 15+ year old DOS program into an up to date windows GUI program is going to be hard. Anything dealing with input or output is pretty much scrap code. Whether anything is re-usable depends on how well the original classes were specified and implemented. If the core classes of the calculator are free of any input and output dependency, then you'll have a chance.

To actually make it look like a windows program, it's probably better to start from your design. The C++ language itself has moved on, so what C++ may be re-usable might not be that 'good' C++.

Plus if the program uses lots of memory allocation, DOS programs tended to be full of lots of horrid kludges to work around the 64K segment limit. Large memory blocks simply are not an issue for today's platforms.

> #include <stdio.h>
This is a C header file, yet you say C++ ?

05-21-2007

JVene

Maybe.....

By chance are the initials of the original author cw?

Not that cw is of any significance in finding or recreating them. Just curious.

It may be possible to reconstruct the contents of those headers by a bit of deduction. If one commented these includes out of the compilation, the compiler would complain about functions without a declaration, access to member variables without declaration, and it's probably that these could be used to reconstruct these declarations. Part of this depends on how much the author used inline function in those files, or if there are any template classes in those files.

This would, however, require a fairly knowledgeable C++ programmer - not necessarily an expert, just someone experienced enough to interpret the compiler complains and generate the required declarations.

You could get a fair headstart, too. Depending on the complexity of the application, it may be workable to skim through the source to identify class names obviously referenced as member functions for which there are no class declarations, and fill that out first. This would go a long ways toward the reconstruction. A compiler pass would then pick up any member variables referenced that are missing, completing the major portion of the work. After that, depending on what complaints remain, various judgment calls to make about possibly missing inline functions.

This could be obviated, however, by your intent to translate the work into a GUI application. If you could deduce, by reading the code, that important features were implemented as member functions, and are therefore present in the CPP files you have, you could treat that a body of functions to be applied to a new design. Redesign the user interface, interpreted as a GUI interface, and apply these functions to that design - a two for one kind of approach (reconstruction and translation into GUI). This would require a more expert programmer.

05-21-2007

swgh

Just found out

cw means "child widget tree"

Used google as I wamted to know!

05-21-2007

VirtualDavid

You are all wonderful! Thank you very much. I didn't expect such a quick and thorough reply. It seems most of what was said is way over my head (I did get a grasp of the concepts, though).

It would seem better that I try another approach. Now, if I had all the *.c files...and a working copy of a relatively small program that's really comprised of about 7 very small routines (modules), would anyone care to speculate what it'd cost to accomplish my goal. I realize that's impossible to really answer so let me ask: Under $1500 (I"m hoping I hear under 1k)?

The next step, depending on your input, would be to post my request in the "hire" forum.

Thanks, again.

05-21-2007

swgh

Well you can "rent-a-coder" from the web. Google it and see what you get, They all vary in prices.

05-21-2007

MacGyver

If the project isn't that big, it shouldn't take more than a few hundred USD if you want to hire someone to do it.

05-21-2007

VirtualDavid

I was almost afraiid to check back after realizing what a stupid question I asked. MacGyver, your reply was quite encouraging. I've been in contact with an outsourcing company in India and they want to charge $1300 to replicate a single module of the program based on 240 hours of programming. That seemed outrageous, but since I'm not a programmer, I couldn't tell for sure.

I'm baffled by the missing *.h files I mentioned in the beginning. My friend who coded the program told me he gave me everything I needed, except a compiler, to modify it in the future.

I gotta check what "child widget" is...

05-21-2007

prog-bman

Really if you think about it that is only 5.41/hr which is a good deal as far a labor is concered, but regardless of the fact, what is your ultimate goal here. Do you just want to reproduce the program because in that case, just run it and start fresh with what it looks like and does. If you don't want to do that and get the old code working that may be harder without knowing what compiler was used.

05-21-2007

MacGyver

The header files might have come with the compiler, so that's probably why your friend stated he gave you everything but the compiler.

My estimate could be quite off the mark. It depends upon how much work is involved, which depends upon how much of the code can be salvaged, etc. etc..

05-21-2007

VirtualDavid

I agree the rate is good. The total hours seem excessive. Salem and swgh mentioned stdio.h is a C header, not C++. Gulp...I thought the program was written in C++ but I don't have a clue. Here's a small piece of a file: