Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

RegisterClass need to use RegisterClassEx for x64

$
0
0

Hi Igor,

Thanks for your help in the past. I have a new problem...

We are using VS2008 VC++. We have a large Win32 main application. We are using an MFC DLL by LoadLibrary (XXX.dll). We use both win32 and x64 platforms.  

When our main application pops a dialog (defined in XXX.dll), we had an access violation exception in RegisterClass() to register a custom control class. THIS HAPPENED ONLY IN X64, Win32 was fine.

This was fixed by using WndClassEx and calling RegisterClassEx()…. RegisterClass() was causing an exception only in x64, and not in win32. Now our custom control is showing OK on both x64 and win32.

Now, I am having a different access violation problem in the same dialog. This happens in the CListCtrl’s InsertItem() method. This causes an access violation and the call stack leads to AfxCallWindowProc.

AfxWndProcDllStatic(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)

{

      AFX_MANAGE_STATE(&afxModuleState);

      return AfxWndProc(hWnd, nMsg, wParam, lParam);

}

In this second problem I am yet to resolve, if I comment out m_listview.SetImageList(), the access violation does not happen, and the dialog does come out for both x64 and win32. But after some click which is to alter the custom control image, it caused an exception in x64.... Here, the call stack also points to the same AfxWndProc. 

I do not know if these two problems (the first one already fixed) are related or not... But both are coming from  the same MFC DLL dialog and only occur in x64, not in win32.     ..... Something is not right for x64...

Thank you

Makoto

  




Viewing all articles
Browse latest Browse all 15302

Trending Articles