Ok, Let me explain the best I can....
In the file you attached, you see this line #include <iomanip> means that this C++ program wants to use functions, variables, and other programming "things" from the iomanip file (probably .h). Vb has no real way of doing this. Now, beyond that, the information in that file (iomanip) is what is needed to read from, and write to the serial port. Search the .cpp file for "sendByte", and you'll see that it is never defined in the attached file. sendByte is a function (method) that is probably defined in a class in iomanip. Even if you had access to iomanip, you probably wouldn't be able to convert it to VB anyways, since vb doesn't allow such low-level access to hardware. Hell in C++ you can directly reference video memory, and use pointers to hardware addresses, all things of which are too low-level for VB.
VB CAN read from and write to a serial port, but it requires the use of the API. This was true until win2k and XP. There was a file (win95IO.dll, I believe) that had functions for doing just that. Since the release of the later windows versions, we have yet to find a suitable replacement for that .dll. There is a free dll available, that will allow you to read and write a serial port, but people with service pack 2 have been having troubles making it work correctly. So, if you want to make a program that does the same thing as the C++ program attached, you'll need to make that new .dll work correctly with VB6, and then write code to make the VB app do the same thing as the C++ app. If you want a direct port of the C++ app to VB, you can't do it. Vb doesn't allow you to access hardware at that level.
Last edited by Comatose; Aug 21st, 2006 at 1:07 pm.
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Offline 2,413 posts
since Dec 2004