{"id":1648,"date":"2022-08-30T15:18:17","date_gmt":"2022-08-30T15:18:17","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/27\/problem-about-visual-c-mfc-and-atl-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:18:17","modified_gmt":"2022-08-30T15:18:17","slug":"problem-about-visual-c-mfc-and-atl-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/problem-about-visual-c-mfc-and-atl-collection-of-common-programming-errors\/","title":{"rendered":"problem about visual-c-mfc-and-atl-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn<br \/>\narchived-forums-v-forums visual-c-mfc-and-atl<br \/>\nHi,\u00a0I created one MFC project in Visual Studio 2005. I use the following code to get local IP,#include\u00a0 &lt;winsock2.h&gt;#pragma comment(lib, &#8220;WS2_32.lib&#8221;)&#8230;\u00a0\u00a0\u00a0 char name[128];\u00a0 \u00a0\u00a0\u00a0 hostent*\u00a0 pHost;\u00a0 \u00a0\u00a0\u00a0 CString localIP;\u00a0\u00a0\u00a0 gethostname(name, 128);\u00a0\u00a0\u00a0 pHost\u00a0 = gethostbyname(name);\u00a0 \u00a0\u00a0\u00a0 localIP= inet_ntoa(*((in_addr *)pHost-&gt;h_addr));\u00a0But it always return<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn<br \/>\narchived-forums-v-forums visual-c-mfc-and-atl<br \/>\nHi,In my MFC application,\u00a0 I had used following constructs to display a modal dialog,all resources ie., Resource.h and MyProject.rc has been checked for consistency in identifiers.but, I get the below assertion on either attempting to launch dialog, using either ShowWindow\/InitDialog,\u00a0 and source code where assertion is displayed is shown below,Any help in resolving the above would be much appreciable. Thanks, in Advance&#8230;I am using VC feature pack on VS 2008 IDE(derived from WinAppEx<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn<br \/>\narchived-forums-v-forums visual-c-mfc-and-atl<br \/>\nHiI have a Custom Edit Control.When i close the application with focus on this edit control,i am getting :My Edit Control Uses RunModalLoop().This error comes only when the application is closed, in all other cases, the focus on Edit contol is lost and works smoothly.In Wincore,cpp-&gt;in RunModalLoop-&gt;if(!ContinueModal())\u00a0 &#8212;&#8212; exception is raised !Could some one tell me the reason why i am getting this exception ?Thanks,Sravanthisravanthi<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn<br \/>\narchived-forums-v-forums visual-c-mfc-and-atl<br \/>\nI am trying to execute the ACE test sample Basic_Types_Test.exe which is built using &#8220;Win32 MFC Release&#8221;. The debugger gets open in Winmain.cpp on the line &#8221; if(!pthread -&gt; InitInstance()) &#8220;. Can someone please let me know how can i fix this problem ?Is there anything related to compiler option or linking or ? Any suggestions welcome.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn<br \/>\narchived-forums-v-forums visual-c-mfc-and-atl<br \/>\nHi, Good Day!I&#8217;m trying to migrate project created in VS6.0 into VS2010.In the project there is a call to remove all elements of a CArray collection (CArray::RemoveAll). In the old project, DestructElements() implementation had also been provided.After migration, in VS2010, RemoveAll function call throws the UnHandled Exception (Access Violation reading at 0x00&#8230;).Debugging the code, the exception occurs at the following locationFile : AfxTempl.h (MFC header provided by Microsoft)Function : Set<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn<br \/>\narchived-forums-v-forums visual-c-mfc-and-atl<br \/>\nI am trying to debug an old program MFC that uses Excel to display a graph. I am not very familiar with using Excel with VC (MFC). The problem is an unhandled exception on this line:\u00a0Excel::WorkbooksPtr books = pExcelApp-&gt;GetWorkbooks();Can anyone help? I am using Windows 7 and Excel 2003. (Visual Studio 2005)\u00a0This is the code snippet:\u00a0Excel::_ApplicationPtr pExcelApp;\u00a0#if EXCEL_VER == 2000\u00a0\u00a0 pExcelApp.CreateInstance(&#8220;Excel.Application.9&#8221;);#if EXCEL_VER<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn<br \/>\narchived-forums-v-forums visual-c-mfc-and-atl<br \/>\nHello,Error is:&#8221;Error: no data exchange control with ID 0x8059.Unhandled exception at 0x7c25f2d1 in Sample.exe: User breakpoint.&#8221;\u00a0void CSample::DoDataExchange(CDataExchange* pDX) {TRACE( &#8220;DoDataExchange\\n&#8221; );CDialog::DoDataExchange(pDX);\/\/{{AFX_DATA_MAP(CSample)DDX_Control(pDX, IDC_COMBOBOX1, Combo); \/\/ Combo is CComboBox typeDDX_Text(pDX, IDC_EDIT_Chargen, Chargen); \/\/Chargen is CString type\/\/If press &#8220;Retry&#8221;, error indicate above line\/\/}}AFX_DATA_MAP }\u00a0A<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn<br \/>\narchived-forums-v-forums visual-c-mfc-and-atl<br \/>\nUnhandled exception in MSDEV.EXE (DEVSHL.DLL): 0xC0000005: Access\u00a0&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-This Exception is generated&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-I am working on VC 6.0.As I click ofFile menu-&gt;Open option .It show this error.I haveRe &#8211; Install Visual Studio 6.0.But problem still exists.Please give me solution for that, I will be thankful.\u00a0<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn<br \/>\narchived-forums-v-forums visual-c-mfc-and-atl<br \/>\nHi, I have created a webservice in vc++ using ATL server ,made it secured using IIS .Now when i am trying to access that webservice with manged code in vc++ Fails with the following error. An unhandled exception of type &#8216;System.Web.Services.Protocols.SoapException&#8217; occurred in System.Web.Services.dllAdditional information: SOAP Invalid RequestPlease help me out in this issue Thanks in Advance M.Swetha<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn<br \/>\narchived-forums-v-forums visual-c-mfc-and-atl<br \/>\nhello,i have this code.my task is to capture a image from the web cam in global value i ma getting this error. i traced out every thing but i unable identify that exception.i am sending u only some code where error is comming\/\/image\u00a0Image::Image(){\u00a0\/\/constuctor declaration\/\/ Initialise the VariablesWidth = 256; \/\/ Set the Default Image Size hereHeight = 256;\u00a0SequenceID = 0;}Image::~Image(){\/\/ Deallocate all memory allocatedif(Data != NULL) {delete []Data[0];delete []Data;}}\u00a0&amp;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn<br \/>\narchived-forums-v-forums visual-c-mfc-and-atl<br \/>\nHi All,I am working on an application and\u00a0i am getting an error on windows 7 only.&#8221;Unhandled exception at 0x10091ad1 (Mydlld.dll) in App_debug.exe: 0xC0000005: Access violation reading location 0x00000120.&#8221;on Windows XP, it is working fine.I have not tested it on Windows Vista.Is there any ,memory management difference in XP , Vista and 7??Please help me, how i can resolve this error.Thanks.Best Regards Gurmeet Singh Janjua<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn<br \/>\narchived-forums-v-forums visual-c-mfc-and-atl<br \/>\nHi,I have been using a MFC app which communicates through ATL COM with server components, WinXP 32bit, SP3, .Net Framework v4.0.30319. I have noticed that it has started throwing unhandled exception or even close itself immediately withaut trace. Generallythere is a problem with stability because I have a 3 actions (populate 3 views) and they crashes more or less regulary, but sometimes after click1(action1) other times after click2(action2), click3(action3)..I have Debug and Release configurati<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn<br \/>\narchived-forums-v-forums visual-c-mfc-and-atl<br \/>\nHere I am working on Vector based Application Implementation in VC,MicroSoft VisualStudio 2010 ide. win 32, windows 7. mfcUnhandled exception at 0x0f920580 in xlCANcontrol.exe: 0xC0000005: Access violation reading location 0x42ca8dd8.Please kindly help me asap plz&#8230;Thanks &amp; Regards,M.G.Rajendra Prasad<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn<br \/>\narchived-forums-v-forums visual-c-mfc-and-atl<br \/>\nHi I have come across a problem with CDockingManager in VS 2008. When loading a docking state I get an Unhandled Exception in CDockingManager::Serialize. Here is a snippet of the code from afxdockingmanager.cpp: void CDockingManager::Serialize(CArchive&amp; ar) { \u00a0\u00a0\u00a0 &#8230; \u00a0\u00a0\u00a0 if (ar.IsStoring()) \u00a0\u00a0\u00a0 { \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 &#8230; \u00a0\u00a0\u00a0 } \u00a0\u00a0\u00a0 else \u00a0\u00a0\u00a0 { \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 &#8230; &amp;nb<\/li>\n<\/ul>\n<p id=\"rop\"><small>Originally posted 2013-11-27 12:24:10. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>msdn archived-forums-v-forums visual-c-mfc-and-atl Hi,\u00a0I created one MFC project in Visual Studio 2005. I use the following code to get local IP,#include\u00a0 &lt;winsock2.h&gt;#pragma comment(lib, &#8220;WS2_32.lib&#8221;)&#8230;\u00a0\u00a0\u00a0 char name[128];\u00a0 \u00a0\u00a0\u00a0 hostent*\u00a0 pHost;\u00a0 \u00a0\u00a0\u00a0 CString localIP;\u00a0\u00a0\u00a0 gethostname(name, 128);\u00a0\u00a0\u00a0 pHost\u00a0 = gethostbyname(name);\u00a0 \u00a0\u00a0\u00a0 localIP= inet_ntoa(*((in_addr *)pHost-&gt;h_addr));\u00a0But it always return msdn archived-forums-v-forums visual-c-mfc-and-atl Hi,In my MFC application,\u00a0 I had used following [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1648","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1648","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1648"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1648\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1648"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1648"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1648"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}