1。有篇文章上介绍ShellExecute函数时说:ShellExecute较 WinExex灵活一点,可以指定工作目录,下面的 Example就是直接打开 c:\temp\1.txt,而不用加栽与 txt文件关联的应用程序。
请问“不加载与txt文件关联的应用程序”是什么意思?2。我在练习UNICODE编程。可是第一个程序就失败了,过程如下:建立一个对话框程序,添加一个按钮,该按钮的单击处理函数为
ShellExecute(NULL,NULL,_T("1.txt"),NULL,_T("c:\\temp"),SW_SHOWMAXMIZED);
之后我从主菜单中选择“Project | Settings”打开工程设置对话框 => 然后选择“C/C++”标签 => 在“Preprocessor definitions”编辑框中添加 UNICODE。
编译运行后出现如下错误:
msvcrtd.lib(crtexew.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/WordAnalysis.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.请问这是怎么回事??

解决方案 »

  1.   

    用ShellExecute打开 c:\temp\1.txt其实就是加载与txt文件关联的应用程序(如notepad)打开1.txt。
      

  2.   

    第二个问题应该使用wWinMain作为程序入口点啊!
      

  3.   

    试试
    Project->Settings->Link->Category:Output
    设置Entry Point Symbol为wWinMainCRTStartup另外《WINDOWS核心编程》上说除了UNICODE还需要添加_UNICODE,_UNICODE宏用于C运行期头文件,UNICODE宏用于windows头文件,当编译源代码时,通常必须定义这两个宏
      

  4.   

    经过上述改动后,换成了新的错误。
    这回弹出了一个错误提示对话框。
    标题是:MFC Runtime Module
    内容是:This application or DLL can't be loaded on windows 95 or windows 3.1.It takes advantage of Unicode features only available on windows NT.
    我用的是windows ME,请问这和操作系统有什么关系吗?
    再请高手给我解释一下作出上述改动的目的是什么,我要知其然更要知其所以然!
      

  5.   

    还是windows核心编程中说:
    win2000 支持UNICODE和ansi
    win98 ansi only
    win ce  unicode onlywinme大概也不支持unicode。至于你说到的改动,查看MSDN 的LNK2001错误说明If you are using Unicode and MFC, you will get an unresolved external on _WinMain@16 if you don’t create an entrypoint to wWinMainCRTStartup. Use the /ENTRY option or type this value in the Project Settings dialog box. (To find this option in the development environment, click Settings on the Project menu, then click the Link tab, and click Output in the Category box.) See Unicode Programming Summary. See the following Knowledge Base articles located in the Online Information System for more information. An easy way to reach an article is to copy a "Q" number above, open the Search dialog box from the Help menu and select the Query tab, then paste the number into the first text box and press ENTER.
    Q125750   "PRB: Error LNK2001: '_WinMain@16': Unresolved External Symbol"
    Q131204   "PRB: Wrong Project Selection Causes LNK2001 on _WinMain@16"
    Q100639   "Unicode Support in the Microsoft Foundation Class Library" 
      

  6.   

    1、用不用加上Notepad.exe参数的问题~
    2、更改编译器选项~你建立的工程类型不对~
    Alt+F7,link属性页~/subsystem:windows
      

  7.   

    或者把/subsystem这个删掉~编译器会自动寻找入口~