Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » how to load a xml skin? Collapse All
Subject Author Date
delu qiu May 17, 2006 - 10:38 AM

Hi,

I got a problem when I call m_Skin.Load() function to lnstall a xml skin,

here is my code:
------------------------------------------------------------------------
CString strPath = "C:\\Aqua.xml";

    ASSERT( ! strPath.IsEmpty() );
CExtPaintManagerSkin * pPM = new CExtPaintManagerSkin;
    if( ! pPM->m_Skin.Load( LPCTSTR(strPath) ) )
    {
        ::AfxMessageBox( _T("Failed to load initial skin.") );
        delete pPM;
    }
    else
        g_PaintManager.InstallPaintManager( pPM );    
------------------------------------------------------------------------

I trace the Load function, and it failed at:
--------c:\.......\VC98\Include\COMIP.H------------------------------
hr = CoCreateInstance(rclsid, pOuter, dwClsContext, __uuidof(IUnknown),

reinterpret_cast<void**>(&pIUnknown));


How can I make it work?
In addition, I can successfully run the similar sample project

"\Prof-UIS\Samples\Skinable".

Thanks

Technical Support May 17, 2006 - 11:46 AM

Please make sure that you initialized OLE support for the application. This is required for the MSXML parser:

BOOL CSkinableApp::InitInstance()

{
   ...

   if( ! ::AfxOleInit() )
   {
      ASSERT( FALSE );
      return FALSE;
   }
   ...



delu qiu May 17, 2006 - 11:59 AM

Thanks,

I add the AfxOleInit to the project

and I got a ’Debug Assertion Failed’ when I trace to below zin ExtSkinItem.cpp
--------------------------------------------------------------------------------------------------
    try
    {
        if( ! _LoadGlyphsCollection( pElement ) )
            throw 0;
        if( ! _LoadNestedCollection( pElement ) ) //’Debug Assertion Failed’
            throw 0;

Technical Support May 18, 2006 - 3:58 AM

Please let us know if the Skinable or Pluggable sample applications can load successfully the same XML file. Please also ensure the following:

1) If you want to place the Aqua skin into some folder, you should copy both the Aqua.XML file and the Aqua folder with all the subfolders and .PNG files into your folder.

2) You should use both XML and binary skin files from the same version of Prof-UIS which is used in your application.