Bonjour,

j'essai de migrer un projet de visual studio 6 (win XP) vers visual studio 2010 sous Windows 7.
Mon programme est un petit executable MFC qui permet d'afficher une fenêtre RDP (suite à un appel d'une dll)
Mon soucis à ce jour est que je n'arrive même pas à exécuter mon petit programme en autonome : Il plante à l'éxecution (en debug ou release dans visual studio) :
Detected memory leaks!
Dumping objects ->
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\occcont.cpp(922) : {393} normal block at 0x002AB0D0, 12 bytes long.
Data: < > 00 00 00 00 00 00 00 00 00 00 00 00
Object dump complete.
The program '[5952] monprogrammerdpclientMfc.exe: Native' has exited with code 0 (0x0).
L'erreur intervient dans occcont.cpp , ligne 925: La méthode de occcont.cpp ci-dessous est appelée après plusieurs étapes lors du domodal() sur mon objet dont la classe est dérivée de CDialog.
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
BOOL COleControlContainer::FillListSitesOrWnds(_AFX_OCC_DIALOG_INFO* pOccDlgInfo)
{
	if (pOccDlgInfo==NULL) { return FALSE; }
	COleControlSiteOrWnd *pSiteOrWnd = NULL;
	//When this function is called, the m_listSitesOrWnds contains only ActiveX controls
	//created by MFC from resource, or by user who called CreateControl.
	//The code inserts the Win32 controls (found in dialog template resource) into
	//the list, before, in between or after the ActiveX controls, according to the 
	//order in the dialog template.
	POSITION pos = m_listSitesOrWnds.GetHeadPosition();
	POSITION posOld = pos;
	if(pos)
	{
		pSiteOrWnd = m_listSitesOrWnds.GetNext(pos);
	}

	HWND hwndStart=NULL;
	for(unsigned i = 0; i < pOccDlgInfo->m_cItems; i++)
	{
		ASSERT(!pSiteOrWnd || pSiteOrWnd->m_pSite); //pSiteOrWnd must point at either ActiveX or NULL (list end).
		if(pSiteOrWnd!=NULL && pSiteOrWnd->m_pSite!=NULL &&
			pSiteOrWnd->m_pSite->m_nID == pOccDlgInfo->m_pItemInfo[i].nId)
		{ => ne passe pas ici
			//If not Windowless control, update the starting position in z-order search.
			if (pSiteOrWnd->m_pSite->m_hWnd != NULL)
			{
				hwndStart = pSiteOrWnd->m_pSite->m_hWnd;
			}
			posOld = pos;
			pSiteOrWnd = pos ? m_listSitesOrWnds.GetNext(pos) :	NULL;
		}
		else
		{Passe ici
			if(pOccDlgInfo->m_pItemInfo[i].nId)
			{
				//AfxGetDlgItemStartFromHWND fix , is to handle non-unique ids 
				//of resource items (IDC_STATIC), that causes ::GetDlgItem
				//to always find the first (in Win32 z-order child list) window with
				//this id, and thus m_listSitesOrWnds contained several instances of the same hwnd.
				
				//First time start searching from first z-order, else
				//search from 1 after the previous window.
				HWND hwndSearchFrom= (hwndStart == NULL) ? 
									 GetWindow(m_pWnd->GetSafeHwnd(),GW_CHILD) :
									 ::GetWindow(hwndStart,GW_HWNDNEXT);
				
				HWND hwndCtrl=AfxGetDlgItemStartFromHWND(pOccDlgInfo->m_pItemInfo[i].nId, hwndSearchFrom);
				//If not found, revert to prev method of GetDlgItem, this means Win32 children list and 
				//resource item array are out of sync
				if (hwndCtrl == NULL)
				{
					hwndCtrl = ::GetDlgItem(m_pWnd->GetSafeHwnd(),pOccDlgInfo->m_pItemInfo[i].nId);
					TRACE(traceAppMsg, 0, "Warning: Resource items and Win32 Z-order lists are out of sync. Tab order may be not defined well.\n");
				}
				COleControlSiteOrWnd *pTemp =
					new COleControlSiteOrWnd(
						hwndCtrl,
						pOccDlgInfo->m_pItemInfo[i].bAutoRadioButton);
				ASSERT(IsWindow(pTemp->m_hWnd));
				if (IsWindow(pTemp->m_hWnd)) Plante ici, m_hWnd est null
Après avoir tenté de recompiler sous studio 2010, les classes en relation avec MFC et ATL, comme il est préconisé dans la doc des MFC lors des migrations, ça ne change rien.
Préconisation microsoft : http://msdn.microsoft.com/en-us/libr...VS.100%29.aspx
(Ce même projet fonctionne très bien (compilation et exécution) sous XP et visual studio 6.)

Quelqu'un a-t-il eu ce genre de problème sous studio 2010 (windows 7)?

Par avance merci.