Link to home
Start Free TrialLog in
Avatar of bbrennan2
bbrennan2

asked on

VB equivalent type for a C structure

What is the correct vb type definition for the following C code and how do I call a fucntion expecting a pointer top such a structure?
/*****************************************************************************
      SeaDlg32.h

      Header file for Scanner Setup dialog boxes

      Copyright (c) 1995, Seaport Imaging
      Rex Miller
******************************************************************************/

#ifndef _SEADLG32_H
#define _SEADLG32_H

// option bits enable editing these features.
#define OPT_DOCSIZE            0x00000001
#define OPT_RES                  0x00000002
#define OPT_ORIENT            0x00000004
#define OPT_TIMEOUT            0x00000008
#define OPT_ENSIGNS            0x00000010
#define OPT_PAGEMODE      0x00000020
#define OPT_ADF                  0x00000040
#define OPT_PREFETCH      0x00000080
#define OPT_LEFTADJ            0x00000100
#define OPT_PAGELTH            0x00000200
#define OPT_MORE            0x00000400
#define OPT_ALL                  0x00FFFFFF      // All options editable.

#define OPT_BC_SYMBOLOGY  0x00000001
#define OPT_BC_CHECKSUM   0x00000002
#define OPT_BC_QUALITY    0x00000004
#define OPT_BC_FILTER     0x00000008
#define OPT_BC_SEARCH     0x00000010
#define OPT_BC_ORIENT     0x00000020
#define OPT_BC_WIDTH      0X00000040
#define OPT_BC_HEIGHT     0x00000080
#define OPT_BC_MAX_SYM    0x00000100
#define OPT_BC_MIN_SYM    0x00000200
#define OPT_BC_MIN_CHAR   0x00000400
#define OPT_BC_MIN_PARTIAL  0x00000800
#define OPT_BC_FIXED      0x00001000

#define OPT_MORE_DIALOG_ONLY    0x80000000 // Skips the main scanner dialog
#define OPT_OK_RESET            0x40000000 // Calls FcsResetScanner or sets Bar Code options after IDOK
#define OPT_INIT_FROM_REC       0x20000000 // Initializes dialog box from input record.

// Insure that records are packed on 4 byte boundaries. rdm
#pragma pack( push, publicrecords, 4 )
typedef struct of_scanrec {
      double Width;            // Page Width in inches
      double Height;            // Page Height in inches
      UINT Res;                  // Resolution
      UINT PageOrient;      // 0=portrait,1=landscape,2=fast portrait
      UINT NumBuffers;      // Number of page buffers
      UINT Timeout;            // Time in seconds
      UINT LengthChk;            // 0..100
      int LeftAdjust;            // -500..500
      PAGEMODE PageMode;      // 0=Simplex,1=Duplex
      PAGESIZE PageSize;      // 0=Letter etc
      BOOL Prefetch;            // T/F
      BOOL Ensigns;            // T/F
      BOOL AutoFeeder;      // T/F
} SCANREC;

typedef struct of_barcode {
      double      Width;                  // for FcsSetBarCodeMetrics
      double      Height;                  // for FcsSetBarCodeMetrics
      DWORD      Types;                  // for FcsSelectBarCodeTypes
      DWORD      Orientation;      // for FcsSetBarCodeMetrics
      DWORD      Quality;            // for FcsSetBarCodeMetrics
      DWORD      Small;                  // for FcsSetBarCodeSearchOrder
      DWORD      Medium;                  // for FcsSetBarCodeSearchOrder
      DWORD      Large;                  // for FcsSetBarCodeSearchOrder
      DWORD      MinNumber;            // Min # symbols to read. Not used by Autopilot.
      DWORD      Number;                  // Max # symbols to read. for FcsReadBarCodes
      DWORD      Length;                  // for FcsReadBarCodes
      DWORD      Fixed;                  // for FcsReadBarCodes
      DWORD      PartialLen;            // for FcsReadBarCodes
      DWORD      x;                        // Zone x & y coordinate
      DWORD      y;                        // Zone x & y coordinate
      DWORD      dx;                        // If DX & DY = 0 then no zoning is defined.
      DWORD      dy;
      BYTE      Options[64];      // for FcsSetBarCodeMetrics
} BARCODEREC;

typedef SCANREC *PSCANREC;
typedef BARCODEREC *PBARCODEREC;
#pragma pack( push, publicrecords, 4 )

extern __declspec(dllexport ) int __stdcall FcsScannerDialogBox( char* lpszName, char *lpszCaption, DWORD optBits, PSCANREC lpScanner, LPDWORD Result );
extern __declspec(dllexport ) int __stdcall FcsBarCodeDialogBox( DWORD optBits, BARCODEREC *lpBarCode );

#endif // _SEADLG32_H

 
The function to be called

int FcsScannerDialogBox( LPSTR name, LPSTR caption, DWORD options, SCANREC *params, LPDWORD result )
ASKER CERTIFIED SOLUTION
Avatar of VBDesigns
VBDesigns

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial