CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    May 2011
    Location
    India
    Posts
    18

    Unhappy Problem with Printer Status Box

    Dear All ,

    A strange problem related to Printer Status Box. While printing a page , printer status box showing last two message strings wrong.

    The dialog box shows ,

    Printing

    Test

    on the

    Samsung CLP-320 series

    .................

    ..................

    These last two lines are wrong. They should be

    On uSB Port 001

    Page 1


    I am using Unicode.


    PL help at earliest.

    Thanking you ,

    Manisha

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: Problem with Printer Status Box

    What is "Printer Status Box"?
    How do you display it?
    Victor Nijegorodov

  3. #3
    Join Date
    May 2011
    Location
    India
    Posts
    18

    Re: Problem with Printer Status Box

    While printing a document , after selecting file and printer , MFC displays this dialog box.
    It just displays information of processing pages. This is displayed after OnPreparePrinting
    and before OnPrint.

  4. #4
    Join Date
    May 2011
    Location
    India
    Posts
    18

    Re: Problem with Printer Status Box

    Dear Victor ,

    After OnPreparePrinting , to show Printing Status Dialog box, MFC is using variable nFormatID.

    The code is nFormatID = AFX_IDS_PRINTONPORT . The ID of AFX_IDS_PRINTONPORT is 61504.

    and one of my strings in string table is also having ID 61504.

    Naturally , instead of port info , the dialog is displaying my string.

    Now I dont know what to do ? I reinstalled the printer , didn't help.

  5. #5
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: Problem with Printer Status Box

    Quote Originally Posted by ManishaSantosh View Post
    After OnPreparePrinting , to show Printing Status Dialog box, MFC is using variable nFormatID.
    The code is nFormatID = AFX_IDS_PRINTONPORT . The ID of AFX_IDS_PRINTONPORT is 61504.

    and one of my strings in string table is also having ID 61504.
    It is not good...
    MSDN recommended to use the range 1 -> 0x7FFF for the string resources with IDS_, IDP_ prefix to avoid the conflicts with system resource IDs
    Quote Originally Posted by ManishaSantosh View Post
    Now I dont know what to do ?
    Open your resource.h file and manually chang the ID for your string from 61504 to something < 32767.
    Then do Rebuild All
    Last edited by VictorN; June 6th, 2012 at 06:36 AM. Reason: Typo correction
    Victor Nijegorodov

  6. #6
    Join Date
    May 2011
    Location
    India
    Posts
    18

    Re: Problem with Printer Status Box

    Thankx a lot victor ,

    I will try and remember it definately .. I will avoid IDS Tag ..

  7. #7
    Join Date
    May 2011
    Location
    India
    Posts
    18

    Re: Problem with Printer Status Box

    Problem solved .. Conflict removed ..

    But when I created String Table , I just gave ID ..

    I used IDS_ tag but the value was generated by MFC ..

    Then why was the conflict ?

    I will start my strings with ID suggested by you in future.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured