Jump to content

Using DLLs


Recommended Posts

Where would you go to learn about using dlls.

I have a header file for a dll but I don't really understand what I would do to use it.

Here is a bit from the file does this actually mean anything to anybody?

CODE

/********************************************************************************/

/* FunctionName : MCP_Init */

/* FunctionType : DWORD MCP_Init(void); */

/* Arguments : */

/* ReturnValue : DWORD; */

/* MCP_OK : OK, Else : Error info. */

/* Description : Initialize SDK printer control. */

/* Notes : */

/* CREATE 2005/03/17 */

/********************************************************************************/

DWORD WINAPI MCP_Init(void);

/********************************************************************************/

/* FunctionName : MCP_Finish */

/* FunctionType : DWORD MCP_Finish(void); */

/* Arguments : */

/* ReturnValue : DWORD; */

/* MCP_OK : OK, Else : Error info. */

/* Description : Finish SDK printer control. */

/* Notes : */

/* CREATE 2005/03/17 */

/********************************************************************************/

DWORD WINAPI MCP_Finish(void);

/********************************************************************************/

/* FunctionName : MCP_EnumPrinter */

/* FunctionType : DWORD MCP_EnumPrinter(PUINT puiNumPrinter, PHANDLE phPrinter);*/

/* Arguments : puiNumPrinter [iN] Number of printer handles want to get. */

/* [OUT] Number of found printer handles. */

/* phPrinter [OUT] Printer handles array. */

/* ReturnValue : DWORD; */

/* MCP_OK : OK, Else : Error info. */

/* Description : Search target printers. */

/* Notes : */

/* CREATE 2005/03/17 */

/********************************************************************************/

DWORD WINAPI MCP_EnumPrinter(PUINT puiNumPrinter, PHANDLE phPrinter);

/********************************************************************************/

/* FunctionName : MCP_OpenPrinter */

/* FunctionType : DWORD MCP_OpenPrinter(HANDLE hPrinter, DWORD dwIdleTimeout); */

/* Arguments : hPrinter [iN] Handle of printer. */

/* dwIdleTimeout [iN] Idle timeout setting. (Second) */

/* (Set MCP_TIMEOUT_INFINITE.) */

/* ReturnValue : DWORD; */

/* MCP_OK : OK, Else : Error info. */

/* Description : Start control specified printer. (Connect printer) */

/* Notes : */

/* CREATE 2005/03/17 */

/********************************************************************************/

DWORD WINAPI MCP_OpenPrinter(HANDLE hPrinter, DWORD dwIdleTimeout);

Link to comment
Share on other sites

Dllcall has documentation for what to do. I'm no expert but i guess for this function somthing like this should work...

DllCall ( "dllname", "DWORD", "MCP_Init")

thanks thats what I thought for that one, I dont get this though DWORD WINAPI MCP_EnumPrinter
Link to comment
Share on other sites

thanks thats what I thought for that one, I dont get this though DWORD WINAPI MCP_EnumPrinter

/********************************************************************************/
/* FunctionName : MCP_EnumPrinter                                              */
/* FunctionType : DWORD MCP_EnumPrinter(PUINT puiNumPrinter, PHANDLE phPrinter);*/
/* Arguments    : puiNumPrinter [IN]  Number of printer handles want to get.    */
/*                            [OUT] Number of found printer handles.          */
/*              phPrinter    [OUT] Printer handles array.                   */
/* ReturnValue  : DWORD;                                                        */
/*                    MCP_OK : OK,  Else : Error info.                      */
/* Description  : Search target printers.                                      */
/* Notes        :                                                              */
/*                                    CREATE      2005/03/17          */
/********************************************************************************/
DWORD WINAPI MCP_EnumPrinter(PUINT puiNumPrinter, PHANDLE phPrinter);

Hmm... Maybe something like:

$aResult = DllCall("DllName", DWORD, "MCP_EnumPrinter", "int_ptr", 9999, "ptr", 0)
ConsoleWrite("Return result .......: " & $aResult[0])
ConsoleWrite("Handles found .......: " & $aResult[1])
ConsoleWrite("Printer array pointer: " & $aResult[2])
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...