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

writefile API

Posted on 1998-12-16
Last Modified: 2008-03-17
How do I send a file to a comm port using the writefile() API in VB4?
Question by:AndrewLindsay
  • 3
  • 2
  • 2
LVL 13

Expert Comment

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


Author Comment

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

Expert Comment

ID: 1450863
Hmm, I always thought that it was 16bit. My mistake.
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.


Author Comment

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

Expert Comment

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?

Author Comment

ID: 1450866

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.

Accepted Solution

MikeP090797 earned 50 total points
ID: 1450867
 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
Dim L as long
WriteFile(hFile, S, Len(S), L, vbNull


Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
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…

790 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