ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to call this DLL? (https://www.excelbanter.com/excel-programming/397147-how-call-dll.html)

Paul Lenz

How to call this DLL?
 
I want to use a DLL in a VBA program.

The programmer of the DLL provided these infos:

| PWDBCEGetInfo
| Query ActiveSync to retrieve information about PathAway
| on the device.
|
| PWInt32
| PWDBCEGetInfo(
| PWUInt32 flags,
| PWUInt32 *pState,
| char *pData
| );
|
| Parameters:
| flags - [in] flags specifying the type of information to be
| returned.
| pState - [out] returns status result state based on flags
| settings
| pData - [out] returns pointer to data based on the the flags
| settings
| char * String
| If pData is not NULL, then the program path is returned.
| Pdata must be previously allocated to hold 256 characters.
|
| Return Values
| 0 indicates success. Otherwise a negative number indicating
| failure.
|
| Examples
|
| To determine if PathAway is installed:
| PWDBCEGetInfo(PROGRAMINFO_FLAG_GETSTATE, &dwState, pPath);

I can not find out how to code this in VBA. Either I get an errror
message about wrong calling of the DLL, or Excel crashes.

I suppose the problem is the 256 char string, but I have no idea how
to handle it correctly. How must I declare the function and how must
I call it?

Thanks for any help.

Paul Lenz



All times are GMT +1. The time now is 05:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com