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 » CExtGridCellFile::GetFile Debug assertion Collapse All
Subject Author Date
Noa Naot Mar 18, 2010 - 4:24 AM

Hi,


When button is pressed on the ellipsis button for the first time, i get a assertion. In Release build, operation takes longer than expected.


Assertion origins from the line:



ASSERT(FromHandlePermanent(hImageList) == NULL);  in CImageList::Attach



called from g_ilShellSmall.Attach( hSysImageList ); (ExtControlsShell.cpp line 766)


called from CExtShellBase::Shell_Init


called from CExtShellLock _shellLock;


called from CExtGridCellFile::GetFile

 


What can be the cause of this?

I am using Prof-UIS version 2.85. Problem occurs since i upgraded to 2.85. Before, i did not have such problem.


 





In addition - the file dialog that is eventually opened if i ignore the assertion has a different style than the normal file open dialog. I tried to remove the flag OFN_EXPLORER but it did not help.


 


Thank you,


Noa


 

Noa Naot Mar 25, 2010 - 2:00 PM

Thank you,


I dont have any other code using LVSIL_SMALL anywhere. In addition - my code used to work with Prof-UIS 2.84 and below, and the assertion takes place since 2.85. Could it be sothing else? thanks Noa

Technical Support Mar 26, 2010 - 6:56 AM

You can set a breakpoint at the g_ilShellSmall image list initialization code where the image list handle is attached to it and run your application. You will see where it’s initialized for the first time and why it becomes initialized for the second time.
Do you use only one copy of Prof-UIS in the running instance of your application? Do you have any Prof-UIS based regular DLLs? Please also note, Prof-UIS library should be used in the one UI thread only.

Technical Support Mar 19, 2010 - 12:15 PM

Here is the code which gets the shell

               if( g_ilShellSmall.GetSafeHandle() == NULL )
                        {
                                    SHFILEINFO _sfi;
                                    ::memset( &_sfi, 0, sizeof(SHFILEINFO) );
                                    HIMAGELIST hSysImageList = (HIMAGELIST)
                                                ::SHGetFileInfo(
                                                            (LPCTSTR)g_pidlDesktop,
                                                            0,
                                                            &_sfi,
                                                            sizeof(SHFILEINFO),
                                                            SHGFI_PIDL|SHGFI_SYSICONINDEX|SHGFI_SMALLICON
                                                            );
                                    if( hSysImageList == NULL )
                                    {
                                                ASSERT( FALSE );
                                                Shell_DoneImpl();
                                                if( bEnableThrowExceptions )
                                                            ::AfxThrowUserException();
                                                return false;
                                    }
                                    g_ilShellSmall.Attach( hSysImageList );
                        }

If you have similar code in your application, then the g_ilShellSmall.Attach( hSysImageList ); line of code above can really try to attach image list handle which is already attached to other CImageList object. If our guess is correct, then we would like to ask you to switch using the CExtShellBase::g_ilShellSmall and CExtShellBase::g_ilShellBig image lists.


Noa Naot Mar 18, 2010 - 1:35 PM

Hi,


 


Yes, i have.

Technical Support Mar 18, 2010 - 12:31 PM

Did you invoke the AfxOleInit() API in the InitInstance() virtual method of the CWinApp-derived class in your project?