|
I ran into similar issues with a serial port printer and one connected to the parallel port. It turns out all 'suggestions' I discovered at Microsoft or on the Internet pointed to writing a 'printer monitor' type of driver. The notion was that the actual 'status' did not 'percolate' all the way up to this function call which should OBVIOUSLY be receiving the status. So, what I am trying to say is that I don't think your problem is specific only to the USB printer.
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|
|
Hi,
I want to have a palette which will have some icons.. As I click the icon the command will become active.. if I kept the left mouse button pressed, I will see the sub command Icons from which any icon can be selected by moving pressed mouse button.. this sub palette can be dragged out too to have sub palette.
Thanks
Lee
|
|
|
|
|
I'm holding on learning how to make dll files, and now i have desided to move my settings dialog into a project of its own, and load it when i need it, otherwise keep it unloaded. I got a problem though. I am using a friend om mines sourcecode, and he is using extern CAppModule _Module; in the executeable, and _Module is used in the settings dialog:
<br />
_Module.AddSettingChangeNotify(pThis->m_hWnd);<br />
When i compile the dialog i get this error:
<br />
error C2065: '_Module' : undeclared identifier<br />
My problem is: How do i get _Module into my new project?
Nicolai Mortensen
|
|
|
|
|
Probabily you should declared it as extern variable. Don't know.
|
|
|
|
|
It is declared as extern in the original project.
|
|
|
|
|
Maybe the main project needs a header file with the original declaration. Try it!
|
|
|
|
|
The class CComModule is part of ATL - CAppModule is a wizard generated class derived from CComModule which is used in EXE projects. Given that you're learning DLLs we'll concentrate on CComModule . Follow these steps:
1. In your "stdafx.h" file, after the #include <atlbase.h> add the following line:
extern CComModule _Module;
2. In one of your .CPP files (normally the one that contains the DLL entry point) add the following at global scope:
CComModule _Module;
3. In the DLL_PROCESS_ATTACH fork of your DllMain add the following:
_Module.Init(NULL, hinstDLL);
4. In the DLL_PROCESS_DETACH fork add the following:
_Module.Term();
Normally the wizard does all this boiler plate stuff when you generate the project (ATL project).
Steve
|
|
|
|
|
Thank you, that did the trick
|
|
|
|
|
Hi,
I have a prob.I created a List Ctrl from CListCtrl.It contains default scroll bar.While Horizontal Scrolling i have to fix ( that is i don't want them to move) the first
three columns and all the others have to scroll.
cheers
Dinu John
-- modified at 6:40 Wednesday 29th March, 2006
|
|
|
|
|
ListControl doesn't directly support static columns, the only way I can think of doing it would be by using it as a virtual list and getting clever with it... Probobly to much work for little gain though.
IMO your going to be better off attacking it from a different angle and using a control pre-designed to handle static columns, such as the excellent CGridCtrl[^] control written by Chris M.
Gavin Taylor
w: http://www.gavspace.com
|
|
|
|
|
Hi
I have wrote one dialog based MFC application which i run on Windows 2000 Professional.
In this application i capture different windows messges. I want to do certaing things when the power cable is removed from laptop and it automatically switches to battery status. And again I want to get notification when power becomes available.
For this I use WM_POWERBROADCAST message. I have written one function as
LRESULT OnMessagePowerBroadcast(WPARAM wParam, LPARAM lParam);
Declared in my header file.
And applied as
LRESULT MyClass::OnMessagePowerBroadcast(WPARAM wParam, LPARAM lParam)
{
MessageBox("WM_POWERBROADCAST");
return 0;
}
BEGIN_MESSAGE_MAP(MyClass, CDialog)
ON_MESSAGE(WM_POWERBROADCAST, OnMessagePowerBroadcast)
END_MESSAGE_MAP()
Here I get notification whenever my laptop switches from power to battery. But the problem is : It shows me message box even when power get in. for this I use wParam and compare it with the given values, and I get PBT_APMPOWERSTATUSCHANGE all the time. How to distinguish that Power is in or power is out?
Right now it gives me same message as ( "WM_POWERBROADCAST")even when power is in and when it's out.
Any idea how to distinguish it?
Regards,
Mahesh
|
|
|
|
|
Well I haven't gone through this[^]. Hope it helps.
Nibu thomas
Software Developer
|
|
|
|
|
Thank you very much for taking time read my question.
Regards,
Mahesh
Mahesh
|
|
|
|
|
Amarelia wrote: I want to do certaing things when the power cable is removed from laptop and it automatically switches to battery status. And again I want to get notification when power becomes available.
Check out the ISensOnNow interface.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hello guys;
have got a bench of simple questions regarding dialog boxes i hope you 'll be generous enough to answer some/all of them.
A description of the problem: I am trying to build a simple MFC application in which the user has to input some data (ie. x,y,z coordinates). I however dont want the user to directly interact/use the main application (which will be used for a different purpose) but to use another dialog. As i am very novice to WinAPI, i thought a good way to get the input is through a child dialog (**Please if there is a better way let me know**). I chose a Modal dialog because i want to disable the main application while the user is providing the input.
Question One:. upon creation of a modal dialog (Style: Child) I can not use it all, all application freezes including the dialog child !!! how can i solve this issue ?
Question Two:. In a desprate try to solve this issue, i created an other modal dialog but this time (Style: Popup). and it works fine
Can someone please explain whats the difference between Style: Child Vs Popup apart from the visual appearance !!! ie. properties and characteristics of each.
My Key question is: Which style would you prefer to use in my case???
many thanks
llp00na
-- modified at 6:30 Wednesday 29th March, 2006
|
|
|
|
|
llp00na wrote: In a desprate try to solve this issue, i created an other modal dialog but this time (Style: Popup). and it works fine
Can someone please explain whats the difference between Style: Child Vs Popup apart from the visual appearance !!! ie. properties and characteristics of each.
Yeah the visual appearance is the main difference. Child comes embedded inside the parent window, while a popup can move freely around.
I guess you are doing something wrong hence your application freezes.
Nibu thomas
Software Developer
|
|
|
|
|
so are you implying that child dialogs do not offer extra functionality ?
Do i understand that using a child dialog to get the user input does not provide critical advantage if a popup dialog is used instead?
llp00na
|
|
|
|
|
llp00na wrote: so are you implying that child dialogs do not offer extra functionality ?
No! They are quite same when it comes to what they offer.
llp00na wrote: Do i understand that using a child dialog to get the user input does not provide critical advantage if a popup dialog is used instead?
Well IMO there is no advantage. Well why do you wish to use a child dialog? Popup does better!
Nibu thomas
Software Developer
|
|
|
|
|
As i mentioned before, i am very novice toWinAPI. I carelessly tought the child dialog wopuld be more apropriaty pe to serve murpose. I also felt it would be more easier to transfer messages accross the main application and a child dialog which receives the input from a user.
Now that you explained to me that there is no/marginal difference, i will cetainly be using a popup dialog.
I am very thankfull
llp00na
|
|
|
|
|
llp00na wrote: Question One
Create a Modeless dialog instead of a Modal dialog.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
i need a modal dialog. i dont want the user to use the main application while entering data
llp00na
|
|
|
|
|
How Can I Read CakeWalk's wrk File?
I need read data from wrk,but I don't know the wrk file's format.
Someone Could Tell me how to read wrk file and its format(structure)?
|
|
|
|
|
|
How Can I Read Midi File?
I need read score data from Midi File,but I don't know the Midi file's format.
Someone Could Tell me how to read Midi file and its format(structure)?
|
|
|
|
|