I think non-dialog and dialog based applications have the same problem. Because once the mouse move outside a window, the mouse messages won't be sent to the window unless a mouse button has been pressed down. It is capable even to the window used "SetCapture()". Sorry but it's out of my reach to solve this problem. But you can use the sentence "::SetCursor(::LoadCursor(NULL,NULL));" to make your cursor invisble and use the sentence "::SetCursor(::LoadCursor(NULL,IDC_ARROW));" to restore it. And, you can always use GetCursorPos() function to retrieve the mouse cursor's current position. Hope it can help you. ;) Law is meaningless without chaos. Chaos without Law is equal to destruction. Chaos and Law create our rich and colorful world.
Chaos Lawful
Posts
-
Mouse capture problem -
AdvanceYou can create a windows use CreateWindowEx() function and use WS_EX_TOPMOST style. For example: HWND hWnd; hWnd=CreateWindowEx( WS_EX_TOPMOST, ...,// class name ...,// window name WS_OVERLAPPEDWINDOW, ...);:) Law is meaningless without chaos. Chaos without Law is equal to destruction. Chaos and Law create our rich and colorful world.
-
What's wrong with my code?So could you send your piece of codes to me? I think looking into the codes will be more clear.:) Law is meaningless without chaos. Chaos without Law is equal to destruction. Chaos and Law create our rich and colorful world.
-
Is there a way to construct CFtpConnection object from a existed HINTERNET handle?Thank you very much!:-D Law is meaningless without chaos. Chaos without Law is equal to destruction. Chaos and Law create our rich and colorful world.
-
Again: Are there any methods to construct a CFtpConnection object from a HINTERNET handle?I'm sorry to waste your time. But I don't know which article you refered to. Did you mean the FTPTransferDlg class?:confused: Looking forward to your reply. Thank you. Law is meaningless without chaos. Chaos without Law is equal to destruction. Chaos and Law create our rich and colorful world.
-
Again: Are there any methods to construct a CFtpConnection object from a HINTERNET handle?I cannot find any useful functions from neither the MSDN nor the MFC source code. What can I do now? Please help me!:(( Law is meaningless without chaos. Chaos without Law is equal to destruction. Chaos and Law create our rich and colorful world.
-
How do I create a makefile from the command-line :confused:Why don't use the VC++'s project/export_makefile? It's very convinent.:confused: Law is meaningless without chaos. Chaos without Law is equal to destruction. Chaos and Law create our rich and colorful world.
-
Is there a way to construct CFtpConnection object from a existed HINTERNET handle?I don't want to pass the CFtpConnection* pointer to a thread proc because that may be dangerous. Although I can get the handle of the FTP connection from the (HINTERNET) operation, I cannot construct a CFtpConnection object from the handle I've got because there's no such function. What should I do? Please help me out. :( Thanks in advance. Law is meaningless without chaos. Chaos without Law is equal to destruction. Chaos and Law create our rich and colorful world.
-
What's wrong with my code?You didn't delete the dlg object in the CFirstDialog::OnButtonTry(). That should be the problem. Why do you want to use the heap object rather than stack object? If you do it like this: void CFirstDialog::OnButtonTry() { CTestDialog dlg; dlg.DoModal(); } you won't be worried about the work of releasing object. I think this form is better.;) Law is meaningless without chaos. Chaos without Law is equal to destruction. Chaos and Law create our rich and colorful world.
-
Enumerate Event ObjectsDid you want to use OpenEvent() to open your event object? If you created the event object using the form CreateEvent(...,...,...,NULL), you had created an event object without a name. You should replace the last NULL with a string to specify the name of the event object, then you can use OpenEvent() using the name. Hope it can help you. :) Law is meaningless without chaos. Chaos without Law is equal to destruction. Chaos and Law create our rich and colorful world.
-
AfxbeginThreadOK, you can either paste it or send it to my mailbox.:) Law is meaningless without chaos. Chaos without Law is equal to destruction. Chaos and Law create our rich and colorful world.
-
AfxbeginThreadCould you show me your codes? I think that would be a great help.;) Law is meaningless without chaos. Chaos without Law is equal to destruction. Chaos and Law create our rich and colorful world.
-
Breakpoints cannot be set!!!I think you had changed the settings for the debug mode. You can try this solution: Project-->Settings-->select Win32 Debug in "Settings For" -->select "C/C++" tab-->select "General" in Category -->select "Program Database for edit and continue" in "Debug Info" then it should work normally.:rolleyes: Law is meaningless without chaos. Chaos without Law is equal to destruction. Chaos and Law create our rich and colorful world.
-
Breakpoints cannot be set!!!Are you sure you are in the Debug mode and not the Release mode?:confused: Law is meaningless without chaos. Chaos without Law is equal to destruction. Chaos and Law create our rich and colorful world.
-
Breakpoints cannot be set!!!I think you had switch the compiler into Release mode, so no breakpoints can be set. You can switch back to Debug mode in the menu Build --> Set Active Configuration.:cool: Law is meaningless without chaos. Chaos without Law is equal to destruction. Chaos and Law create our rich and colorful world.
-
AfxbeginThreadYou should not pass dialog pointer to the thread because it may be invalid. I think you can use GetSafeHwnd() to get the handle of the main dialog and pass it to the thread. In the thread you can use FromHandle() to get back the main dialog pointer and then you can access the main dialog class. Here is an example: UINT ThreadProc(LPVOID);// the thread proc HWND hWnd; // for handle of main dialog BOOL C???Dlg::OnInitDialog() { ...// some codes hWnd=GetSafeHwnd(); ...// other codes } void C???Dlg::OnButton1() // Button1 is a sample button { AfxBeginThread(ThreadProc,NULL); } UINT ThreadProc(LPVOID lpData) { C???Dlg *pDlg=(C???Dlg*)C???Dlg::FromHandle(hWnd); // get the main dlg pointer ...// do what you want to do } You can also pass the handle through the thread proc's lpData pointer, then you don't have to declare the hWnd as a external variable.:) Law is meaningless without chaos. Chaos without Law is equal to destruction. Chaos and Law create our rich and colorful world.
-
How to check a FTP connection's validation?I use CFtpConnection to process FTP connections. But how can I check whether the connection is still opened when I get a CFtpConnection pointer? There will be many accidents to break the connection(The master closed the FTP server, net-wire broken, etc.). X|Show me some solutions, please. Law is meaningless without chaos. Chaos without Law is equal to destruction. Chaos and Law create our rich and colorful world.
-
Can I get the handle of a window?It works fine. Thank you very much!:) But I think enumeration's performance isn't very high. Are there any other solutions?:rolleyes: Law is meaningless without chaos. Chaos without Law is equal to destruction. Chaos and Law create our rich and colorful world.
-
Can I get the handle of a window?Yes, it is. Can I get the handle? Law is meaningless without chaos. Chaos without Law is equal to destruction. Chaos and Law create our rich and colorful world.
-
Why did I get a error message on the call to CFtpConnection's SetCurrentDirectory()?I'm writing a multi-threaded FTP searching program under Win 2k. But sometimes I got error message like "memory 'XXXXXXXXX' cannot be 'written'" from WININET.DLL and sometimes I got "Unhandled exception" from NTDLL.DLL when I call SetCurrentDirectory() to get into the child directory. The child directory actually exists, and MSDN said these functions don't throw exceptions! I was completely confused. What cause this error? Could anyone give me some suggestions? Thanks a lot.:confused: :confused: Law is meaningless without chaos. Chaos without Law is equal to destruction. Chaos and Law create our rich and colorful world.