Solved

Serial Port Communication in VB

Posted on 2001-06-02
5
249 Views
Last Modified: 2008-03-17
1.How to write serail port communication using visual basic?

2. I do have written a code in visual basic for eg
Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" (ByVal lpFileName As String, ByVal dwDesiredAccess As Long, ByVal dwShareMode As Long, ByVal lpSecurityAttributes As Long, ByVal dwCreationDisposition As Long, ByVal dwFlagsAndAttributes As Long, ByVal hTemplateFile As Long) As Long\

The paprameters being passed to this function are
filename Com2:
dwDesiredAccess &HC0000000
dwShareMode 0
lpSecurityAttributes 0&
dwCreationDisposition &H3
dwFlagsAndAttributes 0
hTemplateFile 0

I would like to know how this CreateFile function works and what does Lib "Kernel32" does mean?

I would apperciate if anyone ould help in figuring this out..

Navin
0
Comment
Question by:NavinKumar
5 Comments
 
LVL 5

Accepted Solution

by:
dgorin earned 50 total points
ID: 6149537
1. Look at the MSComm control, you can find info in the VB documents under ActiveX controls.

2.  Lib "Kernel32" identifies the Windows library file for the Windows API function you defined.  Look at the VB docs for more info on using the Windows API calls.

0
 
LVL 1

Expert Comment

by:j3877
ID: 6152436
lib "kernel32" means that you are calling an API function from the library kernel32 (C:\Windows\System\Kernel32.dll).

[slightly lengthened version of previous comment]
0
 
LVL 1

Expert Comment

by:Un1
ID: 6549355
A true multithread VB5 VB6 source code communication control(Using CreateThread API, No crash in VB6):


http://www.banasoft.com/Comm.htm
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7132832
Hi NavinKumar,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

    Accept dgorin@nw's comment(s) as an answer.
**** Un1's link is broken.

NavinKumar, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.

EXPERTS: If you disagree with my recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:Computer101
ID: 7167860
Comment from expert accepted as answer

Computer101
E-E Moderator
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now