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 » Customization with statically linked library Collapse All
Subject Author Date
Suhai Gyorgy Sep 30, 2005 - 3:24 AM

Dear Support,


I would like to use customization in my application, but came to realize it’s not that easy if my app is statically linked with Prof-UIS. I made some reading here on the forum and found the answer in a message arriving in March, 2004 describing the same situation. You wrote this at that time:


<start of message>


At the moment you cannot directly use the Prof-UIS resource-dependent features in the applications statically linked with Prof-UIS.
But there is a workaround. Please follow the next steps:

Make the following changes below in the profuislib project:
1. Open the Prof-UIS workspace and make the profuislib project active;
2. Open the Prof-UIS.h file and comment the following lines:

// #if (!defined _AFXDLL || defined __STATPROFUIS_WITH_DLLMFC__) 
//     #define __EXT_MFC_NO_CUSTOMIZE 
// #endif // (defined _AFXDLL || !defined __STATPROFUIS_WITH_DLLMFC__)

3. Add the following files to the project:
    ./Include/ExtCustomize.h
    ./Include/ExtIconEditDlg.h
    ./Src/ExtCustomize.cpp
    ./Src/ExtIconEditDlg.cpp
4. Select the required configuration and build the project.

Make some changes in your application:
1. Copy the ./profuisdll/profuisdll.rc file to the project’s directory.
2. Open profuisdll.rc in the text editor, find the VS_VERSION_INFO section and remove this entire section.
3. Copy the ./profuisdll/idd_ext_color_dlg.ico file to your project’s directory.
4. Copy the contents of the ./profuisdll/res directory to your ./res directory.
5. Add the #include "profuisdll.rc" line just after the comment "Add additional manually edited resources here..." in your application’s ./res/*.rc2 file. If you do not do this, the Prof-UIS assert at startup because it is trying to access resources that are not available.
6. Copy all constant definitions from the ./profuisdll/resource.h file to your resource.h


<end of message>


I followed the steps but when I tried to compile my application (your profuislib project compiled just fine), I got a fatal resource compilation error: "#endif expected." I have found a missing #endif in your profuisdll.rc app in the English U.S resources at the commented part (the pair of "#ifndef _MAC" just before Version), but that still didn’t help, I got the same error. My app compiled successfully before.


Could you give me a reason for that? I wonder maybe version 2.40 works differently in this context than the one in March 2004.


Thank you: Chris.

Technical Support Sep 30, 2005 - 7:48 AM

Please ensure that you correctly removed the VS_VERSION_INFO section. Exactly the following lines need to be removed:

/////////////////////////////////////////////////////////////////////////////

//

// Version

//

 

VS_VERSION_INFO VERSIONINFO

 FILEVERSION 2,4,3,0

 PRODUCTVERSION 2,4,3,0

 FILEFLAGSMASK 0x3fL

#ifdef _DEBUG

 FILEFLAGS 0x1L

#else

 FILEFLAGS 0x0L

#endif

 FILEOS 0x4L

 FILETYPE 0x2L

 FILESUBTYPE 0x0L

BEGIN

    BLOCK "StringFileInfo"

    BEGIN

        BLOCK "040904b0"

        BEGIN

            VALUE "Comments", "This is part of the Professional User Interface Suite library (www.prof-uis.com)\0"

            VALUE "CompanyName", "FOSS Software, Inc.\0"

            VALUE "FileDescription", "Professional User Interface Suite DLL\0"

            VALUE "FileVersion", "2, 4, 3, 0\0"

            VALUE "InternalName", "Professional User Interface Suite DLL\0"

            VALUE "LegalCopyright", "Copyright é 2001-2005 FOSS Software, Inc.\0"

            VALUE "LegalTrademarks", "\0"

            VALUE "OriginalFilename", "ProfUIS[VersionNumber][Modifiers].dll\0"

            VALUE "PrivateBuild", "\0"

            VALUE "ProductName", "Professional User Interface Suite\0"

            VALUE "ProductVersion", "2, 4, 3, 0\0"

            VALUE "SpecialBuild", "\0"

        END

    END

    BLOCK "VarFileInfo"

    BEGIN

        VALUE "Translation", 0x409, 1200

    END

END


Suhai Gyorgy Sep 30, 2005 - 8:13 AM

Hi! I’ve just compiled profuislib project again and although it compiled successfully, I got the following warning:


...


ExtTabPageContainerWnd.cpp


\Program Files\FOSS Software Inc\Prof-UIS\Src\ExtTabPageContainerWnd.cpp(939) : warning C4541: ’dynamic_cast’ used on polymorphic type ’CExtTabWnd’ with /GR-; unpredictable behavior may result


...


Could this cause the problem? I’ve checked under project->profuislib Properties... all the command line arguments under C/C++, Librarian and Browse information, but haven’t seen /GR- option... I’m really clueless now.


Thank you: Chris.

Technical Support Sep 30, 2005 - 10:11 AM

This issue was fixed in Prof-UIS 2.42. Please open the CExtTabPageContainerOneNoteWnd::PageInsert() method and replace the following lines:

CExtTabOneNoteWnd * pWndTab = 

      dynamic_cast< CExtTabOneNoteWnd * >( m_pWndTab );
with
CExtTabOneNoteWnd * pWndTab = 

      DYNAMIC_DOWNCAST( CExtTabOneNoteWnd, m_pWndTab );






Suhai Gyorgy Sep 30, 2005 - 7:51 AM

I have removed all of those lines, and I’m guessing I need to remove the #ifndef _MAC line from the beginning of this section and #endif from the end of it.


I forgot to add: I’m using VS 7.1.


Thanks

Technical Support Sep 30, 2005 - 10:14 AM

We found the problem. It seems there is some conflict between the compiler and Unicode symbols when the resource file is included externally. Please open the profuisdll.rc file and remove all the language resources but those having to do with English. After this all should work fine.

Suhai Gyorgy Sep 30, 2005 - 12:45 PM

Thank you, it works now.