Solved

Problem with double clicking

Posted on 2004-04-29
11
187 Views
Last Modified: 2013-11-20
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
Comment
Question by:elito
11 Comments
 
LVL 3

Expert Comment

by:stu_pb
ID: 10952590
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
 

Author Comment

by:elito
ID: 10952837
it seems that the path to the executable is correct.

Any other suggestion?
Thanks!
0
 

Author Comment

by:elito
ID: 10953071
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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 3

Expert Comment

by:stu_pb
ID: 10953714
Have you tried debugging the app to see where this occurrs?
0
 

Author Comment

by:elito
ID: 10954237
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
 
LVL 3

Accepted Solution

by:
stu_pb earned 34 total points
ID: 10954873
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
 
LVL 31

Assisted Solution

by:Zoppo
Zoppo earned 33 total points
ID: 10958729
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
 
LVL 39

Assisted Solution

by:itsmeandnobodyelse
itsmeandnobodyelse earned 33 total points
ID: 10964357
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

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Tab names are off by one 5 54
maxBlock challenge 30 142
no14 challenge 14 72
Way to decrease size of apk file 9 87
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question