We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Using Essential Grid v3.0.1 control from unmanaged MFC/C++ code

Thread ID:

Created:

Updated:

Platform:

Replies:

26720 Mar 30,2005 01:59 PM Mar 30,2005 02:32 PM Windows Forms 1
loading
Tags: GridControl
Pawel Skurski
Asked On March 30, 2005 01:59 PM

Has anyone tried to use the latest grid control from MFC/C++ unmanaged code and is it technically possible? Also any sample would be greatly appreciated. Thanks in advance, Pawel

Administrator [Syncfusion]
Replied On March 30, 2005 02:32 PM

Hi Pawel, As a general comment, even microsoft is a little luke warm in its support of using .NET controls in unmanaged code. If things work, then it works. But when they do not work, you have to trouble shoot each problem and try to work around it. We do have a sample that shows the grid being used from MFC. There are some quirks. You''ll see we had to handle PreProcessKeyMessage to get key messages correctly routed to the grid. You have to check if you find other issues. I uploaded the sample here: WindowsForms.zip Additionally you should also add the following to the CMFCAppDlg and call it from OnInitDialog (I don''t think we do that in the sample but I found this mentioned in a support incident when I did a search for MFC interop - maybe it helps you). void CMFCAppDlg::AddWS_EX_CONTROLPARENT(HWND theWnd) { bool hasChild = FALSE; HWND tempWnd = NULL; tempWnd = ::GetWindow(theWnd,GW_CHILD); while(tempWnd != NULL) { hasChild = TRUE; AddWS_EX_CONTROLPARENT(tempWnd); tempWnd = ::GetNextWindow(tempWnd, GW_HWNDNEXT); } if(hasChild) { DWORD currStyle = ::GetWindowLong(theWnd, GWL_EXSTYLE) ; currStyle = currStyle | WS_EX_CONTROLPARENT; ::SetWindowLong(theWnd, GWL_EXSTYLE, currStyle); } } Stefan >Has anyone tried to use the latest grid control from MFC/C++ unmanaged code and is it technically possible? Also any sample would be greatly appreciated. > >Thanks in advance, >Pawel >

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;