| | |
need help convert c++ to vb6 serial port
![]() |
•
•
Join Date: Aug 2006
Posts: 5
Reputation:
Solved Threads: 0
Hi all ..
Hope that this forum can help me .
I have to make a program that can talke to my Atmel ( micro) thu the ISP (In Serial Programming).
I only have the source code in devcpp (c++) and dont know anything about c++ ...
the source code talk whed the (ISP divice) between the Micro and pc thu the serial port
it send byte to isp and read byte to
have uploadet the file : AVRInSystemProg.cpp
this is the part i do need to convert to vb6
Best Regards
Kim, Denmark
Hope that this forum can help me .
I have to make a program that can talke to my Atmel ( micro) thu the ISP (In Serial Programming).
I only have the source code in devcpp (c++) and dont know anything about c++ ...
the source code talk whed the (ISP divice) between the Micro and pc thu the serial port
it send byte to isp and read byte to
have uploadet the file : AVRInSystemProg.cpp
this is the part i do need to convert to vb6
Best Regards
Kim, Denmark
Hi Kim,
I'm currently looking into the situation of making VB6 read and write data to/from serial / parallel ports. This worked great up until 2k and XP, where they removed a .dll from the OS that was required for VB to Read and write to the IO ports. Check this thread: http://www.daniweb.com/techtalkforums/thread52505.html
I'm currently looking into the situation of making VB6 read and write data to/from serial / parallel ports. This worked great up until 2k and XP, where they removed a .dll from the OS that was required for VB to Read and write to the IO ports. Check this thread: http://www.daniweb.com/techtalkforums/thread52505.html
That's the problem.... from what I can tell, the only solution to the problem is to download the .dll (http://www.lvr.com/parport.htm#Programming) and try to use it. You USED to be able to use vbin and vbout of the .dll that came with 9x.... which carried on until 2k. Since now that .dll NO LONGER EXISTS, we have to try use the one at lvr.com. I haven't used it, but it seems to be well documented.
Ok, Let me explain the best I can....
In the file you attached, you see this line
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.
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.
![]() |
Similar Threads
- vb2005 serial port opening (VB.NET)
- serial port interfacing (Visual Basic 4 / 5 / 6)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Adding buttons to a dhtml page
- Next Thread: Vb6 Vs Vb.net
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






