Hey all,
i am new to c++ but there is something that eludes me.
i am using Dev-C++ 4.9.9.2 and my dll doesn't want to compile.
for some odd reason i have an undefined reference to enumPrintersA
Below is the code i use.
Code:
#include "Helloworld.h"
#include <windows.h>
#include <stdio.h>
#include <Winspool.h>
BOOL APIENTRY DllMain (HINSTANCE hInst /* Library instance handle. */ ,
DWORD reason /* Reason this function is being called. */ ,
LPVOID reserved /* Not used. */ )
{
switch (reason)
{
case DLL_PROCESS_ATTACH:
break;
case DLL_PROCESS_DETACH:
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
}
/* Returns TRUE on success, FALSE on failure */
return TRUE;
}
JNIEXPORT void JNICALL Java_Helloworld_displayMessage
(JNIEnv *, jobject)
{
DWORD dwNeeded, dwReturned;
PRINTER_INFO_4 * pinfo4;
DWORD dwBytes = 0;
DWORD dwStatus = 0;
DWORD dwSize = 0;
PRINTER_INFO_2* pPrnInfo2 =0;
DEVMODE DevMode = {0};
PRINTER_DEFAULTS PrnDef = {0, &DevMode, PRINTER_ACCESS_USE};
EnumPrinters(PRINTER_ENUM_LOCAL, NULL, 4 , (PBYTE) pinfo4, dwNeeded, &dwNeeded, &dwReturned);
printf(pinfo4->pPrinterName);
}
thanks in advance for your replies