Solved

Serial Port Communication in VB

Posted on 2001-06-02
5
257 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

762 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