|
i wrote a program that monitors the printer. and save how many pages were printed.
but i have a problem. Word XP has a bug, when i print a multiple copies (more than one), by using GetJob function, i don't get the number of copies. the dmCopies value in DEVMODE struct, is 1.
i can't sell my program when this bug not solved! ...
i thought about somehow to read the spooler file, but this is not generic...
somehow, Word XP sends the right number of copies to the printer, because the printer is printing the right number of copies.
but this info is not changed by Word XP in DEVMODE.
do you have any idea how to solve this?
please...
this is very important to me...
thank you very much.
|
|
|
|
|
Just a thought, but is Word maybe doing collation itself, by sending pages multiple times (instead of relying on the printer to collate)? Try printing with and without collation enabled in Word, and see if that has any effect...
---
the work, which will become a new genre unto itself, will be called...
|
|
|
|
|
my program use the FindNextPrinterNotification (i don't remember it exactly) to know when the user send something to the printer.
after that i'm waiting until it stop spooling and i pause the job and then i use GetJob() to get the information about this job.
there is the problem.
i don't get the correct number of copies if the program is Word XP. with all the other it's just fine.
i tried to change some of the Word XP options but nothing...
i think it's because Word XP don't use the generic Print Dialog like all other windows programs does.
if you have any idea...
i'm totally desperate.
please...
please...
thanks,
|
|
|
|
|
How can i from VC++ application receive text under the mouse pointer in web browser window , for example.
thank you in advance !
|
|
|
|
|
using Visual C++ 6.0 with MFC
I am using a RichEdit control as a simple editor.
I am not using word wrap so the lines extend beyond the width of the control.
Problem:
I often find that if I replace highlighted text or even just add text to an existing line the new text is not displayed. It appears to not repaint correctly. I need to insert a space at the beginning of the line, or otherwise make it move to get it to display the change.
Also often the scroll bars do not display even though the text is wider than the control. When the redisplay is corrected the scroll bars are also displayed.
Is there a simple solution to this?
Sara
|
|
|
|
|
Hi all,
I am building an application which has a log-in dialog. I need the menu and toolbar selections to be diabled in the beginning and i need them to be active only when a valid user logs in.
Can you please help me in achieving this?
Regards
Krugger
Krugger
|
|
|
|
|
Assuming you are using MFC, have a read about ON_UPDATE_COMMAND_UI.
Michael
But you know when the truth is told,
That you can get what you want or you can just get old,
Your're going to kick off before you even get halfway through.
When will you realise... Vienna waits for you? - "The Stranger," Billy Joel
|
|
|
|
|
Hi all;
I have an application which has a log-in menu. The whole stuff works fine but the only problem is that if a user hits "Escape" while my log-in menu is on, the thing just disappears leaving him/her with all the program functionality without even logging on the system!! Obviously something's going wrong! Can u please help me to stop the dialog from closing when i hit Escape.
Thank you guys;
Regards
Krugger
|
|
|
|
|
|
I use this approach:
BOOL CDejavuDlg::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->message == WM_KEYDOWN && (pMsg->wParam == VK_ESCAPE || pMsg->wParam == VK_RETURN))
return FALSE;
return CDialog::PreTranslateMessage(pMsg);
}
The word of the day is legs, let's go back to my house and spread the word
|
|
|
|
|
I am making a dialog box with MFC. I wan't to make a minimize box at design time. When I right click the dialog in the .rc and go to properties, the minimize box field is greyed out at "false". Anyone know how to make a minimize box? Any help is appreciated.
-Dev578
|
|
|
|
|
In order to have a minimize box option available, you must have the system menu flag set to true. This means the minimize, maximize and close buttons get drawed on the dialog caption. You can then set the minimize and maximize boxes on and off as you please, but you can't remove the close button.
If you only want the minimize button, you can draw it yourself on the dialog by overwriting the WM_NCPAINT message. To implement it, enable dialog title bar without the system menu, add a CButton for the minimize button, then override CWnd:OnNcPaint, allow the framework to execute the base class drawing first so that the standard frame is painted. Then draw/place the button.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hi .. if I want to open a SDL application from a MFC dialog based application what should i then do? .. rigth now i am just opening the .exe of the SDL application but then i cant share some values i need ..
|
|
|
|
|
There are several solutions. One solution is file-mapping. Another solution is via message - WM_COPYDATA.
Kuphryn
|
|
|
|
|
Hi .. if u launch a .exe file from a application it opens the .exe file over the application so its not visible .. is there a way to get the .exe file to open next to the application window so both windows are visible ?
|
|
|
|
|
Definitely.
One solution is CreateProcess(). Analyze the STARTUPINFO parameter.
Kuphryn
|
|
|
|
|
I am tried to wrote a program that listing windows created by a specified process, it base on EnumWindows And EnumChildWindows. But it does not exactly.
Spy++ show me that the top-level window of the process' "first-child" property is 0x00000000, but serveral child-window's "parent" is pointed to the top-level window.
Thanks a lot for any advices.
|
|
|
|
|
This is just a stab in the dark but did you try to get the desktop window and enumerate its children??
John
|
|
|
|
|
I had tried to GetDesktopWindow and than EnumChildWindows, But helpless.
Appreciate your help.
|
|
|
|
|
hi,
Can any one tell me how can i load images(.bmp,.jpeg) in listbox,
The images are dynamically generates. So i want to list all the images in the listbox.
Regards
Santosh.K
|
|
|
|
|
What does it mean I have no Idea what to do it doesn't even link me to a specific line
Price Calculator error LNK2001: unresolved external symbol "public: void __thiscall CPriceCalculatorDlg::OnEnChangeRetail(void)" (?OnEnChangeRetail@CPriceCalculatorDlg@@QAEXXZ)
|
|
|
|
|
This type of error is most common when you have declared a member function, but have not implemented it. Please see the CPriceCalculatorDlg class for a member function called OnEnChangeRetail .
If it exists in the header file, write an implementation code for it in the code file. If you don't need/want this member function:
1. Remove it's declaration from the header file
2. Put a '{}' after the declaration and remove the semicolon ending. This is same as writing an empty function to the implementation file
3. Declare the function as pure virtual, by adding 'virtual' keyword in front of it and an '=0' after it, before the ending semicolon.
If you have implemented this function, make sure it's name and the parameters passed to it match precisely.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Why do I always have problems with this...and I can never remember how I got it working the last time
Anyways...I have a menu in resource as a POPUP menu and I wish to load it when someone clicks a button...I understand I have to use TrackPopupMenu() and I have to Load the resource, but whenever the button is clicked...I get only a single skinny line representing the menu itself...
Can someone show me exact code required to display a context menu...when I have no menubar or any menu of any kind...just a popup menu resource which I load...
Thanks
The word of the day is legs, let's go back to my house and spread the word
|
|
|
|
|
Here is a complete, commented code fragment to help you out:
CMenu MyMenu;<DIV>
if ( MyMenu.LoadMenu( IDM_MENU1_RESOURCE ) )
{
CMenu* pTargetMenu = MyMenu.GetSubMenu( mySubMenuID );<DIV>
int iSelection = (int)pTargetMenu->TrackPopupMenuEx( TPM_LEFTALIGN | TPM_TOPALIGN | TPM_NONOTIFY | TPM_RETURNCMD,
xPos, yPox, pMainWindow, NULL );<DIV>
}<DIV>
pTargetMenu = NULL;
MyMenu.DestroyMenu(); In the above code example,
- IDR_MENU1_RESOURCE is the resource identifier
- mySubMenuID is the index of the menu you wish to launch (For example, on a default menu, the 'File' would be index number 0)
- xPos and yPos are screen coordinates where to launch the menu
- pMainWnd is a pointer to the window owning the menu. In this case, it can be any window of your application.
- iSelection is the selection made by the user, or zero if user cancelled the menu or an error occurred.
I used the approach of returning the selection value from the menu because in that way, we can make sure that the menu is properly destroyed and freed at the function end.
Alternatively, you can load the menu resource somewhere else in the program, such as the class's constructor and free it in the destructor. This way, you can handle the user's selection on a WM_COMMAND handler of your window, if needed. Also, in that case, pMainWnd must point to the window that has the handler.
Hope this will help you out. For additional info, see the CMenu class in MSDN Library.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Very cool thank you muchly
The word of the day is legs, let's go back to my house and spread the word
|
|
|
|