Windows api enumprintersw9/18/2023 You can't just go around declaring variables which match the function prototype, you have to think about how those parameters are going to be used.ĭo you know what the annotation _Out_ even means? > "A null reference was passed to the stub" Can someone help me understand what's wrong with this code? I have no idea what that is talking about, since I don't understand what it refers to when it says "stub". "A null reference was passed to the stub" My problem is EnumPrinters fails with error 1780 : I've written some code to create a temporary text file( I haven't gotten to the actual printing yet, so I'm leaving it empty) also. }I decided to try to make my own code for printing a text document on the local printer. If ( remove(FILE_NAME) ) perror("Deleting file") ReturnValue = EnumPrinters(PRINTER_ENUM_LOCAL, NULL, 4, printerInfo, sizeof(PRINTER_INFO_4), bytesNeeded, bytesCopied ) PrinterInfo = malloc(sizeof(PRINTER_INFO_4)) MessageBox(NULL, (LPCTSTR)lpDisplayBuf, TEXT("Error"), MB_OK) (lstrlen((LPCTSTR)lpMsgBuf) + lstrlen((LPCTSTR)lpszFunction) + 40) * sizeof(TCHAR)) LpDisplayBuf = (LPVOID)LocalAlloc(LMEM_ZEROINIT, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), * Retrieve the system error message for the last-error code */
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |