Error No Data Exchange Control With Id Mfc
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up CDialog::Create fails for dialog with ActiveX control up vote 3 down vote favorite 1 I have a module that creates a modeless dialog containing an ActiveX control. This module was part of an MFC EXE application and the creation of the dialog worked fine. Recently, I moved the module out into an ATL/COM server and copied the dialog resource from the EXE into the COM server. When trying to create the modeless dialog using CDialog::Create() an error happens. I debugged into CDialog::Create and noticed that it fails in ::CreateDialogIndirect() which returns NULL and GetLastError returns 0. I changed the "No Fail Create" flag to True in the dialog resource properties and I get more details into the error. The problem happens in the dialog's DoDataExchange() within the DDX_Control macro. This calls into the CDataExchange::PrepareCtrl() with the control's resource ID as follows: HWND CDataExchange::PrepareCtrl(int nIDC) { ASSERT(nIDC != 0); ASSERT(nIDC != -1); // not allowed HWND hWndCtrl; COleControlSite* pSite = NULL; m_pDlgWnd->GetDlgItem(nIDC, &hWndCtrl); if (hWndCtrl == NULL) { // Could be a windowless OCX pSite = m_pDlgWnd->GetOleControlSite(nIDC); if (pSite == NULL) { TRACE(traceAppMsg, 0, "Error: no data exchange control with ID 0x%04X.\n", nIDC); ASSERT(FALSE); AfxThrowNotSupportedException(); } } m_idLastControl = nIDC; m_bEditLastControl = FALSE; // not an edit item by default return hWndCtrl; } The call to the function m_pDlgWnd->GetOleControlSite() fails for the resource ID passed. By the way, the resource ID is the control's ID. Any suggestions on why this works inside the EXE and fails in the COM server? mfc cdialog com-server share|improve this question edited Nov 8 '12 at 15:57 ppeterka 15.3k44063 asked Nov 8 '12 at 15:32 user1756114 1612 add a comment| 3 Answers 3 active oldest votes up vote 3 down vote I had exactly the same problem. In my case the problem turned out to b
Forum Visual C++ & C++ Programming Visual C++ Programming Error: no data exchange control with ID 0x%04X If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register or Login before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 2 of 2 Thread: Error: no data exchange control with ID 0x%04X Tweet Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode April 13th, 2012,12:40 AM #1 itenggnaveen View Profile View Forum http://stackoverflow.com/questions/13292166/cdialogcreate-fails-for-dialog-with-activex-control Posts Junior Member Join Date Apr 2009 Posts 21 Error: no data exchange control with ID 0x%04X Hi, I am new to MFC application. i have created dialog based application in which i have added one group box and put one editbox in group box. i set group box as parent to editbox(in OnInitDialog() fun) so that when do visible = FALSE, all controls in group box are also invisible. I called UpdateData(TRUE) to get the data from this http://forums.codeguru.com/showthread.php?522912-Error-no-data-exchange-control-with-ID-0x-04X edit box but application is getting crashed when i press F10 on updatedata(true) func. when comment the code where setting group box as parent to edit box then updatedata(true) works fine. please guide me over this issue Thanks in advance Reply With Quote April 13th, 2012,05:51 AM #2 ovidiucucu View Profile View Forum Posts Visit Homepage Moderator/Reviewer Power Poster Join Date Feb 2003 Location Iasi - Romania Posts 8,165 Re: Error: no data exchange control with ID 0x%04X DDX functions placed inside CDialog::DoDataExchange, which is called as a response to UpdateData, assume they are working with controls that are child of the dialog. For more details, see Dialog Data Exchange and related topics in MSDN Library. If you change the parent of whatever control, that leads in troubles and DDX fails. So, simply DO NOT do that! Additional "design" note: a group box is a control like any other Windows built-in control (in fact, it's of "button" class, having BS_GROUPBOX style) and is not designed to have other child controls. Ovidiu Cucu "When in Rome, do as Romans do." My latest articles: http://codexpert.ro/blog/author/ovidiu-cucu/ Reply With Quote Quick Navigation Visual C++ Programming Top Site Areas Settings Private Messages Subscriptions Who's Online Search Forums Forums Home Forums Visual C++ & C++ Programming Visual C++ Programming Visual C++ FAQs C++ (Non Visual C++ Issues) C++ and WinAPI Managed C++ and C++/CLI Visual C++ Bugs & Fixes Graph
for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive Real-Time https://www.experts-exchange.com/questions/22459040/MFC-debug-assertion-failed-error.html Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Expand Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers http://love4rh.egloos.com/5539732 Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > MFC - debug assertion failed error Want to Advertise Here? Solved MFC - debug assertion failed error no error Posted on 2007-03-19 .NET Programming Visual C++.NET System Programming 2 Verified Solutions 8 Comments 2,372 Views Last Modified: 2013-11-26 Hello, My MFC project was working ok. I made a change to a line of code and it then started giving me a debug assertion failed error! It points to the ASSERT ( FALSE) line of this error no data funtion in dlgData.cpp HWND CDataExchange::PrepareCtrl(int nIDC) { ASSERT(nIDC != 0); ASSERT(nIDC != -1); // not allowed HWND hWndCtrl; COleControlSite* pSite = NULL; m_pDlgWnd->GetDlgItem(nIDC, &hWndCtrl); if (hWndCtrl == NULL) { // Could be a windowless OCX pSite = m_pDlgWnd->GetOleControlSite(nIDC); if (pSite == NULL) { TRACE(traceAppMsg, 0, "Error: no data exchange control with ID 0x%04X.\n", nIDC); ASSERT(FALSE); AfxThrowNotSupportedException(); } } m_idLastControl = nIDC; m_bEditLastControl = FALSE; // not an edit item by default return hWndCtrl; } Does anyone know what would cause this error and what should I do to get rid of it!? Thanks -D 0 Question by:indacrypt Facebook Twitter LinkedIn Google LVL 67 Active today Best Solution byQlemo The corresonding control is not existing (anymore), maybe you renamed the resource ID. This method is called when you create (or display?) your dialog, for all controls having a member variable assigned. Go to Solution 8 Comments LVL 67 Overall: Level 67 .NET Programming 8 System Program
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 카테고리 일상16 가족나들이28 프로그래밍36 PE 준비14 멋진사진들4 미분류7 이전글 목록 2012년 10월1 2012년 07월2 2012년 06월2 2012년 05월1 2012년 04월2 more... 라이프로그 아웃라이어 성공에 대한 또 다른 생각 나는 아내와의 결혼을 후회한다 남자 심리에 대한 재미있는 책. 하고 후회하는 것이 낫다. 그건, 사랑이었네 내 삶을 한~ 두번쯤 다시 보게하는 책 C++ 프로그래밍 언어 C++ 관련 최고의 서적! 이 책에 있는 내용만 다 마스터하면 다른 책 볼 필요 없다! 제프리 리처의 Windows via C/C++ 최근 덧글 저는 참조된 모든 라이브러리를 리빌드한 후에 ..by ㅎㅎ 8/22 저같은경우 Debug모드에서 스레드 모델이 달라..by 0nam 11/23 저도 같은 에러가 났습니다만 제경우에서는 deb..by 쿠니 11/1 최종훈 교수님이 맞아요~by TurboK 8/16 메모리 맵 파일 같은 경우 용량이 큰 경우 빠른 ..by 손님 7/26 사물 기반 인터넷은 WOT(Web of Thing)하고..by bergi10 12/6 저도 저번주에 용인레저 다녀왔는데.. 제가 캠핑..by 절대별로 8/2 용인레저 안티이신분.....아마도 그런거 같은..by 수영장 검색중 7/29 흠 애들 데리고 가까운데 갈려고 찾아보는중 이..by 검색중 7/29 막국수 맛있겠네여^-^ 저역시도 막국수무지..by 초코에픽 4/6 RSS 이글루스 로고 Error: no data exchange control with ID 0x#### by TurboK 2011/08/31 16:09 프로그래밍 love4rh.egloos.com/5539732 1 comments MFC로 프로그래밍하다 보면 가끔 별 거 아닌 것 같은데 사람 피곤하게 하는 오류가 있다.실행 중 발생할 수 있는 "Error: no data exchange control with ID 0x####" 도 그 중 하나다.이 오류는 생성한 대화상자의 컨트롤 ID가 잘못 인식되어 발생하는 경우다.예를 들어 IDD_DIALOG1는 1000, IDC_BUTTON1은 1001로 정의되어 있고,IDD_DIALOG1이라는 데 IDC_BUTTON1을 만들어 넣고 DDX에 추가했는데 런타임 중IDC_BUTTON1을 1001이 아닌 다른 값으로 인식하는 경우이다.또 다른 경우는 IDD_DIALOG1의 값이 1000이 아닌 다른 값으로 인식되어 발생한다.그리고 정의