Professional UI Solutions
Site Map   /  Register


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 » What have I missed? Collapse All
Subject Author Date
Bertil Morefält Nov 5, 2009 - 5:18 AM


I have an MDI application with 28 dll:s (MFC Extenstion DLL:s) and I am trying to bild a new MFC Extenstin DLL where I want to use yours ProfUIS 2.85.  My new DLL have CAnvFrame (CMDIChildWnd), CAnvDoc (CDocument)  and CAnvView (CFormView) classes. I have mixed yours examples MIDIDOCVIEW and FormView from StatusPanes. When I comile my example I get the following error when CAnvView is done.

1>c:\program files (x86)\foss software inc\prof-uis\include\exttempl.h(306) :

error C2664: ’CExtAFV<CExtAFVBase>::CExtAFV(__EXT_MFC_SAFE_LPCTSTR,CWnd *)’ :  cannot convert parameter1 from ’UINT’ to ’__EXT_MFC_SAFE_LPCTSTR’

What have I done wrong?

My class declaration begins with..


#pragma once

#ifdef IMPL_DANV

    #define CLASS_DECL_DANV  _declspec(dllexport)


   #define CLASS_DECL_DANV  _declspec(dllimport)


#include "ExtButton.h"

class CAnvDoc;

// CAnvView


    : public CExtWA < CExtWS < CExtAFV < CFormView >  > >


protected: // create from serialization only



// Form Data



    enum { IDD = IDD_DEDU_AAA };

    CExtButton m_ctlOk;



and the cpp-file begins with:

#include "stdafx.h"

#include "DAnv.h"

#include "Dedu.h"

#include "AnvFrame.h"

#include "AnvDoc.h"

#include "AnvView.h"

// CAnvView



    : CExtWA < CExtWS < CExtAFV < CFormView > > > ( CAnvView::IDD, ((CWnd *)NULL) )







Technical Support Nov 5, 2009 - 1:31 PM

You faced a Visual C++ bug related to the incorrect exporting of template based classes. The solution is tricky. You need to declare one additional non-exported class:

class /* not exported-imported */ CDllInternalFormViewClass : public CExtWA < CExtAFV < CFormView > >
. . .

class  CLASS_DECL_DANV CAnvView : public  CDllInternalFormViewClass
. . .

Your CAnvView will need to implement all the virtual methods present in the CDllInternalFormViewClass class.