943,937 Members | Top Members by Rank

Ad:
Aug 19th, 2006
0

need help convert c++ to vb6 serial port

Expand Post »
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
Attached Files
File Type: cpp AVRInSystemProg.cpp (17.6 KB, 111 views)
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kimmi_dk is offline Offline
5 posts
since Aug 2006
Aug 19th, 2006
0

Re: need help convert c++ to vb6 serial port

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
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004
Aug 19th, 2006
0

Re: need help convert c++ to vb6 serial port

Hi Comatose
Thank you for your interest
I`d like to tell you that I do use XP home sp2
I can talk to my comport/usb no problem but i can find around in c++
i


I do use XP home sp2
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kimmi_dk is offline Offline
5 posts
since Aug 2006
Aug 19th, 2006
0

Re: need help convert c++ to vb6 serial port

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.
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004
Aug 19th, 2006
0

Re: need help convert c++ to vb6 serial port

Hi ..

No my problem is that i dont know how to use the info from AVRInSystemProg.cpp
because i dont konw C++ I only have used visual basic 6 basic
cant convert info from c++ to vb

/kim
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kimmi_dk is offline Offline
5 posts
since Aug 2006
Aug 21st, 2006
0

Re: need help convert c++ to vb6 serial port

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.
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004
Aug 21st, 2006
0

Re: need help convert c++ to vb6 serial port

hi ..

Have found a dll i can use for this program using avr read/write almel

tnx for all help Comatose
/kim
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kimmi_dk is offline Offline
5 posts
since Aug 2006
Dec 13th, 2007
0

need idea from all

how to create the circuit with serial port R232 DB-9 interface to test program using visual C++. the program will indicate the LED at every bits was sent by program but i don't know to design the circuit, anybody please help me.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sardi is offline Offline
3 posts
since Dec 2007
Dec 13th, 2007
0

Re: need help convert c++ to vb6 serial port

Quote ...
i don't know to design the circuit
Hey, I'm not an electrician. You're wanting a VB6 forum to tell you how to do electronics?
Are you serious?
Reputation Points: 49
Solved Threads: 44
Posting Pro in Training
hkdani is offline Offline
426 posts
since Nov 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: how to play wav file
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Vb6 Vs Vb.net





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC