writefile API

How do I send a file to a comm port using the writefile() API in VB4?
AndrewLindsayAsked:
Who is Participating?
 
MikeP090797Connect With a Mentor Commented:
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
 
MirkwoodCommented:
Sorry not possible in VB4.
You need a 32 bit development platform like VB5 to use writefile


0
 
AndrewLindsayAuthor Commented:
VB4 32 Bit, as far as I can tell, is a 32Bit environment, and can use the 32Bit API.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
MirkwoodCommented:
Hmm, I always thought that it was 16bit. My mistake.
0
 
AndrewLindsayAuthor Commented:
VB4 Has both a 16Bit and 32Bit environment.  The 32Bit API calls are valid for the 32Bit environment.
0
 
MikeP090797Commented:
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
 
AndrewLindsayAuthor Commented:
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
All Courses

From novice to tech pro — start learning today.