Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using existing C source code to communicate via serial port

Status
Not open for further replies.

gppman

Programmer
Feb 28, 2002
3
0
0
US

Hello,

I'm not sure if this is the right forum to ask this question. The question is, I have a source code in C for communicating via serial port using proprietary protocol. I'm thinking about using Visual Basic to introduce a better user interface with the text boxes, buttons, and all that. So that the user can fill all the necessary info in the textboxes, then just click 'send' button to send all the info via serial port. What is the best way to do this so that I don't have to convert my existing C source code protocol to basic? is it even possible at all? will appreciate any advice.

kind regards,

gppman
 
Compiling the code into a DLL would do the trick.
 
It can be done. Make the C source code a DLL and then declare it in a module in VB. Then just pass the arguments to the C function in the DLL. To pass a string, convert it to a byte array and pass it to the C function.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top