如果路径很大(缓冲区太小断言),则shellexecute无法正常工作 [英] shellexecute not working if path is large (buffer too small assertion)

查看:111
本文介绍了如果路径很大(缓冲区太小断言),则shellexecute无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述







是shellexecute LPCTSTR lpParameters有任何角色限制吗?



在我的程序中,如果lpparameter很大,则不会调用.exe文件



ShellExecute(NULL,(open),(XYZ。 exe),(strtext1),NULL,SW_SHOWNORMAL);



strtext1是输入文件的路径



strtext1 = C:\ TestProjectExample\project12345 \ test12 \s1rn1.sie(不工作)

strtext1 = C:\ TestProjectExample\project1 \s1rn1.sie(工作)



如果路径较短则会起作用。如果路径较大则不起作用。



给出缓冲区太小的断言。



请帮我解决这个问题。



谢谢,

Hi,


IS shellexecute LPCTSTR lpParameters has any character limit ?

In my program if "lpparameter" is large it is not calling .exe file

ShellExecute(NULL, ("open"), ("XYZ.exe"),(strtext1 ) ,NULL,SW_SHOWNORMAL);

strtext1 is a path to input file

strtext1 = C:\TestProjectExample\project12345\test12\s1rn1.sie (not working)
strtext1=C:\TestProjectExample\project1\s1rn1.sie(working)

If path is shorter then it will work. If path is lager it won't work.

It is giving Buffer too small assertion.

Please help me to solve this issue.

Thank you,

推荐答案

请看我的评论问题。



对于某些背景: http://social.msdn.microsoft.com/Forums/ windowsdesktop / EN-US / 48ea2ff7-fab6-4484-ab12-9307399cf47e / ShellExecute的,有长-32K-UNC路径,怎么办 - 即上 - 窗口 - 7?论坛= windowsgeneraldevelopmentissues [<一个HREF =http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/48ea2ff7-fab6-4484-ab12-9307399cf47e/shellexecute-with-long-32k-unc-path-how-do-that -on-windows-7?forum = windowsgeneraldevelopmentissuestarget =_ blanktitle =New Window> ^ ],

HTTP: //blogs.msdn.com/b/bclteam/archive/2007/02/13/long-paths-in-net-part-1-of-3-kim-hamilton.aspx [ ^ ](尽管它仅适用于.NET,它提供了一些想法)。



这里似乎是成为问题:在所有示例中,文件路径太短而不会导致问题(MAX_PATH定义为260)。也许你的观察是不正确的,有一个或另一个奇怪的原因。


< -SA
Please see my comment to the question.

For some background: http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/48ea2ff7-fab6-4484-ab12-9307399cf47e/shellexecute-with-long-32k-unc-path-how-do-that-on-windows-7?forum=windowsgeneraldevelopmentissues[^],
http://blogs.msdn.com/b/bclteam/archive/2007/02/13/long-paths-in-net-part-1-of-3-kim-hamilton.aspx[^] (even though it is for .NET only, it gives some ideas).

Here is what seems to be a problem: in all your examples, file path is too short to cause a problem (MAX_PATH is defined as 260). Perhaps your observations were incorrect, by one or another weird reason.

<—SA


这篇关于如果路径很大(缓冲区太小断言),则shellexecute无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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