Solved

Problem with double clicking

Posted on 2004-04-29
11
184 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
 
LVL 3

Expert Comment

by:stu_pb
ID: 10953714
Have you tried debugging the app to see where this occurrs?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

867 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now