Link to home
Start Free TrialLog in
Avatar of bansaldeep
bansaldeep

asked on

How to declare LPBYTE type Pointer to a structure

I want to call a windows function -

BOOL AddPrinterDriver(
  LPTSTR pName,        // server name
  DWORD Level,         // driver information level
  LPBYTE pDriverInfo   // driver information buffer
);

from my program.
It requires 3rd argument as type LPBYTE which is a pointer to structure
containing printer driver information.The structure is:

typedef struct _DRIVER_INFO_3 {
  DWORD  cVersion;
  LPTSTR pName;
  LPTSTR pEnvironment;
  LPTSTR pDriverPath;
  LPTSTR pDataFile;
  LPTSTR pConfigFile;
  LPTSTR pHelpFile;
  LPTSTR pDependentFiles;
  LPTSTR pMonitorName;
  LPTSTR pDefaultDataType;
} DRIVER_INFO_3, *PDRIVER_INFO_3;

How do i declare a pointer to this structure so that i can populate
structure members and then how to pass this pointer to AddPrinterDriver function?

ASKER CERTIFIED SOLUTION
Avatar of BeyondWu
BeyondWu
Flag of United States of America image

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
Avatar of bansaldeep
bansaldeep

ASKER

Great!!!!It works.....
Hello,

Would you mind sharing the working code on this or assist me with a current Issue @
https://www.experts-exchange.com/questions/20446936/Converting-a-C-Function-to-a-VB-Function.html

I am getting a error 4 and it is driving me crazy.

Thank you,
Marcelo