文件关联和双击 [英] File associations and double-clicking

查看:93
本文介绍了文件关联和双击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个MFC项目,该项目最初是在VC ++ 6下开发的,它用来在XP下完美地建立文件关联.

现在,将同一程序转换为VS2005并在Windows 7下运行,它表现出奇怪的行为:双击文件时,一会儿什么都没发生,然后出现一个消息框,说:向Windows发送命令时出现问题.该程序."该程序最终会启动,但不会加载文件.如果再双击一个文件,则正在运行的程序将正确加载该文件.

我已经用VS2005创建了一个新的C ++ MDI项目,并检查了我的程序是否添加了相同的注册表项,并且它们是正确的,并且我对问题所在的位置已经没有足够的想法了.
关于双击为什么不将文件加载到我的程序中的任何建议将不胜感激!

解决方案

您可能没有将正确的参数传递给程序...在注册表中进行搜索以查看默认命令行参数是否正确.另外,您可能可以对可执行文件中的初始化数据进行小型转储,以查看失败的原因(将调试信息发送到文件中).

祝你好运! :)


不知道哪个特定的问题可以解决-我已经在InitInstance()中移动了代码,我认为这是解决方案.


Hi all,

I''ve got an MFC project that was originally developed under VC++6, and it used to set up file associations perfectly under XP.

Now with the same program converted to VS2005 and running under Windows 7, it is exhibiting strange behaviour: when you double-click on a file, nothing happens for a while then a message box comes up saying "There was a problem sending a command to the program." The program eventually starts up, but it doesn''t load the file. If I then double-click on a file, the running program loads it correctly.

I''ve created a new C++ MDI project with VS2005, and checked that my program adds the same Registry entries, and they are correct, and I''ve run out of ideas as to where the problem lies.

Any suggestions as to why double-clicking doesn''t load the file into my program would be gratefully received!

Thanks!

解决方案

You may not be passing the correct arguments to the program... do a search in the registry to see if the default command line arguments are correct. Also, you can probably do a mini-dump of the initialization data in your executable to see why it''s failing (send debug information to file).

Good luck! :)


No idea which specific thing fixed it - I''ve moved code around in InitInstance(), which I think was the solution.


这篇关于文件关联和双击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆