Solved

Serial Port Communication in VB

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

929 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

14 Experts available now in Live!

Get 1:1 Help Now