Microsoft KB Archive/96578

= ACC: Conversions for C Data Types in Visual and Access Basic =

Article ID: 96578

Article Last Modified on 1/18/2007

-

APPLIES TO


 * Microsoft Access 1.0 Standard Edition
 * Microsoft Access 1.1 Standard Edition
 * Microsoft Access 2.0 Standard Edition
 * Microsoft Access 95 Standard Edition
 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q96578



SUMMARY
Advanced: Requires expert coding, interoperability, and multiuser skills.

This article describes some of the conversions between Visual Basic for Applications in Microsoft Access 7.0 and 97 (or Access Basic in Microsoft Access versions 1.x and 2.0) and C arguments.



MORE INFORMATION
The following are general data type conversions:   hWnd            ByVal var As Integer LPSTR          ByVal var As String hDC            ByVal var As Integer WORD           ByVal var As Integer DWORD          ByVal var As Long INT            ByVal var As Integer INT FAR *      var As Integer CHAR FAR *     ByVal var As String LONG           ByVal var As Long LONG FAR *     var As Long BYTE           ByVal var As Integer BOOL           ByVal var As Integer UNSIGNED SHORT ByVal var As Integer UNSIGNED CHAR  ByVal var As Integer - must convert with Asc(var) UNSIGNED LONG  ByVal var As Long The following list shows how to define the C data type in a Visual Basic for Applications or an Access Basic data type:   BYTE, BOOL            Var As String * 1

LPSTR, CHAR FAR *    Var As Long       - Use API lstrcpy to get the string pointer.

anything FAR *       Var As Long       - This does not give the correct data type but contains the correct number of bytes; you may have to convert. The following list describes the differences returned from a function:   LPSTR               Function As Long    - Use lstrcpy to get the string from the pointer.

Additional query words: conversion

Keywords: kbinfo kbprogramming KB96578

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.