Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. printer related code

printer related code

Scheduled Pinned Locked Moved C#
helpdatabasesysadmintutorialcareer
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cishi_us
    wrote on last edited by
    #1

    Hi all, i am developing a software ,,which will helpfull for the network administrator in such a way that....it will provide efficiency to the printer.. my software is explained as this software will restrict the user to use the printer....for example... the network administrator will provide a database for the user that e.g, "abc" user can only print 3 pages...if user send 4 number of prints from any place means from network or any software then then the message box come to the user that u r restricted to use on 3 pages...the boundries of such software are completed.....the main module that when the user send the print job to printer then the job should cancelled and read the database and according to that data base there will be printing pages to certain users... So i have to take help that ....plz made me this help that this module i m tying a lot ..but not happening that the job should canelled first of the printer and then job according to database apply...please programmes help me .I will very thankful to all...I will wait for yours response and the code also related to this module.. Lot of thanx for solving my problem

    D 1 Reply Last reply
    0
    • C cishi_us

      Hi all, i am developing a software ,,which will helpfull for the network administrator in such a way that....it will provide efficiency to the printer.. my software is explained as this software will restrict the user to use the printer....for example... the network administrator will provide a database for the user that e.g, "abc" user can only print 3 pages...if user send 4 number of prints from any place means from network or any software then then the message box come to the user that u r restricted to use on 3 pages...the boundries of such software are completed.....the main module that when the user send the print job to printer then the job should cancelled and read the database and according to that data base there will be printing pages to certain users... So i have to take help that ....plz made me this help that this module i m tying a lot ..but not happening that the job should canelled first of the printer and then job according to database apply...please programmes help me .I will very thankful to all...I will wait for yours response and the code also related to this module.. Lot of thanx for solving my problem

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      cishi_us wrote: I will wait for yours response and the code also related to this module.. Lot of thanx for solving my problem Uhhh.... YOU have to write the code, we're not doing it for you. You solve your own problems, we just help. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      C 1 Reply Last reply
      0
      • D Dave Kreskowiak

        cishi_us wrote: I will wait for yours response and the code also related to this module.. Lot of thanx for solving my problem Uhhh.... YOU have to write the code, we're not doing it for you. You solve your own problems, we just help. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        C Offline
        C Offline
        cishi_us
        wrote on last edited by
        #3

        well sir sure i like to take urs help...i have just reaced to my destiny as well but some problems occuring in it..... i m writing here u code and plz try to help me...The problem occuring on following places..please read code i m writing where the problem is occuring.. /////////////////////////////////////////////////////////////////// try { PropertyDataCollection __gc *pdc = e->NewEvent->get_Properties(); PropertyDataCollection::PropertyDataEnumerator __gc *pdce = pdc->GetEnumerator(); while(pdce->MoveNext()) { PropertyData __gc *pd = pdce->get_Current(); ManagementBaseObject __gc *mbo = dynamic_cast(pd->get_Value()); 1) problem***************problem occuring on the below if statement.not all time but some time the mbo variable does not declare and by using watches i see that mbo is undeclared value.its some time ... and printer does not pause..*********************************** if( mbo != NULL && mbo->ClassPath->ToString()->ToUpper()->EndsWith(S"WIN32_PRINTJOB") ) { ///// //pause job long a=0; long *hprinter = &a; for(int i=0 ; iprintersname->Length ; i++) { try { int result = PrinterAPIs::OpenPrinter(this->printersname[i], hprinter, NULL); bool resultf = PrinterAPIs::SetJob(*hprinter, (long)Int64::Parse( mbo->Properties->get_Item(S"Jobid")->Value->ToString() ), 0, NULL, 1); PrinterAPIs::ClosePrinter(*hprinter); MessageBox::Show(this, mbo->Properties->get_Item(S"Owner")->Value->ToString()); ***************************************************************************** 2) Below message box is not showing the correct number of pages that comes from print status that come in task bar when a pages are going to print.*************************************** MessageBox::Show(this, mbo->Properties->get_Item(S"TotalPages")->Value->ToString()); if(resultf == true) break; } catch(Exception __gc *ex) { MessageBox::Show(this, ex->ToString()); ex = NULL; }

        D 1 Reply Last reply
        0
        • C cishi_us

          well sir sure i like to take urs help...i have just reaced to my destiny as well but some problems occuring in it..... i m writing here u code and plz try to help me...The problem occuring on following places..please read code i m writing where the problem is occuring.. /////////////////////////////////////////////////////////////////// try { PropertyDataCollection __gc *pdc = e->NewEvent->get_Properties(); PropertyDataCollection::PropertyDataEnumerator __gc *pdce = pdc->GetEnumerator(); while(pdce->MoveNext()) { PropertyData __gc *pd = pdce->get_Current(); ManagementBaseObject __gc *mbo = dynamic_cast(pd->get_Value()); 1) problem***************problem occuring on the below if statement.not all time but some time the mbo variable does not declare and by using watches i see that mbo is undeclared value.its some time ... and printer does not pause..*********************************** if( mbo != NULL && mbo->ClassPath->ToString()->ToUpper()->EndsWith(S"WIN32_PRINTJOB") ) { ///// //pause job long a=0; long *hprinter = &a; for(int i=0 ; iprintersname->Length ; i++) { try { int result = PrinterAPIs::OpenPrinter(this->printersname[i], hprinter, NULL); bool resultf = PrinterAPIs::SetJob(*hprinter, (long)Int64::Parse( mbo->Properties->get_Item(S"Jobid")->Value->ToString() ), 0, NULL, 1); PrinterAPIs::ClosePrinter(*hprinter); MessageBox::Show(this, mbo->Properties->get_Item(S"Owner")->Value->ToString()); ***************************************************************************** 2) Below message box is not showing the correct number of pages that comes from print status that come in task bar when a pages are going to print.*************************************** MessageBox::Show(this, mbo->Properties->get_Item(S"TotalPages")->Value->ToString()); if(resultf == true) break; } catch(Exception __gc *ex) { MessageBox::Show(this, ex->ToString()); ex = NULL; }

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          You do realize this is the C# forum, right? Visual C++ is over here[^]!! RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups