Solved

writefile API

Posted on 1998-12-16
7
478 Views
Last Modified: 2008-03-17
How do I send a file to a comm port using the writefile() API in VB4?
0
Comment
Question by:AndrewLindsay
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1450861
Sorry not possible in VB4.
You need a 32 bit development platform like VB5 to use writefile


0
 

Author Comment

by:AndrewLindsay
ID: 1450862
VB4 32 Bit, as far as I can tell, is a 32Bit environment, and can use the 32Bit API.
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1450863
Hmm, I always thought that it was 16bit. My mistake.
0
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!

 

Author Comment

by:AndrewLindsay
ID: 1450864
VB4 Has both a 16Bit and 32Bit environment.  The 32Bit API calls are valid for the 32Bit environment.
0
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1450865
Out of curiosity: why to use WriteFile, when you can use Print or any other VB function to write to COMM ports, or even to use the COMM control for that?
0
 

Author Comment

by:AndrewLindsay
ID: 1450866
MikeP,

The reason is that I not really programming in VB, I am using PowerBasic for a DLL in VB to give a bit of qa speed increase.
0
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 50 total points
ID: 1450867
Type OVERLAPPED
 Internal As Long
 InternalHigh As Long
 offset As Long
 OffsetHigh As Long
 hEvent As Long
End Type

Declare Function WriteFile Lib "kernel32" Alias "WriteFile" (ByVal hFile As Long, lpBuffer As Any, ByVal nNumberOfBytesToWrite As Long, lpNumberOfBytesWritten As Long, lpOverlapped As OVERLAPPED) As Long


Dim S as string
S="Data"
Dim L as long
WriteFile(hFile, S, Len(S), L, vbNull


0

Featured Post

Independent Software Vendors: 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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…

705 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