基于对话框的APP没有对文档的支持,我现在要用在exeplore中双击ndf文件,然后shell调用我的程序,问题是基于对话框的APP不支持.document写进注册表,如何不用 文档类也可以在 注册表中注册???

解决方案 »

  1.   

    自己写注册表,建立ndf文件类型,将它指向你自己的处理程序就可以了。
    主要要写入以下内容(将执行文件的路径换成你自己的):[HKEY_CLASSES_ROOT\.ndf]
    @="ndf.Document"[HKEY_CLASSES_ROOT\ndf.Document]
    @="ndf 文件"
    [HKEY_CLASSES_ROOT\wab_auto_file\shell\open\command]
    @="\"C:\\Program Files\\ndf\\ndfapp.exe\" %1"
      

  2.   

    这是Shell编程了,注册自己的文档类型!
      

  3.   

    BOOL CNBbrApp::InitInstance()
    {
    // Parse command line for standard shell commands, DDE, file open
    CCommandLineInfo cmdInfo;
    ParseCommandLine(cmdInfo);
    RegeditPcoFileType(); int nCommand = cmdInfo.m_nShellCommand;
    switch( nCommand)
    {
    case CCommandLineInfo::FileNew:
    AfxMessageBox(IDS_NOTRUNAP, MB_OK|MB_ICONINFORMATION );
    break;
    case CCommandLineInfo::FileOpen:
    {
    CString strFileName = cmdInfo.m_strFileName;
    if( strFileName.IsEmpty() == FALSE )
    RestoreSpecFile( strFileName );
    }
    break; return TRUE;
    }RegeditPcoFileType()完成注册表的填写