|
thanx a ton 4 ur early reply
but is there any other way to do such a task.
bcoz if i can just know whether it is a logoff event or a system shutdown.
i can't know about a system restart
any clues!!!!!!!!!
regards
|
|
|
|
|
I'm not sure about a system restart. The docs state that the lParam value is a bitmask, and they only mention the ENDSESSION_LOGOFF value, but there may be another bit defined in the system is restarting. You could just run a few tests, by storing the value of this parameter as you try some shutdowns and restarts. Remember that if you return 0, the shutdown or restart won't actually take place, so you won't have to wait for it each time. Other than that, I'm not sure about detecting a restart. Sorry...
Ryan
He who laughs last thinks too slowly.
|
|
|
|
|
Hello,
Any body has idea how to implement MSN like Emoticon list
Regards.
The Phantom is Tracking Bullets
|
|
|
|
|
you can make an owner drawn menu .. or better use a modelless dialog box with picture box controls on it
|
|
|
|
|
I develop an MFC application, a plain simple window (non-doc View). I want to add an edit child control on this parent window. For this purpose i need to call CEdit::Create() in order to place control.
Now, I want to change the behaviour of edit control, for this purpose i derive my own class myedit from CEdit i.e class myedit:public CEdit . Then i add the member variable of myedit , m_myedit in project. Now do i need to call m_myedit.SubclassWindow() before calling m_myedit.Create() ???? Under what cases we need to call SubclassWindow/SubClassDlgItem() ????
|
|
|
|
|
Shah Shehpori wrote:
Now do i need to call m_myedit.SubclassWindow() before calling m_myedit.Create() ?
Nope! MFC takes care of subclassing the control as it is created when you call Create() .
Shah Shehpori wrote:
Under what cases we need to call SubclassWindow/SubClassDlgItem() ?
If the control were already created but did not have an MFC class attached to it, you would then need to sublclass it in order for your custom class to receive messages sent to it.
---
My whole life I've practiced the art of self-sabotage -- fearing success perhaps even more than fearing failure. I think I have got this flareup resolved, but I'm constantly waiting to see what new and exciting ways I can spoil my chances for a better life.
- koreykruse, Compulsive Skin Picking
|
|
|
|
|
be deriving a control when you set the veriable type to the derived type the sublassing is automatic .
on presubclasswindow()
{
//make any modifications before your control is subclassed
}
I am the mighty keeper of the book on knowledge . Contact me to get your copy .
|
|
|
|
|
Hi everybody
I have made a Listbox in which I have populated some string values.I want to read these string values from the list box and then after matching the value to some criteria I want to add the specific matched valued to another Dialog control. How can I do so. Plz provide me with the code if possible. It would be nice of u.
Reply me soon
|
|
|
|
|
|
This is One Example from MSDN just check it out
Example
// The pointer to my list box.
extern CListBox* pmyListBox;
// Dump all of the items in the list box.
#ifdef _DEBUG
CString str, str2;
int n;
for (int i=0;i < pmyListBox->GetCount();i++)
{
n = pmyListBox->GetTextLen( i );
pmyListBox->GetText( i, str.GetBuffer(n) );
str.ReleaseBuffer();
str2.Format(_T("item %d: %s\r\n"), i, str.GetBuffer(0));
afxDump << str2;
}
#endif
|
|
|
|
|
My program has to update the resource in the .exe file under Win98? What can I do?
stanley
|
|
|
|
|
You can load the Image File using win32 APIs.Then there is a section called .RSRC (Resource Section).Use Image header. Then you can manupulate the things..but then you have to take care of the file size and respective RVA's..
|
|
|
|
|
from MSDN:
The UpdateResource function adds, deletes, or replaces a resource in an executable file.
Update for win9x: UpdateResourceW is supported by the Microsoft Layer for Unicode. To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems.
That means you can use the UpdateResourceW function after adding those files.
|
|
|
|
|
But I am sorry that which files are neccesary. Can you tell me which files are must added to my program? Help me, please.
stanley
|
|
|
|
|
Thank you! The problem is gotten rid of.
stanley
|
|
|
|
|
I am a newbie so bear with me. I have a dialog that launches another dialog(modal). This second dialog collects and wraps user data into a data structure. I want to pass this data structure back to the original dialog that launched it. The default ctor for the second dialog takes a pointer to a cwnd which is the parent. How can I do this? Should I create another ctor in the 2nd dialog that takes in a pointer to the parent and have a callback, or does studio provide an easier way. Thank you!
|
|
|
|
|
There are lots of ways of doing this. One way is to create the data structure in the parent dialog, and pass in a pointer or reference to it in the constructor of the second dialog. Then the second dialog modifies the reference directly so when DoModal() returns, the data structure contains all the user data already.
Dave
|
|
|
|
|
This way the user can not cancel the dialog, as changes have already been performed.
Please seem my other post for a different possibility.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
IMHO it is easiest to have a SetData() and a GetData() function in your second dialog class, which takes/returns a data structure. If your second dialog returns IDOK you use the data returned from GetData() , if it returns IDCANCEL , you throw it away.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
I am a professional, but unfortunately junior, developer, and I'm looking to do something that I thought I knew how to do.
Now, I cannot recall how to do it, and I'm feeling... well, terribly ignorant.
What is going on is I want to create an array of arrays - in specific, I'm making a pointer of pointers, actually.
I want each of the pointers in the "array" to point at an object of the same type. I wanted to set up a for-loop to assign these.
In other words, I have something like:
TCSpinEdit ** SpinnerArray;
SpinnerArray = new TCSpinEdit *[58];
for (int iCtr = 0; iCtr < 58; iCtr++)
the name of each of these objects starts out with CSpin followed by a number, from 1 to 58; so I need to point to CSpin1, then CSpin2, etc.
Therefore, I need to generate a string, or whathave you, to designate each CSpin variable to each of the pointes in the array.
And I realized I was unsure how to go about this.
I started originally by using the string class; assign it as:
string = "Cspin" + iCtr;
But I realized I wasn't sure how to use the string to refer to a variable NAME. Any suggestions?
Thanks!
James A Beggs
Microsoft MSN Mobile Component Test Team
|
|
|
|
|
I'm not sure if I understood you completely but in C++ there's no such association between a varaible name and a string, a variable name is merely a symbol by which you tell the compiler that you are about to request a block of memory, whereas a string is an array of characters. You cannot "convert" them into each other because they are totally different concepts.
|
|
|
|
|
Hum, I think I don't really understand you but why do you make so complicated ???
Why don't you just acces the array as normally like that:
TCSpinEdit* Temp;
for (int iCtr=0;iCtr<58;iCtr++)
Temp = SpinnerArray[iCtr];
|
|
|
|
|
You seem to be confused about what you really want - I try to give you an explanation, and maybe you can then decide if this was what you intended.:
James A Beggs wrote:
TCSpinEdit ** SpinnerArray;<br />
SpinnerArray = new TCSpinEdit *[58];<br />
for (int iCtr = 0; iCtr < 58; iCtr++)
So you have a pointer to an array of 58 TCSpinEdit* s.
In your for-loop you need to initialize each of the TCSpinEdit* 0 to 57 with a pointer to a TCSpinEdit :
for (int iCtr = 0; iCtr < 58; iCtr++)
{
SpinnerArray[iCtr]= new TCSpinEdit( parameter );
{
Your TCSpinners are now accessed as SpinnerArray[i], where i=0..57.
If you need - for whatever reason - a association between your TCSpinners and some other data, e.g. a string, you might use a std::map < string, int > to store pairs of strings and indices into your SpinnerArray.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
I'm a novice to Visual C++ Programming, and, of course, I'm really competent at coding errors. I think this happens to everyone initially. I'm constantly reviewing the literature, and in spite of this, I make the most incredibly and redundantly insipid errors imaginable.
I can code infinite recursion without even the vaguest notion of what I am doing. I can do bloat. I can write functions that never get called. This is all so incredibly easy to. And, I'm actually good at it.
...And so I'm starting a thread in which you all can entertain us with your all-time most frustrating struggle to domesticate a seemingly insignificant type or format.
...Something that came REALLY close to making you a serial killer,...
|
|
|
|
|
I usually program in regular old c++,(though im learning visual) anyway this gets me:
if (x = 1)
statement;
when i meant
if (x == 1)
statement;
compiles great,runs like hell::;)
|
|
|
|