|
Thanks a lot Faroqtam, it works very well.
It's very kind of you !
I wish you a nice day and see you soon !
alain
There is no way to happiness, happiness is the way !
|
|
|
|
|
sweep123 wrote:
I did download Tom Archers example from the Code Project, but it failed to build with error:-
I trust you posted a messages similar to this one at his article.
sweep123 wrote:
Also if I just want to Copy/Paste text from a listCtrl is it that complicated?
Complicated is a relative term. Like most anything, it's not complicated if you know how.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I have now posted a message on Tom's article (I just though that it was my compiler/linker setings which was causing the problem).
The reason for the post was to seek a reduced piece of code just to transfer from one sub-item of a listCtrl to the clipboard.
Tom's article had quite a bit of code.
Also I thought that many people must have implemented something to do this before.
|
|
|
|
|
To get the text value of an item/subitem, use GetItemText() . To copy to the clipboard, use SetClipboardData(CF_TEXT, ...) .
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hello,
I have a program that is in the tray and when a user logout, restart or shutdown I need to make a log when my program exit but I don't get it to work.
I have try with OnCancel(), OnOK() and OnClose() but it don't work.
So how can I make my stuf before my program exit?
|
|
|
|
|
None of the given
Read from MSDN about WM_QUERYENDSESSION
|
|
|
|
|
I have check it but I don't get it,
Please help me.
|
|
|
|
|
I meen how can I make so when the program is about to exit it go first to a function and make some stuf?
|
|
|
|
|
Override the ExitInstance function in your Application class. You can then clean up, or do whatever else before the application terminates.
I Dream of Absolute Zero
|
|
|
|
|
I have done that if you mean OnOK(), OnCancel() and OnClose().
Is there anyone else exit instance? and if so where?
|
|
|
|
|
The OnOK(), OnCancel() and OnClose() functions are merly handlers for messages that gets sent when your button (I am assuming these are linked to a button) gets pressed. The previous poster mentioned creating a handler function for the WM_ENDSESSION message. This could be one possible solution to your problem.
My solution uses the fact that the WinApp::ExitInstance() function gets called whenever the user choses to exit their windows session.
Every MFC application should have a WinApp derived class, called something like MyProgApp, or something similar with the App appended to your class name.
Now this function isn't visible by default, so you need to override this function using the Classwizard (if using VS6), or the properties window (if using VS7.1).
You can then write your logging code within the function, but remember to call the base class at the end (or your app won't exit).
int CMyApp::ExitInstance()
{
delete m_pVarA;
delete m_pVarB;
::CoUninitialize();
return CWinApp::ExitInstance();
}
I Dream of Absolute Zero
|
|
|
|
|
The system sends the message, so all you have to do is capture that message and then do your stuff.
( return FALSE after a WM_QUERYENDSESSION is received and then capture the WM_ENDSESSION and check if system is really shutting down and do your stuff before returning from this message...
Greetings,
Davy
|
|
|
|
|
Ok,
And where do I make that check?
|
|
|
|
|
Something like this will help
Mainfrm header file
protected:
afx_msg LRESULT OnMyEndSession(WPARAM wParam, LPARAM lParam);
Mainfrm cpp file
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
:
ON_MESSAGE(WM_ENDSESSION, OnMyEndSession)
:
END_MESSAGE_MAP()
LRESULT CMainFrame::OnMyEndSession(WPARAM wParam, LPARAM lParam)
{
if (lParam & ENDSESSION_LOGOFF)
{
:
:
}
else
{
}
return 0;
}
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Thanks it works greate.
|
|
|
|
|
Can I wait for Data to be available on a pipe? Peek & Poll works, but I'd rather have a true wait (since I'm waiting for "either data on pipe, or kill event")
we are here to help each other get through this thing, whatever it is Vonnegut jr. boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
Yes, I found this in MSDN under "Synchronization Objects":
In some circumstances, you can also use a file, named pipe, or communications device as a synchronization object; however, their use for this purpose is discouraged. Instead, use asynchronous I/O and wait on the event object set in the OVERLAPPED structure. It is safer to use the event object because of the confusion that can occur when multiple simultaneous overlapped operations are performed on the same file, named pipe, or communications device. In this situation, there is no way to know which operation caused the object's state to be signaled.
|
|
|
|
|
Hello All,
Can some one tell me the Win32 API fn() or fn()'s used to calculate the bandwidth consumption of our computer. I am on NT platform and using VC++6.0 compiler.
Thnx in Advance
Comboy2080
|
|
|
|
|
Do you mean Network Percentage Utilisation?
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Can u plz tell me fn() which retrives packets sent and received information which is displayed in the Local Area Connection Setup (which is in the task bar in the right hand side corner).
Thnx in Advance
Comboy2080
|
|
|
|
|
If you want to analyse packets to and from your PC take a look at WinPCap[^]
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Hi,
the Win32 API fn() ??? No function avilable..
|
|
|
|
|
comboy2080 wrote:
Can some one tell me the Win32 API fn() or fn()'s used to calculate the bandwidth consumption of our computer. I am on NT platform and using VC++6.0 compiler.
yeah there are some Good IPhelper Api's presents in the VC++ enviornment
Look in Index of MSDN for iphlpapi Module
or Here is the required Function that will help you
-->GetIfTable
or you can look for firewall Implementation by SUdhir MAngla at Cp.search for article by author for Sudhir Mangla
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hello everyone
What is the defference about _T("abc") and "abc"? Thank you.
-Freehawk
|
|
|
|
|
_T("abc") translate "abc" to unicode on unicode builds and remain "abc" on non unicode builds, see tchar.h
hope that helps, regards
|
|
|
|