Codejie's C++ Space

Using C++

LingosHook:wxWidget处理命令行代码



class MyApp: public wxApp {
public:
    
bool OnInit();
protected:
    
static const wxCmdLineEntryDesc _cmdLineDesc[3];
}
;

DECLARE_APP(MyApp)


IMPLEMENT_APP(MyApp)

const wxCmdLineEntryDesc MyApp::_cmdLineDesc[3= 
    
{
        
{ wxCMD_LINE_OPTION, wxT("f"), NULL, wxT("LingosHook database file(default is 'LingosHook.db3')."), wxCMD_LINE_VAL_STRING },
        
{ wxCMD_LINE_OPTION, wxT("F"), NULL, wxT("LingosHook database file(default is 'LingosHook.db3')."), wxCMD_LINE_VAL_STRING },
        
{ wxCMD_LINE_NONE }
    }
;

bool MyApp::OnInit()
{
    wxInitAllImageHandlers();

    wxCmdLineParser parser (_cmdLineDesc, argc, argv);

    
if(parser.Parse() == 0)
    
{
        wxString str 
= wxEmptyString;
        
if(parser.Found(wxT("f"), &str) || parser.Found(wxT("F"), &str))
        
{
            CConfigData::m_strDBFile 
= str;
        }
    
    }


    LingosHookFrame
* MainFrame = new LingosHookFrame(NULL, wxID_ANY, wxEmptyString);
    MainFrame
->SetIcon(wxICON(ICON_MAIN));
    SetTopWindow(MainFrame);
    MainFrame
->Show();

    
return true;
}


    啥也不说,自己看。。。

posted on 2010-08-13 15:47 codejie 阅读(765) 评论(0)  编辑 收藏 引用 所属分类: C++轮子精神LingosHook


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


公告

Using C++

导航

统计

留言簿(73)

随笔分类(513)

积分与排名

最新评论

阅读排行榜

评论排行榜