我要使用skincrafter来改变程序的界面,但是按照帮助文档上面提示,在代码中加入了skincrafter之后界面仍然没有生效,帮助文档的提示为:
Visual C++ 6.0Go to Class Wizard (Ctrl + W), press "Add Class"/"From a type library" then choose the skincrafter.dll and press OK, class ISCSkin will be created for your use
VC++ ISCSkin *m_pSkin = new ISCSkin; // The code in CODE SECTION has to be called in InitInstance() function,
// before creation of a main window

/* ------------ Begin of CODE SECTION ------------- */
CoInitialize(NULL);
m_pSkin->CreateDispatch("SkinCrafter.SCSkin");
m_pSkin->InitLicenKeys("SKINCRAFTER","SKINCRAFTER.COM","[email protected]","DEMOSKINCRAFTERLICENCE");
m_pSkin->DefineLanguage(0);
m_pSkin->InitDecoration(1);
/* ------------ End of CODE SECTION ------------- */ m_pSkin->LoadSkinFromFile("D:\\Skin.skf");
m_pSkin->ApplySkin();
请各位大虾发表意见! 谢了!!!

解决方案 »

  1.   

    这个很简单用。D:\\Skin.skf这个应该指到实际路径。我用的一个dialog。
    1. 倒入类型库。(Go to Class Wizard (Ctrl + W), press "Add Class"/"From a type library" then choose the skincrafter.dll and press OK, class ISCSkin will be created for your use
    VC++)
    2. CTestDlgApp头文件中定义ISCSkin* m_pSkin;
    3. 实现中加入代码,注意皮肤路径一定要对
    BOOL CTestDlgApp::InitInstance()
    {
    AfxEnableControlContainer(); // Standard initialization
    // If you are not using these features and wish to reduce the size
    //  of your final executable, you should remove from the following
    //  the specific initialization routines you do not need.#ifdef _AFXDLL
    Enable3dControls(); // Call this when using MFC in a shared DLL
    #else
    Enable3dControlsStatic(); // Call this when linking to MFC statically
    #endif

    m_pSkin = new ISCSkin;
    /* ------------ Begin of CODE SECTION ------------- */
    CoInitialize(NULL);
    m_pSkin->CreateDispatch("SkinCrafter.SCSkin");
    m_pSkin->InitLicenKeys("SKINCRAFTER","SKINCRAFTER.COM","[email protected]","DEMOSKINCRAFTERLICENCE");
    m_pSkin->DefineLanguage(0);
    m_pSkin->InitDecoration(1);
    /* ------------ End of CODE SECTION ------------- */

    m_pSkin->LoadSkinFromFile("D:\\Program Files\\SkinCrafter\\SkinCrafterWin32\\Skins\\Eclipse.skf");
    m_pSkin->ApplySkin();
    CTestDlgDlg dlg;
    m_pMainWnd = &dlg;
    int nResponse = dlg.DoModal();
    if (nResponse == IDOK)
    {
    // TODO: Place code here to handle when the dialog is
    //  dismissed with OK
    }
    else if (nResponse == IDCANCEL)
    {
    // TODO: Place code here to handle when the dialog is
    //  dismissed with Cancel
    } // Since the dialog has been closed, return FALSE so that we exit the
    //  application, rather than start the application's message pump.
    return FALSE;
    }