need help convert c++ to vb6 serial port

Reply

Join Date: Aug 2006
Posts: 5
Reputation: kimmi_dk is an unknown quantity at this point 
Solved Threads: 0
kimmi_dk kimmi_dk is offline Offline
Newbie Poster

need help convert c++ to vb6 serial port

 
0
  #1
Aug 19th, 2006
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, 36 views)
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

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

 
0
  #2
Aug 19th, 2006
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 5
Reputation: kimmi_dk is an unknown quantity at this point 
Solved Threads: 0
kimmi_dk kimmi_dk is offline Offline
Newbie Poster

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

 
0
  #3
Aug 19th, 2006
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
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

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

 
0
  #4
Aug 19th, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 5
Reputation: kimmi_dk is an unknown quantity at this point 
Solved Threads: 0
kimmi_dk kimmi_dk is offline Offline
Newbie Poster

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

 
0
  #5
Aug 19th, 2006
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
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

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

 
0
  #6
Aug 21st, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 5
Reputation: kimmi_dk is an unknown quantity at this point 
Solved Threads: 0
kimmi_dk kimmi_dk is offline Offline
Newbie Poster

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

 
0
  #7
Aug 21st, 2006
hi ..

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

tnx for all help Comatose
/kim
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 3
Reputation: sardi is an unknown quantity at this point 
Solved Threads: 0
sardi sardi is offline Offline
Newbie Poster

need idea from all

 
0
  #8
Dec 13th, 2007
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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 218
Reputation: hkdani is an unknown quantity at this point 
Solved Threads: 24
hkdani's Avatar
hkdani hkdani is offline Offline
Posting Whiz in Training

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

 
0
  #9
Dec 13th, 2007
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?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC