|
Sorry, I am out of ideas. But that message suggests that there is no default application registered for the file type.
|
|
|
|
|
I really appreciate your post ! Kindly thank you !
|
|
|
|
|
|
_Flaviu wrote: Is there any kind of parameters to put on ShellExecute ? Try NULL instead of "open";
The default verb is used, if available. If not, the "open" verb is used. If neither verb is available, the system uses the first verb listed in the registry.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
I have tried in this way, the same behavior, but I noticed that this issue is present on some PC, but not on the other … strange ...
modified 6-Jun-19 7:34am.
|
|
|
|
|
_Flaviu wrote: I am trying to open an image file
Just to clarify that statement....
The method you uses does the following.
1. Determine the type of file using the extension.
2. Look up what application the OS (windows) has recorded to open that type of file.
3. Open the file using the application.
However if 1 fails, in that the file type is not known (already specified) then it will ask you for what to open it with.
If you want to explicitly specify some application to open the file with then you need a different method.
If you want to preclude the message in the first place then you will need to write code that first detects if the type is known. However that can still be problematic because if there is a known application for type, and then the application is uninstalled (or otherwise not available) there is no assurance that the type will have been unregistered. So it might still fail to open it.
|
|
|
|
|
The strange thing is that this behaviour is present on some PC, and on some PC are not present... and I noticed this behaviour even on Outlook application, on some image attachments ... so, guess is PC issue, not application issue.
|
|
|
|
|
_Flaviu wrote: guess is PC issue, not application issue. Exactly as I suggested last week.
|
|
|
|
|
_Flaviu wrote: The strange thing is that this behaviour is present on some PC, and on some PC are not present
Because, as I explained, there is an association on the PC, each PC, which specifies what if anything to open the file with based on the extension.
|
|
|
|
|
Hi!
I am current working on windows CE 6.0 project on the chip ARM.
I don't know using hardware device for project.
Help me! Please.
Thank you,
|
|
|
|
|
From HOW TO ASK A QUESTION - C / C++ / MFC Discussion Boards :
Quote: For those new to message boards please try to follow a few simple rules when posting your question.
1. Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
|
|
|
|
|
Start with the documentation that explains how to program the device.
|
|
|
|
|
Quote: I don't know using hardware device for project. You should ask more specific questions in order to get help. For instance, what device are you talking of?
|
|
|
|
|
how i can disable key from keyboard of computer using C language
|
|
|
|
|
|
No requirement for programming, hammer and chisel will do the job
In vino veritas
|
|
|
|
|
1. Define exactly what you mean.
2. If you mean at the application level then analyze the application to find how input is handled. If at the OS level then read up on how to create input handlers (drivers.) Depending on what 'key' you want to disable then this might require different approaches.
3. Write the code
4. Test it.
|
|
|
|
|
Technically, the C programming language has no such provisions. You will need to interact with the hardware using specific APIs.
Now depending on how you answer Victor's question, there may be a solution to the question you meant to ask.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
I indent to use FindFirstChangeNotification in a class static method in order to use it in a thread, something like this:
DWORD WINAPI FilesWatchDogThread(LPVOID lpParam)
{
HANDLE hFileChange = ::FindFirstChangeNotification((LPCTSTR)lpParam, TRUE,
FILE_NOTIFY_CHANGE_FILE_NAME);
if(INVALID_HANDLE_VALUE == hFileChange)
{
DWORD dwError = ::GetLastError();
return dwError;
}
while(TRUE)
{
::WaitForSingleObject(hFileChange, INFINITE);
::FindNextChangeNotification(hFileChange);
}
return 0;
}
::CreateThread(NULL, 0, &CMyClass::FilesWatchDogThread, _T("c:\\temp"), 0, NULL);
but how can Itell the thread when a folder to watch has been changed (I mean _T("c:\\temp") change to _T("e:\\whatever")) ? What should I use for that ? CreateEvent or what ?
|
|
|
|
|
Yes, you can use CreateEvent, change the folder, set its value in lpParam, then SetEvent to let the thread to reread lpParam and continue to work with a new folder.
Note, that thread must now wait for multiple objects!
|
|
|
|
|
Thank you Victor, can you elaborate a little bit ? Even some pseudo-code will be good 
|
|
|
|
|
Have a look at the WorkerThreads essay of Joe Newcomer.
It is MFC issue, but the main concept is the same as for plain Win32 API. Just look at the sections:
Pausing a Thread and Thread Shutdown
Shutting down a thread from a view or main frame
Thread Shutdown Without Polling
(Well, you would need something similar to "Pausing" event.
|
|
|
|
|
I have two questions:
1. Why should I use CreateEvent, and if I should, where ?
2. Why should I use WaitForMultipleObjects instead of WaitForSingleObject ?
|
|
|
|
|
- to inform the worker thread that it must do something (to change the folder in your case). CreateEvent/SetEvent - in the main thread.
- Because there is already one object: hFileChange. However the thread should react also to the second object created/set by CreateEvent/SetEvent in the main thread.
|
|
|
|
|
There will be ideal a little code 
|
|
|
|