Migrating from VB to C and C++
Posted on 2003-10-28
Hi C people,
I've been given the daunting challenge of rewriting 10,000 lines of VB code into C within a few days.
Now I was a C expert in 1993, but none since. So I dug out an old program and relearned the basics in a couple of hours - no problem so far.
But I want this code to be as slick and neat as possible, it must work on every version of windows and not require any DLLs except kernel32, user etc. My program will not require a user interface, just collect system info and write a file.
So my questions are:
- Can I use C++ object oriented language without needing DLLs. E.g. can I use the "String" class to manage strings ?
- Whats the best and fastest way to write a file nowadays - fprintf ?
- Anyone got any good examples of how to do "createobject" in C, in a way which doesn't crash if the object isn't installed ?
- Do we still have to use malloc and free etc or is there a better way ?
- If I can use classes, what are the most common classes
- Any standard libraries out there for Split, Join, Replace, Array handling, String handling, etc so I don't have to write them from scratch ?
- General guidelines on good practice would be appreciated
The resulting code must work on a clean build of win 95, win 98, NT4 sp1 etc etc, so no oleaut32.dll, mfc32.dll etc allowed
Don't want any essays, just a few "pointers" ha