Bonjour,

j'ai une dialogue qui gére l'affichage de caratère unicode que je souhaite compiler avec les option unicode.

Mon projet principale ne gere pas le mode unicode. ( car non compiler avec l'option)
J'ai réaliser une fonction d'initialisation à ma dialogue qui passe a celle ci des WCHAR.

Donc j'aimerais que ma dialogue se charge d'affecter les WCHAR au CString compilé en unicode.

Pour ce faire j'ai choisie d'isoler toute la dialogue qui affiche les caratères unicode dans un projet DLL que je compile avec l'option unicode.

Mes questions sont :
* de savoir si je peux mettre des ressources dans une DLL ?
* Qu'elle type de DLL dois je créer ? (extension, regulière )

Mon résultat doit juste me permettre d'appeller ces methodes pour afficher la dialogue

ma DLL doit exporter la classe "CTableCaracteresDlg"
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
 
/* .h de la classe
 
#pragma once
 
#include "grid\gridctrl.h"
#include "afxwin.h"
 
#define DLLEXPORT _declspec(dllexport)
 
typedef struct structCaractereClavier{
public :
         int iNumLigne;
         int iNumColonne;
        CString strSequenceCaracteres;
        CString strCommentaire;
} structCaractereClavier;
 
 
 
typedef CList<structCaractereClavier *, structCaractereClavier *> lstPPCaracteresClavier;
 
 
// Boîte de dialogue CTableCaracteresDlg
 
class CTableCaracteresDlg : public CDialog
{
	DECLARE_DYNAMIC(CTableCaracteresDlg)
 
private:
 
	CFrameWnd * m_pMainFrame;
 
	CString	m_strCaractereChoisi;
	CString m_strTableCourante;
	CSize m_OldSize;
	CString m_strCommentaire;
//	CString m_strCode;
	lstPPCaracteresClavier * m_plstCaracteres;
	CComboBox m_comboChoixTable;
 
	void ClearTable();
	void RedimensionnerFenetre();
	void InitialiserListeNomsDeTables();
 
protected:
	DLLEXPORT virtual void DoDataExchange(CDataExchange* pDX);    // Prise en charge DDX/DDV
	DLLEXPORT virtual BOOL OnInitDialog();
	DLLEXPORT BOOL PreTranslateMessage(MSG* pMsg);
/*	afx_msg void OnSysKeyDown( UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnSysKeyUp( UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
*/
	DECLARE_MESSAGE_MAP()
 
public:
 
 
 
	CGridCtrl m_grdTableCaracteres;
 
	CMapStringToPtr m_lstTablesCaracteres;
 
	DLLEXPORT CTableCaracteresDlg(CWnd* pParent = NULL);   // constructeur standard
	DLLEXPORT virtual ~CTableCaracteresDlg();
	DLLEXPORT  void createDLG() ;
 
	//DLLEXPORT void SetPMainFrame(CFrameWnd * pMainFrame);
	void Initialiser();
	DLLEXPORT CString GetCaractereChoisi();
	DLLEXPORT CString GetTableCourante();
 
	void ChargerTableComplete(void);
	DLLEXPORT void ChargerTable(CString strNomTable);
 
	void GetListeNomsClaviers(CList<CString, CString&>& lstNomsClaviers) ;
	lstPPCaracteresClavier * GetListeCaracteres(CString strNomClavier) ;
 
	DLLEXPORT void AjouterRangeCaracteresDansTable(CString strNomClavier, int iNumLigne, int iNumColonne, CStringArray  *tabCaracteresUnicodes, CString  strCommentaire) ;
	DLLEXPORT void AjouterSequenceCaracteresDansTable(CString strNomClavier, int iNumLigne, int iNumColonne, CStringArray  *tabCaracteresUnicodes, CString  strCommentaire) ;
	DLLEXPORT void AjouterCaractereDansTable(CString strNomClavier, int iNumLigne, int iNumColonne, WCHAR *  strCaracteres, CString  strCommentaire) ;
	//void ViderTablesCaracteres() ;
 
// Données de boîte de dialogue
	enum { IDD = IDD_DLG_TABLECARACTERES };
 
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnBnClickedValider();
    afx_msg void OnGridDblClick(NMHDR *pNotifyStruct, LRESULT* pResult);
    afx_msg void OnGridToolTipsCreated(NMHDR *pNotifyStruct, LRESULT* pResult);
/*	afx_msg void OnAffichageTableCaracteres();
	afx_msg void OnAffichageTableCaracteres01();
	afx_msg void OnAffichageTableCaracteres02();
	afx_msg void OnAffichageTableCaracteres03();
	afx_msg void OnAffichageTableCaracteres04();
	afx_msg void OnAffichageTableCaracteres05();
	afx_msg void OnAffichageTableCaracteres06();
	afx_msg void OnAffichageTableCaracteres07();
	afx_msg void OnAffichageTableCaracteres08();
	*/
	afx_msg void OnCbnDropdownCombochoixtable();
	afx_msg void OnCbnKillfocusCombochoixtable();
	afx_msg void OnCbnCloseupCombochoixtable();
	afx_msg void OnCbnSelchangeCombochoixtable();
};
 
*/
Code qui doit se trouver dans l'appli qui utilise ma dll :

les ligne de code qui suive se trouve à la fin de ma fonction InitInstance de ma classe APP
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 
// instancie mon objet
theApp.m_MainFrame->m_dlgTableCaracteres=new CTableCaracteresDlg(theApp.m_MainFrame) ;
 
 
theApp.m_MainFrame->m_dlgTableCaracteres->createDLG() ;
 /*   code inclu dans la dll
  void CTableCaracteresDlg::createDLG()
 {
                // m_pMainFrame est initialisé dans le constructeur avec la classe MAinFram de l'application parent
	// creation de la table des caractères
	int ret=this->Create(IDD_DLG_TABLECARACTERES,m_pMainFrame) ;
	if (!ret)
	{
		AfxMessageBox("Impossible de créer la fenêtre table de caracteres\n");
		return ;      // échec de la création
	}
	//m_dlgTableCaracteres->SetPMainFrame(this);
	this->MoveWindow(100, 100, 600, 600, false);
	this->Initialiser();
 
 
   }
*/
apparamant la fonction create se termine avec 0, la dilaogue n'a pas pu etre créé


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
	theApp.m_MainFrame->m_dlgTableCaracteres->ChargerTable("CLAVIER_MATH1");
	theApp.m_MainFrame->m_dlgTableCaracteres->ShowWindow(SW_SHOW);
la fin de la focntion initInstance se termine avec une erreur dans la fonction
AfxCallWndProc.

C'est surement parque la dialogue n'est pas créé.

Auriez vous des conseils pour m'aider à créer et à insérer ma classe

cordialement

olivier
[a l'avenir pense à mettre la balise code ,Merci Farscape]