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 » Application from application withard crashes at startup Collapse All
Subject Author Date
Andreas Werner Nov 17, 2006 - 8:04 AM

Dear support Team,

I created a MDI application with the Prof-UIS application wizard in Visual Studio. I chose static linking with MFC. I left all the other settings at its default. I can compile the generated code, but when I start the aplication it fails in the Create method of the CExtResDlg class. The following assert fails:
ASSERT( hInst != NULL );

It seems, that some poeple in the forums had similar problems, but I could not find postings, that answer my problem.


Here is the code where the debugger stops:

BOOL CExtResDlg::Create(
    __EXT_MFC_SAFE_LPCTSTR lpszTemplateName,
    CWnd * pParentWnd // = NULL
    )
{
    __PROF_UIS_MANAGE_STATE;
    ASSERT(
            HIWORD(lpszTemplateName) == 0
        ||    AfxIsValidString( lpszTemplateName )
        );

    m_lpszTemplateName = lpszTemplateName; // used for help
    if(        HIWORD(m_lpszTemplateName) == 0
        &&    m_nIDHelp == 0
        )
        m_nIDHelp = LOWORD((DWORD)m_lpszTemplateName);
    m_lpszTemplateName_SAVED = m_lpszTemplateName;
HRSRC hResource = NULL;
HINSTANCE hInst =
        g_ResourceManager->FindResourceHandle(
            RT_DIALOG,
            UINT(LPCTSTR(lpszTemplateName)),
            NULL,
            &hResource
            );
    ASSERT( hInst != NULL ); <== THE DEBUGGER STOPS HERE
    ASSERT( hResource != NULL );
    if( hInst == NULL )
        return FALSE;
HGLOBAL hTemplate = LoadResource( hInst, hResource );
    ASSERT( hTemplate != NULL );
BOOL bResult = CreateIndirect( hTemplate, pParentWnd, hInst );
    FreeResource( hTemplate );
    return bResult;
}


With best regards Andreas Werner

Suhai Gyorgy Nov 17, 2006 - 8:15 AM

Please read FAQ How to link statically with Prof-UIS?. You need to include Prof-UIS resources to your program.

Andreas Werner Nov 20, 2006 - 3:56 AM

Hallo,

I am using Prof-UIS version 2.6.0. The HOWTO seems to refer to older versions:

I changed the following settings in my project:
I added __STATPROFUIS_WITH_DLLMFC__ to the Preprocessor Definitions field in the C/C++ and Resources categories and recompiled the source code.


The line is prensent in the Prof-UIS.h file:
#define __EXT_PROFUIS_STATIC_LINK_WITH_RESOURCES

I can only compile the libary projects if the line is present. If I take it away the compilation fails.

This code is also allready present in the *.rc2 file:
/////////////////////////////////////////////////////////////////////////////
// Add manually edited resources here...
#if ( !(defined _AFXDLL && !defined __STATPROFUIS_WITH_DLLMFC__) )
#include <Resources/Resource.rc>
#endif


I still can’t start the application it crashes with the same error as before.

With best regards Andreas Werner

Technical Support Nov 20, 2006 - 12:47 PM

The FAQ is applicable to any version of Prof-UIS. Please try rebuilding your application completely.

Andreas Werner Nov 20, 2006 - 1:27 AM

Hello,

Now I have created a new project with the application wizard. In the wizard I chose dynamic linking with MFC. In Visual Studio I chose the “Win 32 Debug” configuration. I can compile the program. I copied the ProfUIS260md.dll to the output directory “Debug”. When I start the application the debugger stops again in the Create method of the CExtResDlg class.

With best regards Andreas Werner