How to find and read spool file (*.SPL) of the network printer












0















I know how to find and read spool file of the local printer, but I don't know how to find and read the network spool file. How I can do this ?



Below is what I have now:



//I get all available printers using
EnumPrinters(flags, NULL, 2, (LPBYTE)prninfo, needed, &needed, &returned)

//then create a new Printer Change notification thread using
hThread = (HANDLE)_beginthreadex(NULL,
0,
NotificationUpdate,
(void *)hParam,
1,
&ThreadID);
return hThread;

//then when I receive notification messages like
switch(PRINTER_NOTIFY_INFO_DATA) {
case JOB_NOTIFY_FIELD_DEVMODE :
case JOB_NOTIFY_FIELD_STATUS:

//I'm able to get print JobID and look in the windows folder for SPL files with that ID

GetSystemDirectoryW(wszSpoolDirectory, MAX_PATH);
wszSpoolDirectory = windows System32 folder + spoolPRINTERS?????+JobID.SPL


I tried also to use GetSpoolFileHandle(hPrinter) function, but this return INVALID_HANDLE_VALUE



I don't know how to get spool file with *.SPL extension from LAN printer



How to find and read SPL file for network printer which is connect with router only via LAN Port ?










share|improve this question















migrated from superuser.com Feb 15 at 11:11


This question came from our site for computer enthusiasts and power users.



















  • Hi Ayay, if you can use JobID.SPL to get the spool file is the problem that you can't connect the network printer to add a print job or you can't get JobID?

    – Rita Han - MSFT
    Feb 20 at 9:31











  • Hi @RitaHan-MSFT, I can get spool status and other details of print job, but I don't know how to get spool file with *.SPL extension from network printer. I tried to use GetSpoolFileHandle(hPrinter) but this returns invalid handle

    – Ayay Matty
    Feb 22 at 22:47











  • Hi Ayay, can you call GetLastError() after GetSpoolFileHandle(hPrinter) and show the error code?

    – Rita Han - MSFT
    Feb 26 at 6:52
















0















I know how to find and read spool file of the local printer, but I don't know how to find and read the network spool file. How I can do this ?



Below is what I have now:



//I get all available printers using
EnumPrinters(flags, NULL, 2, (LPBYTE)prninfo, needed, &needed, &returned)

//then create a new Printer Change notification thread using
hThread = (HANDLE)_beginthreadex(NULL,
0,
NotificationUpdate,
(void *)hParam,
1,
&ThreadID);
return hThread;

//then when I receive notification messages like
switch(PRINTER_NOTIFY_INFO_DATA) {
case JOB_NOTIFY_FIELD_DEVMODE :
case JOB_NOTIFY_FIELD_STATUS:

//I'm able to get print JobID and look in the windows folder for SPL files with that ID

GetSystemDirectoryW(wszSpoolDirectory, MAX_PATH);
wszSpoolDirectory = windows System32 folder + spoolPRINTERS?????+JobID.SPL


I tried also to use GetSpoolFileHandle(hPrinter) function, but this return INVALID_HANDLE_VALUE



I don't know how to get spool file with *.SPL extension from LAN printer



How to find and read SPL file for network printer which is connect with router only via LAN Port ?










share|improve this question















migrated from superuser.com Feb 15 at 11:11


This question came from our site for computer enthusiasts and power users.



















  • Hi Ayay, if you can use JobID.SPL to get the spool file is the problem that you can't connect the network printer to add a print job or you can't get JobID?

    – Rita Han - MSFT
    Feb 20 at 9:31











  • Hi @RitaHan-MSFT, I can get spool status and other details of print job, but I don't know how to get spool file with *.SPL extension from network printer. I tried to use GetSpoolFileHandle(hPrinter) but this returns invalid handle

    – Ayay Matty
    Feb 22 at 22:47











  • Hi Ayay, can you call GetLastError() after GetSpoolFileHandle(hPrinter) and show the error code?

    – Rita Han - MSFT
    Feb 26 at 6:52














0












0








0


2






I know how to find and read spool file of the local printer, but I don't know how to find and read the network spool file. How I can do this ?



Below is what I have now:



//I get all available printers using
EnumPrinters(flags, NULL, 2, (LPBYTE)prninfo, needed, &needed, &returned)

//then create a new Printer Change notification thread using
hThread = (HANDLE)_beginthreadex(NULL,
0,
NotificationUpdate,
(void *)hParam,
1,
&ThreadID);
return hThread;

//then when I receive notification messages like
switch(PRINTER_NOTIFY_INFO_DATA) {
case JOB_NOTIFY_FIELD_DEVMODE :
case JOB_NOTIFY_FIELD_STATUS:

//I'm able to get print JobID and look in the windows folder for SPL files with that ID

GetSystemDirectoryW(wszSpoolDirectory, MAX_PATH);
wszSpoolDirectory = windows System32 folder + spoolPRINTERS?????+JobID.SPL


I tried also to use GetSpoolFileHandle(hPrinter) function, but this return INVALID_HANDLE_VALUE



I don't know how to get spool file with *.SPL extension from LAN printer



How to find and read SPL file for network printer which is connect with router only via LAN Port ?










share|improve this question
















I know how to find and read spool file of the local printer, but I don't know how to find and read the network spool file. How I can do this ?



Below is what I have now:



//I get all available printers using
EnumPrinters(flags, NULL, 2, (LPBYTE)prninfo, needed, &needed, &returned)

//then create a new Printer Change notification thread using
hThread = (HANDLE)_beginthreadex(NULL,
0,
NotificationUpdate,
(void *)hParam,
1,
&ThreadID);
return hThread;

//then when I receive notification messages like
switch(PRINTER_NOTIFY_INFO_DATA) {
case JOB_NOTIFY_FIELD_DEVMODE :
case JOB_NOTIFY_FIELD_STATUS:

//I'm able to get print JobID and look in the windows folder for SPL files with that ID

GetSystemDirectoryW(wszSpoolDirectory, MAX_PATH);
wszSpoolDirectory = windows System32 folder + spoolPRINTERS?????+JobID.SPL


I tried also to use GetSpoolFileHandle(hPrinter) function, but this return INVALID_HANDLE_VALUE



I don't know how to get spool file with *.SPL extension from LAN printer



How to find and read SPL file for network printer which is connect with router only via LAN Port ?







winapi language-agnostic






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 22 at 23:26









Ken White

108k11156321




108k11156321










asked Feb 15 at 10:46









Ayay MattyAyay Matty

113




113




migrated from superuser.com Feb 15 at 11:11


This question came from our site for computer enthusiasts and power users.









migrated from superuser.com Feb 15 at 11:11


This question came from our site for computer enthusiasts and power users.















  • Hi Ayay, if you can use JobID.SPL to get the spool file is the problem that you can't connect the network printer to add a print job or you can't get JobID?

    – Rita Han - MSFT
    Feb 20 at 9:31











  • Hi @RitaHan-MSFT, I can get spool status and other details of print job, but I don't know how to get spool file with *.SPL extension from network printer. I tried to use GetSpoolFileHandle(hPrinter) but this returns invalid handle

    – Ayay Matty
    Feb 22 at 22:47











  • Hi Ayay, can you call GetLastError() after GetSpoolFileHandle(hPrinter) and show the error code?

    – Rita Han - MSFT
    Feb 26 at 6:52



















  • Hi Ayay, if you can use JobID.SPL to get the spool file is the problem that you can't connect the network printer to add a print job or you can't get JobID?

    – Rita Han - MSFT
    Feb 20 at 9:31











  • Hi @RitaHan-MSFT, I can get spool status and other details of print job, but I don't know how to get spool file with *.SPL extension from network printer. I tried to use GetSpoolFileHandle(hPrinter) but this returns invalid handle

    – Ayay Matty
    Feb 22 at 22:47











  • Hi Ayay, can you call GetLastError() after GetSpoolFileHandle(hPrinter) and show the error code?

    – Rita Han - MSFT
    Feb 26 at 6:52

















Hi Ayay, if you can use JobID.SPL to get the spool file is the problem that you can't connect the network printer to add a print job or you can't get JobID?

– Rita Han - MSFT
Feb 20 at 9:31





Hi Ayay, if you can use JobID.SPL to get the spool file is the problem that you can't connect the network printer to add a print job or you can't get JobID?

– Rita Han - MSFT
Feb 20 at 9:31













Hi @RitaHan-MSFT, I can get spool status and other details of print job, but I don't know how to get spool file with *.SPL extension from network printer. I tried to use GetSpoolFileHandle(hPrinter) but this returns invalid handle

– Ayay Matty
Feb 22 at 22:47





Hi @RitaHan-MSFT, I can get spool status and other details of print job, but I don't know how to get spool file with *.SPL extension from network printer. I tried to use GetSpoolFileHandle(hPrinter) but this returns invalid handle

– Ayay Matty
Feb 22 at 22:47













Hi Ayay, can you call GetLastError() after GetSpoolFileHandle(hPrinter) and show the error code?

– Rita Han - MSFT
Feb 26 at 6:52





Hi Ayay, can you call GetLastError() after GetSpoolFileHandle(hPrinter) and show the error code?

– Rita Han - MSFT
Feb 26 at 6:52












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54708054%2fhow-to-find-and-read-spool-file-spl-of-the-network-printer%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54708054%2fhow-to-find-and-read-spool-file-spl-of-the-network-printer%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How do I know what Microsoft account the skydrive app is syncing to?

When does type information flow backwards in C++?

Grease: Live!