|
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)?
|
|
|
|
|
|
|
Did someone have source code to extract midi file?
|
|
|
|
|
|
|
PCHAR a ;<br />
a = NULL ;<br />
<br />
PCHAR b = new char[10]<br />
a = b ;<br />
<br />
delete [] b ;<br />
delete [] a ;
If I have the above code then what happens? What will a = b do? Will delete [] b remove the value in memory for a too?
Thanks...
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
LazyKancha wrote: delete [] b ;
it deletes the char array
but the second statement is invalid, because it's already deleted.
and Yes, a = b; will assing the char array 'b' to variable 'a'.
|
|
|
|
|
This will result in a crash. The instruction a=b will simply change the address to which a points. So, a will point exactly at the same address than b.
So doing:
delete [] b ;
delete [] a ;
is the same as doing:
delete [] b ;
delete [] b ;
Which tries to free memory that has already been freed.
|
|
|
|
|
a = b assigns only the address pointed to by b into a .
so, both a and b point the same memory address after the = instruction.
if you delete[] b , then delete[] a should fail as the memory is already delete d
|
|
|
|
|
What about a memcpy instead of a = b?
Thanks for your answers...
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|