Solved

Problem with double clicking

Posted on 2004-04-29
11
181 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
Comment Utility
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
Comment Utility
it seems that the path to the executable is correct.

Any other suggestion?
Thanks!
0
 

Author Comment

by:elito
Comment Utility
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
Comment Utility
Have you tried debugging the app to see where this occurrs?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:elito
Comment Utility
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
Comment Utility
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 30

Assisted Solution

by:Zoppo
Zoppo earned 33 total points
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

771 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

15 Experts available now in Live!

Get 1:1 Help Now