|
Erudite_Eric wrote: So says someone who has never worked in the kernel...
So says someone who thinks he knows everything... Are you sure about that statement? Maybe you are a mind reader, but I doubt that... You should stop insulting people and degrading others on the forum. You should search for a hacker forum that is usually full of people going with a style like yours. Maybe you are a good technician but at the same time you are like a 15 years old boy comparing his penis to that others'. This forum is here to help others with solutions not to offend and degrade each other. If you think you have a better solution to the problem than the ones already posted then submit yours without offending others. There is a difference between debate and offense/degrading words and you seemingly don't know where the line is between the two.
modified 11-Jul-13 8:52am.
|
|
|
|
|
So you have worked in the Windows kernel? What drivers did you write?
pasztorpisti wrote: This forum is here to help others with solutions
and not to give them stupid advice.
modified 11-Jul-13 10:01am.
|
|
|
|
|
I never worked with the windows kernel and wrote drivers only for linux for newly created hardware pieces several years ago. In my opinion programming kernel is just like programming anything else with a different api and a bit different rules and more pain in the ass. That's it. By the way, the kernel has nothing to do with the question into which we are posting this useless stuff.
And sorry but this is the end of our conversation. I'm visiting codeproject to spend a little of my free time with useful things like helping others and solve technical problems/debating about them. Comparing penises is not my business.
|
|
|
|
|
So you have no basis for saying 100% perfect is not acchievable since you havent been exposed to a system which demands it.
Which means your statement that non 100% code is OK because 'you havent got time to fix it' is wrong and bad advice.
And so if you dont like having it pointed out to you then dont offer people bad advice.
modified 11-Jul-13 12:09pm.
|
|
|
|
|
Hi,
I have a CView and some objects on it with a right click behaviour, using overwritten method OnRButtonDown(UINT nFlags, CPoint point).
But its not working on a windows8 tablet with touchdisplay (selecting object and keeping finger pressed for some seconds).
Doubleclick and stuff is working, just not the right mouseclick. But its working in standard comboboxes.
Are there any special events that I have to implement in order to catch the right mouseclick?
Thank you!
|
|
|
|
|
Did you enable WM_TOUCH messages by calling RegisterTouchWindow() ?
Than the mapped mouse button messages are not generated.
|
|
|
|
|
Hey, thanks for the reply. This gives me a good starting point.
However, I cant seem to get it working.
I registered the touch handling via
if (!RegisterTouchWindow())
in the overwritten OnCreate method of CMDIFrameWnd
I defined the WM_TOUCH message:
#if(WINVER >= 0x0601)
ON_MESSAGE(WM_TOUCH, OnTouch)
#endif
(I checked the winver, it is correct.)
But I never get to the OnTouch method.
Any advice?
EDIT:
Interestingly it works through remote-desktop from the tablet but not as a fat client installation. No idea why though...
modified 9-Jul-13 2:53am.
|
|
|
|
|
It should be not necessary to use WM_TOUCH handlers. I just wanted to point out that the behaviour is as described when using them.
Did you test it on multiple touch devices? Maybe the reason is a non default system setting which would also explain why it is working remotely.
|
|
|
|
|
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
|
|
|
|