|
I dont have multiple touch devices (had to buy this one in order to be able to test).
Maybe i will have to test the parameters of the RegisterTouch...() method, although I am sure it wont make a difference.
Its good to know that those messages will be translated to normal mouse messages.
Thanks for your support so far!
|
|
|
|
|
Hi all,
I have a dialog based application in MFC using visual studio 2005.
After I close the application,
in CTestMainFrame::OnClose(), I am doing PostQuitMessage( 0);
With this the dialog box closes but my application still exists in Windows task manager.
Can you please help is there any other way I can kill my app completely.
Regards,
Sunil.
|
|
|
|
|
To close a modal dialog (the main dialog of a dialog based application is a modal dialog), call one of the EndDialog() , OnOK() , or OnCancel() member functions of CDialog . This will perform all necessary cleanup, close the dialog and return to InitInstance() of your application. The application is then terminated by returning FALSE from InitInstance() .
|
|
|
|
|
Calling PostQuitMessage(0) should do the job but somewhere your application is buggy for sure, you have to check out all deinitialization code in your app. You put some buggy code to a destructor or a function called by mfc or by one of your own destructors during program shutdown that doesn't work as intended. Run the program in a debugger and if you can reproduce the bug in while debugging then try to check out what is goin on in your program by pressing the pause button in the debugger. Check out the callstack of all threads, especially that of the Main thread.
|
|
|
|
|
Why did you replace CDialog::OnClose(); given you by the wizzard with PostQuitMessage()?
You HAVE to allow the base class to function correctly.
modified 9-Jul-13 6:18am.
|
|
|
|
|
Can someone point me to a site with the first ten or twenty lessons for newbee/refresher material for plain old regular C ?
The last course in C I had was years ago.
Oh, and in before first comment; yes, I know about google.
(That's why I'm asking here !)
|
|
|
|
|
|
C-P-User-3 wrote: yes, I know about google. So what is wrong with some of these links[^]?
Use the best guess
|
|
|
|
|
Here's what's "wrong" with them: they came from google.
Some time ago, google became the premier web search tool.
Some time after that, money came into play.
Some time after that, Newton's third law, in terms of psychodynamics and economics, produced the "Search Engine Optimization" (SEO) phenomenon.
Some time after that, the financial aspect of "finding the best" came into the procedure.
I don't understand all the inputs, but I have seen enough of the outputs to understand that the algorithm is now different from what it was several years ago.
Hence, asking the direct opinion of a bunch of guys on a site like this can produce a far more easily understood "search result" with the biases and prejudices far more easily inferred than a list that google produces. With those biases and prejudices more clearly evident and understood than an "automated" response, I can make a decision with which I'm far more comfortable.
I guess the concept parallels wikipedia these days; i.e.,
"...NPOV is absolute and non-negotiable..."
From what I've seen, the same thing that happened to wikipedia's "...NPOV..." closely approximates what has happened to google's algorithms.
All this is from guessing, based on the results I've personally observed.
So,,,,,,,,,,
That's why I like opinions from here better than from there.
|
|
|
|
|
C-P-User-3 wrote: Here's what's "wrong" with them: they came from google. And how do you think we find "the best", whatever that may mean. I learned C from Kernighan & Ritchie[^], which is, in my opinion, one of the best programming guides ever written. But then I may well have missed lots of others.
Use the best guess
|
|
|
|
|
K&R and programming.
Since you already know Google, a foundation book and experience is all other you need.
Veni, vidi, vici.
|
|
|
|
|
Hey there
In my VC++ application i see that this function fails in certain times, but was not able to reproduce it.
So am trying to debug and have few questions.
Does the DeleteFile() fails if multiple files are deleted quickly inside a loop and if some files are larger in size?
What other possible causes can lead to DeleteFile() to fail?
|
|
|
|
|
There are some reasons lead to DeleteFile() failure:
1. File not found
2. Path not found
3. Access denied
The first two reason maybe avoidable, but when you delete a large amount of file, depending on the disk status, there is a possibility that the access error happens. I also encountered this error when manually delete a directory which contains a large amount of files and sub directories, so I have to retry several times.
If you use DeleteFile() in your program, I think you should use catch and retry deleting several times before give it up.
"Never memorize something that you can look up." - Albert_Einstein
|
|
|
|
|
Donguy1976 wrote: What other possible causes can lead to DeleteFile() to fail? If the call fails then you can find the reason by calling GetLastError() , as described in the documentation[^].
Use the best guess
|
|
|
|
|
From the MSDN documentation of DeleteFile:
If the function fails, the return value is zero (0). To get extended error information, call GetLastError.
GetLastError returns an error code which you can convert into a string via the FormatMessage function. See http://msdn.microsoft.com/en-us/library/windows/desktop/ms680582%28v=vs.85%29.aspx[^] for an example. One possible reason might be that you are trying to delete the same file more than once.
|
|
|
|
|
Donguy1976 wrote: What other possible causes can lead to DeleteFile() to fail?
Well, the blindingly obvious are:
1) It doesnt exist.
2) Somthing else has it open.
The less obvious is that your calling code doesnrt have Delete authorisation.
Loo ak the error return, it will tell you all about it.
|
|
|
|
|
Hi,
I created a source filter and is registered successfuly. Every time I use GraphEdit it works fine but when I try to use under MFC/C++ CoCreateInstance fails as not registered (error 0x80040154).
hr = CoCreateInstance(CLSID_PIAsyncFile, NULL,CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void **)&pAsync);
I tried again and again with regsvr32 and successfully registers the filter.
What seems to be wrong here?
I use 32Bit debug builds, on Win7 64bit system.
Regards,
sdancer75
|
|
|
|
|
Make sure you've called CoInitialize or CoInitializeEx properly before calling CoCreateInstanc e.
|
|
|
|
|
Thanks,
I have called the
HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
at the class construction and
CoUninitialize();
at the destruction.
Any other filter is successfully CoCreateInstance except my filter.
sdancer75
|
|
|
|
|
Get the error returned in hr and use the Error Lookup tool check what the error is.
|
|
|
|
|
Hi,
As you can see in question at the very begging, the error code is 0x80040154 which means "class is not registered"
This is strange since the class is indeed registered at sysWOW3264 (a mirror registry for 32-bit windows apps running on 64bit windows) since my source filter is 32-bit.
Under ms filter graph, I can find and use successfully the filter, but the problem still exists under my MFC project.
PS:In my stdafx.h I declare my filter as follows
#include "INITGUID.H"
DEFINE_GUID(CLSID_PIAsyncFile,
0x8576CEC8, 0x964D, 0x4B51, 0xAC, 0x45, 0x2B, 0x24, 0xDE, 074, 0x8E, 0x23);
Thanx
sdancer75
|
|
|
|
|
Sorry, I didn't notice the error code you posted in your question.
I'm assuming that the MFC project is built as a 32-bit application.
One more thing you can try -
There are both 32-bit and 64-bit versions of regsvr32.exe available in %SystemRoot%\Windows\System32 and %Systemroot%\Windows\SysWOW64.
Try registering the component with either of the 2 and check if the MFC application is able to find it.
|
|
|
|
|
Thanks,
Yes I know and I already tried both versions of regsvr32 (32 & 64 Bit) but still does not work.
Regards,
sdancer75
|
|
|
|
|
All I can think of is that the COM component uses some dependency files like DLLs that GraphEdit is able to find but the MFC application is not.
Does the COM component reside is some folder along with other dependency files.
If so, you can either try to copy the EXE to that folder or change the working directory using the SetCurrentDirectory API.
|
|
|
|
|
I am not sure about that.... The filter resides is a local folder and not in windows subfolder and is a "debug build". I will try to move the filter inside the C:\windows\SysWOW64 and register again.
sdancer75
|
|
|
|