[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 195
  • Last Modified:

Problem with double clicking

Hi,

When a document created by my app is double clicked in Windows I always get the following error message:

“Can’t file file c:/……./Myfile.kk  (or one of their components). Make sure that the path and file name are correct and all the libraries are available”

(Note: My OS is in Spanish so this is just a straight translation)

However, it does work properly if the file is dragged and dropped into the application.
Any idea?
Thanks in advance for your help.
elito
0
elito
Asked:
elito
3 Solutions
 
stu_pbCommented:
use the registry editor to make sure the path to the executable is correct.

1) open the registry editor (Start->Run->regedit)
2) Expand the HKEY_CLASSES_ROOT key
3) Find the .kk (file extension)
4) Get the default value of the .kk (file extension) key
5) Find the default value under HKEY_CLASSES_ROOT
6) Expand the key to Shell->Open->Command
7) The default value of the command key is the path to the executable, make sure it is correct.
0
 
elitoAuthor Commented:
it seems that the path to the executable is correct.

Any other suggestion?
Thanks!
0
 
elitoAuthor Commented:
In fact, when the document is double clicked, the applciation is launched but as soon as the error message pops up, the app is automatically closed.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
stu_pbCommented:
Have you tried debugging the app to see where this occurrs?
0
 
elitoAuthor Commented:
That was the first thing I tried but I'm not sure about how to debug the program ... I put several break points in the application but when I double click on the file, it seems that the debugger is not launched ... The question is, how can I debug a program that is launched externally as in this case?

Thanks
0
 
stu_pbCommented:
Sorry it took so long to reply.

At the very beginning of the program insert a Sleep command e.g. Sleep(30000);

This will allow you enough time to set up the debugger. The parameter to the sleep function is in milliseconds.

Start Visual C++
Compile the program in debug mode.
double click on the file to open
in visual studio go to build->start debug->attach to process ( i think it is the build menu)
in the process dialog box select the name of your application.
open the file where the Sleep() command is
set a break point after the sleep command.
wait for the 30 seconds to elapse and the break point should be triggered.

0
 
ZoppoCommented:
Hi elito,

in addition to 'stu_pb's comment: if your app doesn't use DDE ensure that in the Shell->Open->Command the '%1' is enclosed by "s, i.e. '...\path\yourapp.exe "%1"'

ZOPPO
0
 
itsmeandnobodyelseCommented:
Zoppo is right:

if the path to the executable or the path to the document file contains any space characters you have to use quotes "" both for the path to the executable and the %1 place holder.

      "c:/.../your_executable" "%1"

Regards, Alex
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now