There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Software Development
Tag Cloud
audio blue screen boot bsod computer cpu crash dell desktop driver drivers error excel external hard drive firefox freezes freezing hard drive hardware hijackthis internet internet explorer itunes laptop mac malware motherboard mouse network networking outlook 2007 power printer problem ram router screen slow sound trojan usb virus vista vista 32-bit windows windows vista windows xp winxp wireless wmp
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
Using C code in VB project!!!!!


Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
newkidtopc's Avatar
Senior Member with 363 posts.
 
Join Date: Jul 2002
Location: India
29-Jan-2004, 11:09 AM #1
Using C code in VB project!!!!!
Hello,
As a part of the final year project we have to upgrade a alarm logging software to Windows environment.
We already have the existing code (which is in c).This program runs under DOS.It uses functions like inportb(),outportb() etc to communicate with serial ports.
We do not want to spend time redoing the same task ie we would like to have the exixsting program handle all the serial communication stuff.
We would like to have the info from serial port to be displayed on screen using VB program.
Will the current C program still work under Windows?
__________________
Thomas Edison said " Genius is 99% perspiration 1%inspiration"
Snake~eyes's Avatar
Senior Member with 640 posts.
 
Join Date: Apr 2002
29-Jan-2004, 12:07 PM #2
I couldn't tell you an answer, but I'd be a smart *** and make the VB program just run the C exe. VB Program says click here to start. hehe
newkidtopc's Avatar
Senior Member with 363 posts.
 
Join Date: Jul 2002
Location: India
29-Jan-2004, 12:43 PM #3
Real smart
hehe
But I want an honest answer.There is some part of the existing program that I do not want to disturb.So that I can spend more time dealing with other enhancements
Gibble's Avatar
Distinguished Member with 27,137 posts.
 
Join Date: Oct 2001
Location: Striking or Scoring
Experience: The Alpha and Omega
29-Jan-2004, 01:27 PM #4
Make a dll from the C code to reference from your VB app.
coderitr's Avatar
Distinguished Member with 3,080 posts.
 
Join Date: Oct 2003
29-Jan-2004, 08:23 PM #5
What Gibble said is correct. You can also make the DLL perform a callback to a function in your VB program and update the screen from there. You may be able to pass the window handle from your form to the DLL function and have the C part update the window for itself but that may be harder than the callback. I can provide a sample of a C DLL function that calls back to a VB program if you want to see it.
newkidtopc's Avatar
Senior Member with 363 posts.
 
Join Date: Jul 2002
Location: India
01-Feb-2004, 03:54 AM #6
thanks very much coderitr,
That would really help me.
Could you post the code for me?
Thanks
coderitr's Avatar
Distinguished Member with 3,080 posts.
 
Join Date: Oct 2003
01-Feb-2004, 11:21 AM #7
Send me your email address in a PM and I'll send you the package. There is a VB project and a Visual C++ project.
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 08:02 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.