Visual C++ General ForumGeneral questions about Visual C++ , including the development environment, libraries, setup, debugger, samples, and documentation.© 2009 Microsoft Corporation. Alle Rechte vorbehalten.Sat, 28 Nov 2009 22:17:08 Z805bdc3f-bf13-4784-9e81-548b5030302bhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/d29a5390-d127-45e4-b839-4fb139c59086http://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/d29a5390-d127-45e4-b839-4fb139c59086Vyasahttp://social.msdn.microsoft.com/Profile/de-DE/?user=VyasaWhich is the best tool for designing stylish GUI.?Hello , <div style="font-weight:inherit;font-style:inherit;font-family:inherit;padding:0px;margin:0px;border:0px initial initial"><br/></div> <div style="font-weight:inherit;font-style:inherit;font-family:inherit;padding:0px;margin:0px;border:0px initial initial">I want to know which is the best tool which can be used to make GUI . Currently I'm working on VC++ 6.0 and I can't give a good look(Vista Look) in that. </div> <div style="font-weight:inherit;font-style:inherit;font-family:inherit;padding:0px;margin:0px;border:0px initial initial"><br/></div> <div style="font-weight:inherit;font-style:inherit;font-family:inherit;padding:0px;margin:0px;border:0px initial initial">So can anyone help me which one will be more suitable for GUI .. Java or any other tool and if you can give the reason then it is very helpful.</div> <div style="font-weight:inherit;font-style:inherit;font-family:inherit;padding:0px;margin:0px;border:0px initial initial"><br/></div> <div style="font-weight:inherit;font-style:inherit;font-family:inherit;padding:0px;margin:0px;border:0px initial initial">Thanks</div>Thu, 26 Nov 2009 04:13:09 Z2009-11-28T22:17:08Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/6afc8926-afff-4d84-a920-4d8de414ee28http://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/6afc8926-afff-4d84-a920-4d8de414ee28azertykkhttp://social.msdn.microsoft.com/Profile/de-DE/?user=azertykkCopy a file (With process)Hi,<br/><br/>I want to copy a File From Location <strong>A</strong> to <strong>B<br/><br/></strong>I know i could use one of the following methods<br/><br/>Using Buffers [ifstream.read(),ofstream.write()]<br/>File handles[CreateFile(),ReadFile(),WriteFile() ]<br/>goldenoldie[_tsystem(_T(&quot;copy A B&quot;))]<br/><br/>but i want to receive/calculate the <strong>status</strong><br/>so when copy a large file the user can see its process...<br/><br/>Fri, 27 Nov 2009 11:34:59 Z2009-11-28T22:06:47Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/946e0cf1-a316-478b-96cb-80e2f052f5c4http://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/946e0cf1-a316-478b-96cb-80e2f052f5c4Ayasanohttp://social.msdn.microsoft.com/Profile/de-DE/?user=AyasanoStrange linker error<p>I recieve this error when I try to compile any project in VC++ 2008:<span style="font-size:xx-small"> <p>LINK : fatal error LNK1181: cannot open input file '.\Release\Test.obj'<br/><br/>Same thing but with debug instead of release if it's set to debug configuration.<br/><br/>This is after reinstalling, (I kept getting the error before and couldn't fix it so I removed VC++ with Add/Remove Programs and then resintalled it) nothing changed, I just clicked file &gt; new &gt; project, and then created an empty project called test. The only code in the project is:</p> <pre lang=x-cpp>int main() { return 1; } </pre> <p><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">I had to do a Windows XP repair installation a while back and that seems to be when this started. I was able to compile projects before that. I have SP 3 installed.<br/><br/>I'm able to compile projects in Dev-C++, but need VC++ for DirectX applications.</span></span></p> </span></p>Sat, 28 Nov 2009 19:50:43 Z2009-11-28T19:50:43Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/33438678-af63-4733-b681-0087a955b47ehttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/33438678-af63-4733-b681-0087a955b47eNoobzohttp://social.msdn.microsoft.com/Profile/de-DE/?user=Noobzoare handles global to processes?Hello, i am trying to take a handle (like HBITMAP) and pass it to  another process (while its still valid) to draw that bitmap, its not working though.<br/> <br/> whats going on here, are handles specific to processes? and cannot be passed on to another process? thank you in advance.Sat, 28 Nov 2009 15:51:33 Z2009-11-28T19:25:47Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/ca91cf1a-1e6e-4978-82e8-f93a3f2e63c7http://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/ca91cf1a-1e6e-4978-82e8-f93a3f2e63c7Mahesh Mahindrakarhttp://social.msdn.microsoft.com/Profile/de-DE/?user=Mahesh%20MahindrakarHow to Get the Hbrush from Brush object???Hi<br/> I have a brush of type HBRUSH and i want to use it inside FillPath method, but the problem is that FillPath takes GDI+ Brush object so i cant use it directly<br/> so is there any method available to type cast HBRUSH object to Brush object???<br/> please suggest some way to do this...<br/> <br/> Thanks in advance<br/> Mahesh Mahindrakar...Sat, 28 Nov 2009 05:53:25 Z2009-11-28T19:09:38Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/cef6584d-d05e-4510-a7c2-7ab529c303f9http://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/cef6584d-d05e-4510-a7c2-7ab529c303f9spujiahttp://social.msdn.microsoft.com/Profile/de-DE/?user=spujiaSetting User Registry Keys (HKCU) From a Local System Account ServiceGreetings,<br/> <br/> I have a service running on the local system account, from which I wish to modify the the registry settings for the logged on user in the currently active session.  Note that if a process (service) is running in the local system account, accessing HKCU will redirect to HKCU\.Default, rather than to the hive of a logged on user in the active session.<br/> <br/> From researching the net, I have figured this process to involve impersonating a logged on user from within my service and then accessing the registry.  This works in as much as opening an HKCU key does in fact operate on the user's hive.  HOWEVER, since the user that I am impersonating does not have authority to modify certain registry settings, once the service impersonates them it cannot modify the settings!  AAAACKK!<br/> <br/> So you figure, &quot;Let's just adjust the priveledges of the token&quot;.  Sorry, that won't work either, since AdjustTokenPriveledges will only modify existing privs that the token already has :(<br/> <br/> So the question is, &quot;How do you modify ANY registry settings for the logged on user of the active session from the local system account?&quot;<br/> <br/> So far, this is what I have.<br/> <br/> <ol> <li>Run a service in the local system account</li> <li>From that service, obtain a process handle (via OpenProcess) to a process that is running in the active session of a logged on user (i.e., &quot;explorer.exe&quot;).  This uses the toolhelp API and WTSGetActiveConsoleSessionId(), etc.</li> <li>From the process handle, I obtain it's token</li> <li>Using the token, call &quot;ImpersonateLoggedOnUser&quot;</li> <li>Access the registry (And be denied!)</li> <li>Call &quot;RevertToSelf&quot; to revert the service back to itself</li> </ol> <br/> What I need is a token that impersonates the user but has the priveledges of the local system account :)<br/> Kind regards,<br/> <br/> SteveTue, 24 Nov 2009 22:09:04 Z2009-11-28T19:04:39Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/cd09511c-d67c-46d2-b88d-670a844ef292http://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/cd09511c-d67c-46d2-b88d-670a844ef292WWJDJIMhttp://social.msdn.microsoft.com/Profile/de-DE/?user=WWJDJIMMFC Automation how to implement RemoveDocument OnCloseDocumentI have an MFC MDI Application and I am trying to implement Automation with it. I am trying to create a RemoveDocument() method. How is that done? OnCloseDocument is causing problems. Is there a &quot;standard&quot; way for doing that?<br/> <br/> my sample automation code would look like this:<br/> <br/>         Dim App As New MyApp.Application<br/>         Dim Docs As MyApp.Documents<br/>         Dim Doc As MyApp.Document<br/>         Docs = App.Documents<br/> <br/>         Doc = Docs.OpenDocument(&quot;C:\Test.txt&quot;)<br/>         Doc.Save()<br/>         Docs.CloseDocument(Doc)<br/>         Doc = Nothing<br/>         <br/>         ' Need the ability to reopen the doc<br/>         Doc = Docs.OpenDocument(&quot;C:\Test.txt&quot;)<br/>         Doc.Save()<br/>         Docs.CloseDocument(Doc)<br/>         Doc = Nothing<br/> <br/>         Docs = Nothing<br/>         App = Nothing<br/> <br/> This always results in a crash... I even tried the TIA sample from 1998.. that sample has issues as well..Tue, 24 Nov 2009 22:41:03 Z2009-11-28T18:19:54Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/83966183-f12e-4df1-abe7-cc141d48a4f8http://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/83966183-f12e-4df1-abe7-cc141d48a4f8eldienerhttp://social.msdn.microsoft.com/Profile/de-DE/?user=eldienerFinding the reason for StretchBlt failing In my WM_PAINT handler code in a dialog I call StretchBlt and it fails with a return of FALSE. The source DC is a memory DC and the destination DC is my WM_PAINT handler DC accessed via the BeginPaint function.<br/> <br/> According to the documentation for StretchBlt:<br/> <br/> &quot;StretchBlt If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.<strong> Windows NT/2000/XP:</strong> To get extended error information, call <strong>GetLastError</strong> .&quot;<br/> <br/> So I immediately call GetLastError only to be returned 0.<br/> <br/> I checked the capabilities of both the source and destination device contexts using GetDeviceCaps and RASTERCAPS and had supported for the source and destination devices:<br/> <br/> RC_BITBLT<br/> RC_BITMAP64<br/> RC_DI_BITMAP<br/> RC_DIBTODEV<br/> RC_STRETCHBLT<br/> RC_STRETCHDIB <br/> <br/> while the destination device also had RC_FLOODFILL supported.<br/> <br/> I am baffled on how to determine why the StretchBlt fails as it is keeping a window from displaying data. If I attempt other device context operations on my destination context, such as FillRect, Rectangle, TextOut etc., they all succeed. It is possible the rectangular co-ordinates for my source and destination DCs are &quot;incorrect&quot; in the StretchBlt call, but I would expect a GetLastError code if that were the situation. <br/> <br/> Any ideas or help tracking this GDI failure down would be appreciated.<br/> <br/> I am testing this on Windows Vista 64 Ultimate in a 32-bit application.Fri, 27 Nov 2009 23:49:42 Z2009-11-28T17:44:29Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/61d465d6-1780-402e-b45e-bf9d113d275dhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/61d465d6-1780-402e-b45e-bf9d113d275dkalanesilvahttp://social.msdn.microsoft.com/Profile/de-DE/?user=kalanesilvaNo error in release mode. Why not ?<p>#include &lt;iostream&gt;<br/><br/>using namespace std;<br/><br/>int main()<br/>{<br/>     char *p = &quot;John&quot;;<br/>     *p = 'A';<br/>     cout &lt;&lt; p &lt;&lt; endl;     // Prints &quot;John&quot; in release mode without error<br/>}<br/><br/>As expected, in debug mode there's an error.</p>Sat, 28 Nov 2009 17:06:24 Z2009-11-28T17:47:22Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/9234a3cb-eca5-440c-839e-7d45e54fd38bhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/9234a3cb-eca5-440c-839e-7d45e54fd38bLeyondhttp://social.msdn.microsoft.com/Profile/de-DE/?user=LeyondHow to explain this right shiftHere is the some basic definitions:<br/> 1.<br/> <pre lang=x-cpp>#define IP_ADDRESS_FAMILY(buffer) ((*(PUCHAR)(buffer)) &gt;&gt; 4)</pre> 2.<br/> <pre lang=x-cpp>#define IP_ADDRESS_FAMILY_IP4 4</pre> <pre lang=x-cpp> UCHAR packetBuffer[ETH_MAX_PACKET_SIZE];</pre> <pre lang=x-cpp> UCHAR AddressFamily = 0;</pre> <br/> 3.<br/>   suppose that packetBuffer is used to save some network data with <span style="text-decoration:underline">underline</span> received by our NIC. The data is described as bellow:<br/> <span style="font-size:medium">    000000: <span style="text-decoration:underline"><strong>00 A0 CC 63 08 1B 00 40 : 95 49 03 5F 08 00</strong> 45 00</span> ...c...@.I._..E. <br/>     000010: <span style="text-decoration:underline">00 3C 82 47 00 00 20 01 : 94 C9 C0 A8 01 20 C0 A8</span> .&lt;.G.. ...... .. <br/>     000020: <span style="text-decoration:underline">01 40 08 00 48 5C 01 00 : 04 00 61 62 63 64 65 66</span> .@..H\....abcdef <br/>     000030: <span style="text-decoration:underline">67 68 69 6A 6B 6C 6D 6E : 6F 70 71 72 73 74 75 76</span> ghijklmnopqrstuv <br/>     000040: <span style="text-decoration:underline">77 61 62 63 64 65 66 67 : 68 69</span>                    wabcdefghi...... </span> <br/> 4. Let's consider about the following codes:<br/> <pre lang=x-cpp>AddressFamily = IP_ADDRESS_FAMILY(packetBuffer + bytesParsed); if (IP_ADDRESS_FAMILY_IP4 == AddressFamily){ //do something .... }</pre> in above codes: bytesParesd is the length of network data identified by <strong>bold</strong> type.  I am confused that why the right shift by 4 could get the number 4(UCHAR)?(Notes: network data is hexadecimal) 。 thanks very much<hr class="sig">Work and SmileSat, 28 Nov 2009 13:00:04 Z2009-11-28T17:01:35Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/8a3c92a4-7e8e-47ec-bcb3-f927f225541ehttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/8a3c92a4-7e8e-47ec-bcb3-f927f225541eawlinqhttp://social.msdn.microsoft.com/Profile/de-DE/?user=awlinqHow to move the vertical scrollbar on CEdit control to the bottom to show all the text after SetWindowText?<p>I tried the following code, the scrollbar does move to the bottom, but it does not show all the text, always about 7 lines are out. If I click on the scrollbar, instantly the scrollbar moves up a bit, then I can manually move the bar to the bottom and see all the text.<br/><br/><span style="font-size:x-small">SCROLLINFO info;<br/>CWnd * edit = </span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">this</span></span><span style="font-size:x-small">-&gt;GetDlgItem(IDC_EDITPINGSTATUS);<br/>edit-&gt;GetScrollInfo(SB_VERT, &amp;info);<br/>edit-&gt;SetScrollPos(SB_VERT,info.nMax);<br/><br/>what extra needs to be called to show all the text up to real bottom?<br/><br/>TIA</span></p>Sat, 28 Nov 2009 13:38:02 Z2009-11-28T15:00:05Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/c56ff7f2-e979-482d-be10-01b5d01a2835http://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/c56ff7f2-e979-482d-be10-01b5d01a2835BA08http://social.msdn.microsoft.com/Profile/de-DE/?user=BA08More than 100 errors compiling StdAfx.cpp !!!<p align=left><font face=Arial size=2></font> </p> <p>Here is the error list, I am truly desparated:</p> <p align=left> </p><font size=1> <p>------ Build started: Project: IEHelper, Configuration: Debug Win32 ------</p> <p>Compiling...</p> <p>StdAfx.cpp</p> <p>Note: including file: c:\dokumente und einstellungen\hp_besitzer\eigene dateien\visual studio 2008\projects\bho_re\stdafx.h</p> <p>Note: including file: C:\Programme\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlbase.h</p> <p>Note: including file: C:\Programme\Microsoft Visual Studio 9.0\VC\atlmfc\include\atldef.h</p> <p>Note: including file: C:\Programme\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlrc.h</p> <p>Note: including file: C:\Programme\Microsoft Visual Studio 9.0\VC\include\errno.h</p> <p>Note: including file: C:\Programme\Microsoft Visual Studio 9.0\VC\include\sal.h</p> <p>Note: including file: C:\Programme\Microsoft Visual Studio 9.0\VC\include\malloc.h</p> <p>Note: including file: C:\Programme\Microsoft Visual Studio 9.0\VC\include\crtdefs.h</p> <p>Note: including file: C:\Programme\Microsoft Visual Studio 9.0\VC\include\crtassem.h</p> <p>Note: including file: C:\Programme\Microsoft Visual Studio 9.0\VC\include\vadefs.h</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(117) : error C2337: 'SA_Post' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(117) : error C2065: 'SA_Yes' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Yes'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(117) : error C2337: 'SA_Post' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(117) : error C2065: 'SA_Maybe' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Maybe'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(117) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(117) : error C2065: 'SA_No' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_No'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(117) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(117) : error C2065: 'SA_Yes' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Yes'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(117) : error C2065: 'SA_Read' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Read'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(117) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(117) : error C2065: 'SA_No' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_No'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(117) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(117) : error C2065: 'SA_Yes' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Yes'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(117) : error C2065: 'SA_Read' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Read'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(118) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(118) : error C2065: 'SA_Maybe' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Maybe'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(118) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(118) : error C2065: 'SA_Yes' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Yes'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(118) : error C2337: 'SA_Post' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(118) : error C2065: 'SA_Yes' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Yes'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(119) : error C2337: 'SA_Post' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(119) : error C2065: 'SA_Yes' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Yes'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(119) : error C2337: 'SA_Post' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(119) : error C2065: 'SA_Maybe' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Maybe'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(119) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(119) : error C2065: 'SA_No' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_No'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(119) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(119) : error C2065: 'SA_Yes' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Yes'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(119) : error C2065: 'SA_Read' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Read'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(120) : error C2337: 'SA_Post' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(120) : error C2065: 'SA_Yes' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Yes'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(120) : error C2337: 'SA_Post' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(120) : error C2065: 'SA_Maybe' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Maybe'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(120) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(120) : error C2065: 'SA_Maybe' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Maybe'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(120) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(120) : error C2065: 'SA_Yes' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Yes'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(120) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(120) : error C2065: 'SA_Read' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Read'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(120) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(120) : error C2065: 'SA_No' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_No'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(120) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(120) : error C2065: 'SA_Yes' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Yes'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(120) : error C2065: 'SA_Read' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Read'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(121) : error C2337: 'SA_Post' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(121) : error C2065: 'SA_Yes' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Yes'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(121) : error C2337: 'SA_Post' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(121) : error C2065: 'SA_Maybe' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Maybe'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(121) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(121) : error C2065: 'SA_Maybe' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Maybe'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(121) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(121) : error C2065: 'SA_Yes' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Yes'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(121) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(121) : error C2065: 'SA_Read' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Read'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(121) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(121) : error C2065: 'SA_No' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_No'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(121) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(121) : error C2065: 'SA_Yes' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Yes'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(121) : error C2065: 'SA_Read' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Read'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(121) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(121) : error C2065: 'SA_No' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_No'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(121) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(121) : error C2065: 'SA_Yes' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Yes'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(121) : error C2065: 'SA_Read' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Read'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(122) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(122) : error C2065: 'SA_Maybe' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Maybe'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(122) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(122) : error C2065: 'SA_Yes' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Yes'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(122) : error C2337: 'SA_Post' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(122) : error C2065: 'SA_Yes' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Yes'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(123) : error C2337: 'SA_Post' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(123) : error C2065: 'SA_Yes' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Yes'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(123) : error C2337: 'SA_Post' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(123) : error C2065: 'SA_Maybe' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Maybe'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(123) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(123) : error C2065: 'SA_No' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_No'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(123) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(123) : error C2065: 'SA_Yes' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Yes'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(123) : error C2065: 'SA_Read' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Read'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(123) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(123) : error C2065: 'SA_No' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_No'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(123) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(123) : error C2065: 'SA_Yes' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Yes'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(123) : error C2065: 'SA_Read' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Read'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(124) : error C2337: 'SA_Post' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(124) : error C2065: 'SA_Yes' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Yes'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(124) : error C2337: 'SA_Post' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(124) : error C2065: 'SA_Maybe' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Maybe'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(124) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(124) : error C2065: 'SA_No' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_No'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(124) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(124) : error C2065: 'SA_Yes' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Yes'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(124) : error C2065: 'SA_Read' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Read'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(124) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(124) : error C2065: 'SA_No' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_No'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(124) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(124) : error C2065: 'SA_Yes' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Yes'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(124) : error C2065: 'SA_Read' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_Read'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(124) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(124) : error C2065: 'SA_No' : undeclared identifier</p> <p>missing quotes (&quot;&quot;) around 'SA_No'?</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(124) : error C2337: 'SA_Pre' : attribute not found</p> <p>c:\programme\microsoft visual studio 9.0\vc\include\malloc.h(124) : fatal error C1003: error count exceeds 100; stopping compilation</p> <p>Build log was saved at &quot;file://c:\Dokumente und Einstellungen\HP_Besitzer\Eigene Dateien\Visual Studio 2008\Projects\BHO_re\Debug\BuildLog.htm&quot;</p> <p>IEHelper - 102 error(s), 0 warning(s)</p> <p>========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========</p></font>Tue, 19 Feb 2008 10:44:43 Z2009-11-28T06:51:27Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/4d65e8c7-4557-4773-bc8c-806fb3e7933dhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/4d65e8c7-4557-4773-bc8c-806fb3e7933dstokkiehttp://social.msdn.microsoft.com/Profile/de-DE/?user=stokkiecrash with Variantclear<br/>My program is crashing sometimes (not always) when the VariantClear function is called. VariantClear is trying to clean up a BString at the end of a thread. The Bstring is a message that is used for an input parameter of a com method. The event viewer shows that an access violation occured during the crash.<br/>Anyone already has a clue? I'll put my code snippet here (it's the VariantClear at the end of the thread): <pre lang=x-cpp>unsigned long __stdcall ProcessMSG( void* pArguments ) { BSTR bstrInput; UINT OleBufLen = 0; char szLogBuffer[MAXBUF]; // Used as buffer to format logoutput for MQ2COM // ------------- // COM variables // ------------- VARIANT vArgsTypeText[1]; /* VARIANT, COM Invoke parameter */ VARIANT vResult; /* VARIANT, COM Invoke parameter */ DISPPARAMS dpTypeText; /* VARIANT, COM Invoke parameter */ // ------------------------ // Initialize COM variables // ------------------------ HRESULT hResult = S_OK; /* Result handle */ int iResult = 0; // ------------ // MQ variables // ------------ MQMD mqOutputMessageDescriptor = {MQMD_DEFAULT}; /* Local Output Message Descriptor */ // --------------- // Timer variables // --------------- clock_t tStart; clock_t tFinish; // -------------------------------------------- // Initialize buffers for LOG and DATA messages // -------------------------------------------- char *pszTempBuffer = NULL; char *pszLogBuffer = NULL; unsigned long ulThisThreadID; // -------------------------------- // Initialize variable containing id of this thread for logging to recognise which thread is putting the log message // -------------------------------- ulThisThreadID = GetCurrentThreadId(); // ------------------------------------------------- // Set the CPU clock marking for statistical logging // ------------------------------------------------- tStart = clock(); // -------------------------------- // Initialize COM Invoke parameters // -------------------------------- VariantInit(&amp;vArgsTypeText[1]); VariantInit(&amp;vResult); // ---------------------------------------------------------------------------------------------------- // Put methode name and request buffer (input message) in an BSTR as needed for using the COM Interface // ---------------------------------------------------------------------------------------------------- //ThreadParameters* pThreadParameters; //pThreadParameters = (ThreadParameters*) pArguments; //bstrInput = SysAllocString(CComBSTR((char*)pThreadParameters-&gt;pszSendBuffer)); bstrInput = SysAllocString(CComBSTR((char*)pArguments)); /* This function allocates a new string and copies the passed string into it. */ // ------------------------------------------------------------------- // Input message descriptor is copied to the output message descripton // ------------------------------------------------------------------- /* Memcpy copies characters between buffers; */ /* void *memcpy( void *dest, const void *src, size_t count ) */ memcpy(&amp;mqOutputMessageDescriptor, &amp;g_pMq-&gt;m_mqInputMessageDescriptor, sizeof(g_pMq-&gt;m_mqInputMessageDescriptor)); memcpy(&amp;mqOutputMessageDescriptor.CorrelId, &amp;g_pMq-&gt;m_mqInputMessageDescriptor.CorrelId, sizeof(g_pMq-&gt;m_mqInputMessageDescriptor.CorrelId)); memcpy(&amp;mqOutputMessageDescriptor.MsgId, &amp;g_pMq-&gt;m_mqInputMessageDescriptor.MsgId, sizeof(g_pMq-&gt;m_mqInputMessageDescriptor.MsgId)); mqOutputMessageDescriptor.CodedCharSetId = MQCCSI_Q_MGR; /* PH, 20031215 Codedcharachterset-id of queuemanager to which MQ2COM has been connected. */ // ---------------------------------------------------------- // Leave the critical section so Supervisor loop can continue // ---------------------------------------------------------- ::LeaveCriticalSection(&amp;csSupCriticalSection); /* The LeaveCriticalSection function releases ownership of the specified critical section object. */ // ---------------------- // Copy Buffer to Variant // ---------------------- vArgsTypeText[0].vt = VT_BSTR; /* vArgsTypeText is a variant. A variant always contains 2 fields. vt stands for variable type?*/ vArgsTypeText[0].bstrVal = bstrInput; /* Fill a variant with the request message */ // -------------------- // Set method arguments // -------------------- /* Fill the Dispatch parameter structure. We expect 1 unnamed argument. DISPPARAMS.cArgsargument // Amount of unnamed arguments of the method. DISPPARAMS.cNamedArgs // Amount of named arguments of the method. DISPPARAMS.rgvarg // Array of argument values in reverse order. The parameters of the methode of the COM object. With reverse order we mean that the last element of the array will contain the first parameter of the method. */ dpTypeText.cArgs = 1; /* In this case rgvarg will contain just 1 argument */ dpTypeText.cNamedArgs = 0; dpTypeText.rgvarg = vArgsTypeText; //BS,16022009, CoInitializeEx verplaatst naar de processmessage // ---------------------------------------- // Initialize the COM library MULTITHREADED // ---------------------------------------- hResult = CoInitializeEx(NULL, COINIT_MULTITHREADED); /* Initializes the COM library for use by the calling thread, sets the thread's concurrency model, */ /*and creates a new apartment for the thread if one is required. */ if (FAILED(hResult)) { // Log naar BIMon queue (Event) sprintf(szLogBuffer,&quot;Thread %d: Failed to initialize COM library&quot;,ulThisThreadID); logMessage(1,szLogBuffer); return -1; } // ---------------------------------------------------- // Call method ... of COM object to execute COM methode // ---------------------------------------------------- /* The method IDispatch::Invoke provides access to properties and methods exposed by an object. HRESULT Invoke( DISPID dispIdMember, // Identifies the member. Use GetIDsOfNames or the object’s documentation to obtain the dispatch identifier. REFIID riid, // Reserved for future use; set to IID_NULL. LCID lcid, // The locale context in which to interpret parameters. WORD wFlags, // Flags describing the context (A method or a property) of the Invoke call. DISPATCH_METHOD: The member is invoked as a method. DISPPARAMS FAR *pDispParams, // Pointer to a structure that contains an array of parameters, an array of parameter DISPIDs for named parameters, and counts for the number of elements in the arrays. VARIANT FAR *pVarResult, // Pointer to the location where the result is to be stored, or NULL if the caller expects no result. EXCEPINFO FAR *pExcepInfo, // Pointer to a structure that contains exception information. Can be NULL. unsigned int FAR *puArgErr // The index within rgvarg of the first parameter that has an error. ); */ sprintf(szLogBuffer,&quot;Thread %d: Calling the method of the COM object specified in the ini file&quot;,ulThisThreadID); logMessage(4,szLogBuffer); //16-02-2009, BAST, CoInitializeEx try { hResult = pDispatch-&gt;Invoke(dispid_Class, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &amp;dpTypeText, &amp;vResult, NULL, NULL); } catch( _com_error &amp;e ) { sprintf(szLogBuffer,&quot;Thread %d: Com error opgetreden bij aanroep com method&quot;,ulThisThreadID); logMessage(4,szLogBuffer); // Crack _com_error // _bstr_t bstrSource(e.Source()); // _bstr_t bstrDescription(e.Description()); // // TRACE( &quot;Exception thrown for classes generated by #import&quot; ); // TRACE( &quot;\tCode = %08lx\n&quot;, e.Error()); // TRACE( &quot;\tCode meaning = %s\n&quot;, e.ErrorMessage()); // TRACE( &quot;\tSource = %s\n&quot;, (LPCTSTR) bstrSource); // TRACE( &quot;\tDescription = %s\n&quot;, (LPCTSTR) bstrDescription); } catch (...) { sprintf(szLogBuffer,&quot;Thread %d: Unhandled Exception opgetreden bij aanroep com method&quot;,ulThisThreadID); logMessage(4,szLogBuffer); } sprintf(szLogBuffer,&quot;Thread %d: After calling the method of the COM object specified in the ini file&quot;,ulThisThreadID); logMessage(4, szLogBuffer); if (FAILED(hResult)) { // Log naar BIMon queue (Event) (PH, 12-11-2003, changed, sprintf statement added and second parameter of LogMessage changed from &quot;Method ..&quot; to szLogBuffer. //sprintf(szLogBuffer,&quot;Method Invoke returned an Error&quot;); //logMessage(1,szLogBuffer); switch (hResult) { case S_OK: {sprintf(szLogBuffer,&quot;Thread %d: Method Invoke returned an Error, S_OK&quot;,ulThisThreadID);} break; case DISP_E_BADPARAMCOUNT: {sprintf(szLogBuffer,&quot;Thread %d: Method Invoke returned an Error, DISP_E_BADPARAMCOUNT&quot;,ulThisThreadID);} break; case DISP_E_BADVARTYPE: {sprintf(szLogBuffer,&quot;Thread %d: Method Invoke returned an Error, DISP_E_BADVARTYPE&quot;,ulThisThreadID);} break; case DISP_E_EXCEPTION: {sprintf(szLogBuffer,&quot;Thread %d: Method Invoke returned an Error, DISP_E_EXCEPTION&quot;,ulThisThreadID);} break; case DISP_E_MEMBERNOTFOUND: {sprintf(szLogBuffer,&quot;Thread %d: Method Invoke returned an Error, DISP_E_MEMBERNOTFOUND&quot;,ulThisThreadID);} break; case DISP_E_NONAMEDARGS: {sprintf(szLogBuffer,&quot;Thread %d: Method Invoke returned an Error, DISP_E_NONAMEDARGS&quot;,ulThisThreadID);} break; case DISP_E_OVERFLOW: {sprintf(szLogBuffer,&quot;Thread %d: Method Invoke returned an Error, DISP_E_OVERFLOW&quot;,ulThisThreadID);} break; case DISP_E_PARAMNOTFOUND: {sprintf(szLogBuffer,&quot;Thread %d: Method Invoke returned an Error, DISP_E_PARAMNOTFOUND&quot;,ulThisThreadID);} break; case DISP_E_TYPEMISMATCH: {sprintf(szLogBuffer,&quot;Thread %d: Method Invoke returned an Error, DISP_E_TYPEMISMATCH&quot;,ulThisThreadID);} break; case DISP_E_UNKNOWNINTERFACE: {sprintf(szLogBuffer,&quot;Thread %d: Method Invoke returned an Error, DISP_E_UNKNOWNINTERFACE&quot;,ulThisThreadID);} break; case DISP_E_UNKNOWNLCID: {sprintf(szLogBuffer,&quot;Thread %d: Method Invoke returned an Error, DISP_E_UNKNOWNLCID&quot;,ulThisThreadID);} break; case DISP_E_PARAMNOTOPTIONAL: {sprintf(szLogBuffer,&quot;Thread %d: Method Invoke returned an Error, DISP_E_PARAMNOTOPTIONAL&quot;,ulThisThreadID);} break; default: {sprintf(szLogBuffer,&quot;Thread %d: Method Invoke returned an Error, Unknown error %d&quot;,ulThisThreadID, hResult);} } logMessage(1,szLogBuffer); // --------------------------------------------------------------------------------------- // PH, 2004-03-15, When failed then also ... // Free allocated buffers; IDispatch argument and the Input message and Release COM object // --------------------------------------------------------------------------------------- VariantClear(&amp;vArgsTypeText[1]); ::SysFreeString(bstrInput); return -2; } sprintf(szLogBuffer,&quot;Thread %d: Method of com object did not return an error&quot;,ulThisThreadID); logMessage(4,szLogBuffer); //BS, 16022009: CoUninitialize() weer terug in processmesg // --------------------------------------------------------- // Closes the COM library on the current thread, // unloads all DLLs loaded by the thread, // frees any other resources that the thread maintains, and // forces all RPC connections on the thread to close. // --------------------------------------------------------- CoUninitialize(); // ------------------- // Build reply message // ------------------- if (vResult.vt == VT_BSTR) { sprintf(szLogBuffer,&quot;Thread %d: Begin build reply message&quot;,ulThisThreadID); logMessage(4,szLogBuffer); // ---------------------------------------------------------------------------------- // Calculated length of the string parameter returned by the method of the COM object // ---------------------------------------------------------------------------------- OleBufLen = SysStringLen(vResult.bstrVal); /* A variant, in our case vResult, exists of 2 fields; vt and bstrVal*/ // ----------------------------------------------------- // Alloc the buffer for return message + null terminator // ----------------------------------------------------- pszTempBuffer = new char[OleBufLen + 1]; // --------------------------------------------------------- // Copy the buffer to pszTempBuffer WITH the 0 terminator // You can verify the copy with the \0 terminator. Length is OleBufLen + 1 // A few statements futher the terminator is still placed to be absolutely // certain that it is done correctly // --------------------------------------------------------- sprintf(szLogBuffer,&quot;Thread %d: Begin conversion widechartomultibyte&quot;,ulThisThreadID); logMessage(4,szLogBuffer); iResult = WideCharToMultiByte(CP_ACP,0,vResult.bstrVal,OleBufLen + 1, pszTempBuffer,OleBufLen + 1,NULL,NULL); if ( iResult == 0) { // if the result code is zero '0' an error occurred in the above function call DWORD dw = GetLastError(); sprintf(szLogBuffer,&quot;Thread %d: buffer conversion unicode to multcode failed code = %u Application will exit\n&quot;,ulThisThreadID,dw); logMessage(1,szLogBuffer); exit(-2); } sprintf(szLogBuffer,&quot;Thread %d: widechartomultibyte did not return an error&quot;,ulThisThreadID); logMessage(4,szLogBuffer); // ------------------------- // Place the null terminator // ------------------------- pszTempBuffer[OleBufLen] = '\0'; // ------------------------------------------------------------------------------- // Release memory from output buffer/return buffer of the method of the COM object // ------------------------------------------------------------------------------- VariantClear(&amp;vResult); // ---------------------------- // Write reply message to queue // ---------------------------- // PH, 21-01-2004, added sprintf(szLogBuffer,&quot;Thread %d: put Reply Message to Output Queue&quot;,ulThisThreadID); logMessage(3,szLogBuffer); if(! g_pMq-&gt;PutMessage( pszTempBuffer, g_pMq-&gt;GetOutputQ(), RFH2, mqOutputMessageDescriptor)) { sprintf(szLogBuffer,&quot;Thread %d: put Failed. Application will continue\n&quot;,ulThisThreadID); logMessage(1,szLogBuffer); } // ------------------------- // Free the temporary buffer // ------------------------- if (pszTempBuffer != NULL) { delete [] pszTempBuffer; } } // ------------------------------------------ // Log to BIMon Queue (Snapshot, statistics) // ------------------------------------------ // --------------------------------------------------- // set the &quot;clock end marking&quot; for statistical logging // --------------------------------------------------- tFinish = clock(); g_pMq-&gt;LOGGING.dElapsedMsgTime = (double)(tFinish - tStart) / CLOCKS_PER_SEC; // --------------------------- // Construct message for BIMon // --------------------------- pszLogBuffer = g_pMq-&gt;ConstructStatBuffer(); // -------------------------- // Put message on BIMon queue // -------------------------- // PH, 21-01-2004, added sprintf(szLogBuffer,&quot;Thread %d: snapshot Message to BIMon Queue (statistical queue)&quot;,ulThisThreadID); logMessage(3,szLogBuffer); if(! g_pMq-&gt;PutMessage( pszLogBuffer, g_pMq-&gt;GetStatQ(), DEFAULT, mqOutputMessageDescriptor)) { // Log (PH, 12-11-2003, changed, sprintf statement added and second parameter of LogMessage changed from &quot;Put ..&quot; to szLogBuffer. sprintf(szLogBuffer,&quot;Thread %d: put Failed. Check the ini-Configuration. Application will exit\n&quot;,ulThisThreadID); logMessage(1,szLogBuffer); exit(-2); } sprintf(szLogBuffer,&quot;Thread %d: ProcessMsg: Free allocated memory of Log Buffer&quot;,ulThisThreadID); logMessage(4,szLogBuffer); // ----------------------------------- // Free allocated memory of log buffer // ----------------------------------- if (pszLogBuffer != NULL) { delete [] pszLogBuffer; } sprintf(szLogBuffer,&quot;Thread %d: ProcessMsg: Free allocated buffers of IDispatch argument&quot;,ulThisThreadID); logMessage(4,szLogBuffer); // ---------------------------------------------------------------- // Free allocated buffers; IDispatch argument and the Input message // ---------------------------------------------------------------- VariantClear(&amp;vArgsTypeText[1]); sprintf(szLogBuffer,&quot;Thread %d: ProcessMsg: Free allocated buffers of the Input message&quot;,ulThisThreadID); logMessage(4,szLogBuffer); ::SysFreeString(bstrInput); // --------------------- // Terminate this thread // --------------------- sprintf(szLogBuffer,&quot;Thread %d: ProcessMsg: Leave ProcessMsg function&quot;,ulThisThreadID); logMessage(4,szLogBuffer); return 0; }</pre>Fri, 20 Nov 2009 15:34:42 Z2009-11-28T06:23:24Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/bd446d59-1929-4f5d-82fb-1fc63173fe69http://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/bd446d59-1929-4f5d-82fb-1fc63173fe69eswar pothulahttp://social.msdn.microsoft.com/Profile/de-DE/?user=eswar%20pothulais it possible to convert speech to text.hi every body,<br/> <br/> in my application convert voice to text is required,<br/> <br/> but i am getting to text to speech tools only and these tools working properly.<br/> <br/> but my work is if any person record voice is  &quot;hi how are you&quot;  then it is automatically displayed in text box(or)edit box  &quot;hi how are you&quot;<br/> <br/> and one more thing is my application developed in vc++6.0,<br/> <br/> please help me ,<br/> thanks in advance............<br/>Fri, 27 Nov 2009 10:26:20 Z2009-11-28T05:46:33Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/355b93c4-f093-47f1-ad67-9635c6dfb650http://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/355b93c4-f093-47f1-ad67-9635c6dfb650Firebug99http://social.msdn.microsoft.com/Profile/de-DE/?user=Firebug99WIN32_LEAN_AND_MEANwhat is this and how can i get rid of it. it is in the file stdafx.h when I start a win32 project.<hr class="sig">A young neophyte programmerTue, 24 Nov 2009 02:33:55 Z2009-11-28T03:04:06Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/e7e8e2be-8248-40ee-a465-18dbbc8e6729http://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/e7e8e2be-8248-40ee-a465-18dbbc8e6729p3t3r5229http://social.msdn.microsoft.com/Profile/de-DE/?user=p3t3r5229Microsoft Visual C++ 2008 Redistributable Package (x86)<p align=left><font face="Times New Roman" size=2>i would like to ask for help.. </font></p> <p align=left><font face="Times New Roman" size=2>i got Microsoft Visual C++ 2005 Redistributable Package (x86) installed in my laptop, but i would like to </font></p> <p align=left><font face="Times New Roman" size=2>upgrade it to Microsoft Visual C++ 2008 Redistributable Package (x86).</font></p> <p align=left> </p> <p align=left>so my question is, do i have to uninstall Microsoft Visual C++ 2005 Redistributable Package (x86), before install Microsoft Visual C++ 2008 Redistributable Package (x86)?</p> <p align=left> </p> <p align=left>please help me and email me at <a title="mailto:p3t3r5229@yahoo.co.uk" href="mailto:p3t3r5229@yahoo.co.uk">p3t3r5229@yahoo.co.uk</a></p> <p align=left> </p> <p align=left>thank you for your kind help.</p> <p align=left><font face="Times New Roman"></font> </p> <p align=left><font face="Times New Roman"></font> </p>Wed, 26 Mar 2008 11:17:38 Z2009-11-28T02:04:02Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/0ab3860e-da8d-4a85-b768-f32dbcc6ea8fhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/0ab3860e-da8d-4a85-b768-f32dbcc6ea8fMichał Januszczykhttp://social.msdn.microsoft.com/Profile/de-DE/?user=Micha%u0142%20JanuszczykOpen-With menu items for given file extensionHi, <br/>I need the list of executables' paths registered to appear in open-with context menu for particular extensions.<br/><br/>I suppose that there is no managed API for that, so I might see a native approach, and convert that to managed version with pInvoke if possible...<br/><br/>//pseudo code: <br/>String[] GetPathsOfRegisteredPrograms(String extension)<br/>{<br/>   // how to get the list... ? <br/>}<br/><br/>example usage: <br/>String[] executablePaths = GetPathsOfRegisteredPrograms(&quot;.jpg&quot;);<br/><br/>//should return list: <br/>c:\windows\PhotoAndFaxViewer.exe<br/>c:\windows\Notepad.exe<br/>c:\Program Files\Photoshop\Ps.exe<br/>..and so on...<br/><br/>Thanks, <br/>Michal <br/>Sat, 28 Nov 2009 00:18:57 Z2009-11-28T01:56:24Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/d7fa3f2c-12bf-4180-8021-f3dbb4f211fahttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/d7fa3f2c-12bf-4180-8021-f3dbb4f211faNarnianhttp://social.msdn.microsoft.com/Profile/de-DE/?user=NarnianHmmm, started VS Starting, what are we doing wrong?My coworker and I are building a windows service that scans an FTP folder for specific files, and then loads the data into SQL server when new files appear.  The service starts up and runs correctly (in the sense that it does what it supposed to do) but when you look in the control panel and open up &quot;services&quot; it says &quot;starting . . .&quot; and never actually says it's started.<br/><br/>Anyone have any suggestions?  Is there some simple thing we're supposed to do to let the operating system know that the service has successfully started?Fri, 27 Nov 2009 22:49:51 Z2009-11-27T22:59:32Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/e885a9c5-c083-43e1-82e9-d2b8c5b67600http://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/e885a9c5-c083-43e1-82e9-d2b8c5b67600_Well_http://social.msdn.microsoft.com/Profile/de-DE/?user=_Well_CMFCToolBar. How to add control?I have trouble without ends with the new CMFCToolBar. I try to add some controls to my toolbar and unsuccessfully! I even tried to adapt the ToolBarTimeDatePicker example, it doesn't really work actually!<br/> MY CASE: I have no Menu, only ToolBar, and I do not need Customize Option for ToolBar. So I excluded it from the project. So what I need is a simple toolbar with edit in it. To make it as it seems I need to add new Button and some code in OnToolbarReset(WPARAM wp,LPARAM) function. Which I did:<br/>           <br/> <pre lang=x-cpp> CMFCToolBarEditBoxButton myEdtButton (ID_TEST, GetCmdMgr ()-&gt;GetCmdImage (ID_TEST,FALSE),WS_TABSTOP|ES_LEFT|ES_UPPERCASE|WS_BORDER); m_wndToolBar.ReplaceButton (ID_TEST, myEdtButton ); </pre> Please help me. What can I do, just to see the EDIT CONTROL? I am desparately struggling with it without success.<br/> <br/> Thanks in advance.Fri, 27 Nov 2009 16:04:31 Z2009-11-27T22:39:22Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/45b5b951-f5b6-49df-9f23-b2e2960d0a78http://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/45b5b951-f5b6-49df-9f23-b2e2960d0a78Andrey Nautilushttp://social.msdn.microsoft.com/Profile/de-DE/?user=Andrey%20NautilusAbstract class instantiation<p><span style="font-size:x-small">In VS2008 I faced with very interesting problem.<br/></span><span style="font-size:x-small"><span style="font-size:x-small">Here is the source code:</span><br/></span><span style="font-size:x-small"><br/>struct IMyClass<br/>{<br/>public:<br/>   int field;<br/>   IMyClass(int a): field(a) {}<br/>   virtual int foo() const = 0;<br/>};</span></p> <p><span style="font-size:x-small">int func_foo(const IMyClass &amp;obj)<br/>{<br/>   return obj.foo();<br/>}</span></p> <p><span style="font-size:x-small">int main(void)<br/>{<br/>   func_foo(1);<br/>   return 0;<br/>}<br/><br/>when function func_foo is called in main, number 1 is implicitly casted to IMyClass by creating an object of the IMyClass type. In fact, in func_foo I have an ordinary object of an abstract class :) And operator sizeof(obj) returns 4, but sizeof(IMyClass) returns 8.</span> <br/><span style="font-size:x-small"><br/>I compiled this code with warning level 4, and there were no messages.<br/></span><span style="font-size:x-small;font-family:"><br/>Of course, in runtime this program fails at line obj.foo() with exception R6025 &quot;pure virtual function call&quot;, The most amazing is that an object of an abstract class was created. :)</span></p>Fri, 27 Nov 2009 07:02:27 Z2009-11-28T08:41:55Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/54765215-d363-4279-8062-7034aeabbd48http://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/54765215-d363-4279-8062-7034aeabbd48JGMillerhttp://social.msdn.microsoft.com/Profile/de-DE/?user=JGMillerWinSxS mfc80.dll won't load WinSxS msvcr80.dll<p>I am trying to fix a client's problem with one of my company's products.  One of the dll's won't register there, but works here (isn't always the case).  I had them do a dependency walker check and it states that msvcr80.dll cannot be found under the WinSxS mfc80.dll branch.  However the very next branch has the WinSxS msvcr80.dll loading fine.</p> <p>winsxs\*4053*\mfc80.dll<br/>     - msvcr80.dll (dependency not found)<br/>     - (other dlls)<br/>winsxs\*4053*\msvcr80.dll  (this branch has no errors)</p> <p>I don't understand why it produces a dependency not found when in fact it has it in another branch.</p> <p>Any suggestions?</p> <p> </p><hr class="sig">John MillerTue, 24 Nov 2009 12:49:35 Z2009-11-27T20:46:38Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/c56223aa-e2ae-4aad-87bf-9e6787e88dbahttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/c56223aa-e2ae-4aad-87bf-9e6787e88dbaVitalikVhttp://social.msdn.microsoft.com/Profile/de-DE/?user=VitalikVIs it possible to pull through _ConnectionPtr clean hands?<span class="short_text"><span title="OLE DB Services=-1">OLE DB Services =- 1<br/> </span> <span title="Возможно ли через &#9;_ConnectionPtr очистить пулл руками?">Is it possible to pull through _ConnectionPtr clean hands?</span> </span>Thu, 26 Nov 2009 14:58:39 Z2009-11-27T17:10:20Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/24a79f4f-83ce-449b-be5f-24d437c6a141http://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/24a79f4f-83ce-449b-be5f-24d437c6a141jukkasuhttp://social.msdn.microsoft.com/Profile/de-DE/?user=jukkasuusing dll made with visual studio 6.0 in visual studio 4.2-projectIs it possible to use a dll that is made using Visual C++ 6.0 in Visual C++ 4.2 ?<br/> <br/> I'm trying to use a dll which exports one function, int checkp(void*).<br/> <br/> If I use .def file and define the function as:<br/>     extern &quot;C&quot; int checkp(void* data)<br/> in 6.0, LoadLibrary in 4.2-code loads the dll but I can't get function's address with GetProcAddress. <br/> <br/> If I export function using __declspec(dllexport) and link to dll normally in 4.2, linker warns about different subsystem (LNK4064) and doesn't find the function.<br/> <br/> - jukka<br/>Thu, 26 Nov 2009 19:00:28 Z2009-11-27T16:58:31Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/9efb2196-1474-4a3b-a637-2dfda39f8997http://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/9efb2196-1474-4a3b-a637-2dfda39f8997kalamramhttp://social.msdn.microsoft.com/Profile/de-DE/?user=kalamramchild process termination info without wait timehi,<br/> <br/> I am creating one application that receive command string and start the different application using createProcess().<br/> <br/> So, when the child process terminates, i need to intimate parent process about it.<br/> <br/> Actually,. i used WaitForSingleObject().<br/> <br/> but, one problem is the parent application strucked(paused) untill child application terminated.<br/> <br/> In my program, I continuously receive command string and start different application.<br/> <br/> So, I can't wait each child process to terminate.<br/> <br/> I got one suggestion to use thread for waiting child process termination.<br/> <br/> But, that also problem, because i need to create thread for each child process and declare child process information structure globally for each createProcess().<br/> <br/> my code is,<br/> [code]<br/> <br/> // while loop to check continuous socket connection<br/>     while (1)<br/>     {<br/>         int str1,str2;<br/>         char *cmdName = NULL;<br/>         printf(&quot;while begin \n&quot;);<br/>         aSock = INVALID_SOCKET;<br/>         asSize = sizeof(serverSock);<br/>         printf(&quot;a1\n&quot;);<br/>         while(aSock == INVALID_SOCKET)<br/>         {    <br/>             printf(&quot;while aSock= %d\n&quot;,aSock);<br/>             aSock = accept(sock, (struct sockaddr *)&amp;serverSock,(int *) &amp;asSize);    <br/>             printf(&quot; aSock = %d\n&quot;,aSock);<br/>         }<br/>         printf(&quot;aSock= %d\n&quot;,aSock);<br/>         printf(&quot;a3\n&quot;);<br/> #if 0<br/>         while (aSock == SOCKET_ERROR)<br/>         {<br/>             //aSock = accept(sock,(struct sockaddr *)&amp;serverSock, &amp;asSize);<br/>                 aSock = accept(sock, NULL, NULL);<br/>         }<br/> #endif<br/>         if (aSock == SOCKET_ERROR)<br/>         {<br/>             printf(&quot;a4\n&quot;);<br/>             printf(&quot;sockserver: accept() error!. \n&quot;);<br/>         }<br/>      // When SAS server connection accepted, change the temp socket (aSock) connection to original one (sock)<br/>     printf(&quot;a5\n&quot;);<br/>     printf(&quot;sockserver: SAS Connected!\n&quot;);<br/>     printf(&quot;test 0\n&quot;);<br/>     //sock = aSock; <br/>     printf(&quot;test 1\n&quot;);<br/> //**************************************<br/>     memset(dataBuffer, '\0', sizeof(dataBuffer));<br/>     byteRecv = recv(aSock,dataBuffer,sizeof(dataBuffer),0);<br/>     printf(&quot; String Received ============= %s \n&quot;, dataBuffer);<br/>     str1 = strlen(dataBuffer);<br/>     printf(&quot;String length ============= %d \n&quot;, str1);<br/>     str1 = strlen(dataBuffer);<br/>     dataBuffer[byteRecv] = '\0';<br/> <br/>     printf(&quot; String Received after   ****============= %s \n&quot;, dataBuffer);<br/>     str2 = strlen(dataBuffer);<br/>     //printf(&quot;String length  after ============= %d \n&quot;, str2);<br/>     if(dataBuffer == NULL || strlen(dataBuffer) == 0 )<br/>     {<br/>         printf(&quot;String is null \n&quot;);<br/>     }<br/>     <br/>     printf(&quot;test 1b\n&quot;);<br/>     if(byteRecv == SOCKET_ERROR)<br/>     {<br/>         printf(&quot;test 1c\n&quot;);<br/>         printf(&quot;Data sent by SAS server is not received!. \n&quot;);<br/> <br/>     }<br/>     else<br/>     {<br/>        printf(&quot;test 1d\n&quot;);<br/>        printf(&quot;sockserver: Received data is: %s \n&quot;, dataBuffer);<br/>        printf(&quot;sockserver: Bytes received: %ld.\n&quot;, byteRecv);<br/>     //   closesocket(aSock);<br/> <br/>     }<br/>     cmdName = strtok_s( dataBuffer, seps, &amp;next_token);<br/>     printf(&quot; cmdName : %s \n&quot;, cmdName);<br/> <br/>     if (strcmp(cmdName,&quot;cmdStartApplication&quot;) == 0)<br/>     {<br/>         printf(&quot;test 1 \n&quot;);<br/>             int i = 0;<br/> //            int k;            <br/>             int eindex;            <br/>             char *event_index = NULL; // ATSC event index<br/>             char *arg = NULL;<br/> //            wchar_t *myargv[APPL_MAX_ARGS];<br/>             //wchar_t *myargv;<br/>             wchar_t *exeName;<br/>             //char *exeName;<br/>             DWORD exitCode;<br/>             int pExitValue;<br/>             int waitid;<br/>         <br/>             STARTUPINFO si;<br/>             PROCESS_INFORMATION pi;<br/>             int pid,cpid;<br/>             //wchar_t *exeName;                  <br/>             ZeroMemory( &amp;si, sizeof(si) );  // windows equivalent to memset<br/>             si.cb = sizeof(si);<br/>             ZeroMemory( &amp;pi, sizeof(pi) );<br/>             event_index = strtok_s (NULL,seps,&amp;next_token); <br/>             printf(&quot;test 3 \n&quot;);<br/>             //exeName = strtok_s (NULL,seps,&amp;next_token); <br/>             //exeName = _tcsdup(TEXT(&quot;\&quot;E:\\dLs\\Java\\jre-6u16-windows-i586-s\&quot;&quot;));<br/>             //exeName = _tcsdup(TEXT(&quot;\&quot;E:\\dLs\\Java\\jre-6u16-windows-i586-s\&quot;&quot;));<br/>             exeName = _tcsdup(TEXT(&quot;\&quot;c:\\WINDOWS\\notepad.exe\&quot;&quot;));<br/>             //exeName = &quot;c:\\WINDOWS\\notepad.exe&quot;;<br/>             //exeName = _tcsdup(TEXT(&quot;\&quot;D:\\mypgms\\Daemon_pgms\\sockclient\\Debug\\sockclient\&quot;&quot;));<br/>             //exeName =(wchar_t *) &quot;notepad&quot;;<br/>             printf(&quot;test 4 \n&quot;);<br/>             /*for(k=0; k&lt;APPL_MAX_ARGS; k++)<br/>             {<br/>                 myargv[k] = (wchar_t *)NULL;<br/>             } */<br/> <br/>              // Start the child process. <br/>             //*********************************************************************************<br/>     aThread = CreateThread( <br/>                      NULL,       // default security attributes<br/>                      0,          // default stack size<br/>                      (LPTHREAD_START_ROUTINE) waitpid, <br/>                      NULL,       // no thread function arguments<br/>                      0,          // default creation flags<br/>                      &amp;ThreadID); // receive thread identifier<br/> <br/>         if( aThread == NULL )<br/>         {<br/>             printf(&quot;CreateThread error: %d\n&quot;, GetLastError());<br/>             return;<br/>         }<br/> //********************************************************************************<br/>             if(( cpid=CreateProcess( NULL,   // No module name (use command line)<br/>                 (LPWSTR)exeName,        // Command line<br/>                 NULL,           // Process handle not inheritable<br/>                 NULL,           // Thread handle not inheritable<br/>                 FALSE,          // Set handle inheritance to FALSE<br/>                 0,              // No creation flags<br/>                 NULL,           // Use parent's environment block<br/>                 NULL,           // Use parent's starting directory <br/>                 &amp;si,            // Pointer to STARTUPINFO structure<br/>                 &amp;pi )           // Pointer to PROCESS_INFORMATION structure<br/>             ) != NULL)<br/>             {<br/>                 pid = pi.dwProcessId;                <br/>                 printf( &quot;VMService: CreateProcess Successed for cmdStartApllication, CPID is: %d.\n&quot;, cpid );<br/>                 printf(&quot;System child process ID: %d \n&quot;, pid);<br/>                 eindex = atoi(event_index);<br/>                 addNode(pid, eindex, aSock);    <br/>                 printf(&quot;*********** After add NODE ******************\n&quot;);<br/>                 //closesocket(aSock);    /* No need to close the socket. */<br/>                 //return 0;<br/>             }<br/>             else<br/>             {<br/>                  printf( &quot;VMService: CreateProcess failed (%d).\n&quot;, GetLastError() );<br/>                 //return -1;<br/>             }<br/> <br/>             /* Wait until child process exits. */<br/>             printf(&quot; WaitForSingleObject() in cmdStartAppl called ... \n&quot;);<br/>              waitid = WaitForSingleObject( pi.hProcess, INFINITE );<br/>              sigchld_handler (pid);<br/>              switch (waitid) {<br/>                         case WAIT_FAILED:<br/>                             sigchld_handler (pid);<br/>                             printf(&quot;WAIT_FAILED&quot;);<br/>                             break;<br/>                         case WAIT_ABANDONED:<br/>                             sigchld_handler (pid);<br/>                             printf(&quot;WAIT_ABANDONED&quot;);<br/>                             break;<br/>                         case WAIT_OBJECT_0:<br/>                             printf(&quot;WAIT_OBJECT_0&quot;);<br/>                             break;<br/>                         case WAIT_TIMEOUT:<br/>                             sigchld_handler (pid);<br/>                             printf(&quot;WAIT_TIMEOUT&quot;);<br/>                             break;<br/>                         default:<br/>                             printf(&quot;...&quot;);<br/>                             break;<br/>                         }<br/> <br/>                 pExitValue = GetExitCodeProcess(pi.hProcess, &amp;exitCode);<br/>                 if (pExitValue != 0)<br/>                 {<br/>                     /*switch(exitCode)<br/>                     {<br/>                     case STILL_ACTIVE: printf(&quot;Process is still active\n&quot;);<br/>                     break;<br/>                     default: printf(&quot;Exit code = %d\n&quot;, exitCode);<br/>                     break;<br/>                     } */<br/> <br/>                     if (exitCode == STILL_ACTIVE)<br/>                     {<br/>                         printf(&quot;startCmdApplication is still running \n&quot;);<br/>                     }<br/>                     else<br/>                     {<br/>                         printf(&quot;startCmdApplication is exits \n&quot;);<br/>                     }<br/>                 }<br/>                 else{<br/>                     printf(&quot;GetExitCodeProcess() failed with erroe code: %d \n&quot;, GetLastError() );<br/>                 }<br/> <br/>             /* Close process and thread handles.  */<br/>             CloseHandle( pi.hProcess );<br/>             CloseHandle( pi.hThread );<br/>             continue;<br/>     }<br/>     else<br/>     {<br/>         printf(&quot;cmdStartApllication failed. \n&quot;);<br/>         //continue;<br/>     }<br/>     <br/> <br/>     //cmdStartServer<br/>     if (strcmp(cmdName,&quot;cmdStartServer&quot;) == 0)<br/>     {<br/>         printf(&quot;test 21 \n&quot;);<br/>             int i = 0;<br/> //            int k;            <br/>             int eindex;            <br/>             char *event_index = NULL; // ATSC event index<br/>             char *arg = NULL;<br/>             //wchar_t *myargv[APPL_MAX_ARGS];<br/>             //wchar_t *myargv;<br/>             wchar_t *exeName;<br/>             //char *exeName;<br/>         <br/>             STARTUPINFO si;<br/>             PROCESS_INFORMATION pi;<br/>             int pid,cpid;<br/>             //wchar_t *exeName;                  <br/>             ZeroMemory( &amp;si, sizeof(si) );  // windows equivalent to memset<br/>             si.cb = sizeof(si);<br/>             ZeroMemory( &amp;pi, sizeof(pi) );<br/>             event_index = strtok_s (NULL,seps,&amp;next_token); <br/>             printf(&quot;test 3 \n&quot;);<br/>     //        exeName =strtok_s (NULL,seps,&amp;next_token); <br/>             //exeName = _tcsdup(TEXT(&quot;\&quot;E:\\dLs\\Java\\jre-6u16-windows-i586-s\&quot;&quot;));<br/>             //exeName = _tcsdup(TEXT(&quot;\&quot;E:\\dLs\\Java\\jre-6u16-windows-i586-s\&quot;&quot;));<br/>             exeName = _tcsdup(TEXT(&quot;\&quot;c:\\WINDOWS\\notepad\&quot;&quot;));<br/>             //exeName = _tcsdup(TEXT(&quot;\&quot;D:\\mypgms\\Daemon_pgms\\sockclient\\Debug\\sockclient\&quot;&quot;));<br/>         //    exeName =(wchar_t *) &quot;notepad&quot;;<br/>                 printf(&quot;test 4 \n&quot;);<br/>             /*for(k=0; k&lt;APPL_MAX_ARGS; k++)<br/>             {<br/>                 myargv[k] = (wchar_t *)NULL;<br/>             } */<br/> <br/>              // Start the child process. <br/>             if(( cpid=CreateProcess( NULL,   // No module name (use command line)<br/>                 (LPWSTR)exeName,        // Command line<br/>                 NULL,           // Process handle not inheritable<br/>                 NULL,           // Thread handle not inheritable<br/>                 FALSE,          // Set handle inheritance to FALSE<br/>                 0,              // No creation flags<br/>                 NULL,           // Use parent's environment block<br/>                 NULL,           // Use parent's starting directory <br/>                 &amp;si,            // Pointer to STARTUPINFO structure<br/>                 &amp;pi )           // Pointer to PROCESS_INFORMATION structure<br/>             ) != NULL)<br/>             {<br/>                 <br/>                 pid = pi.dwProcessId;<br/>                 printf( &quot;VMService: CreateProcess Successed for cmdStartServer, CPID is: %d.\n&quot;, cpid );<br/>                 printf(&quot;System process ID: %d \n&quot;, pid);<br/>                 eindex = atoi(event_index);<br/>                 addNode(pid, eindex, aSock);    <br/>                 //closesocket(aSock);    /* No need to close the socket. */<br/>                 //return 0;<br/>             }<br/>             else<br/>             {<br/>                  printf( &quot;VMService: CreateProcess failed (%d).\n&quot;, GetLastError() );<br/>                 //return -1;<br/>             }<br/> <br/>             /* Wait until child process exits. */<br/>             // WaitForSingleObject( pi.hProcess, INFINITE );<br/> <br/>             /* Close process and thread handles.  */<br/>             CloseHandle( pi.hProcess );<br/>             CloseHandle( pi.hThread );<br/>              continue;<br/>     }<br/>     else<br/>     {<br/>         printf(&quot;cmdStartApllication failed. \n&quot;);<br/>         //continue;<br/>     }<br/> <br/> continue;<br/>     <br/>     printf(&quot;while end \n&quot;);<br/>     }  // end of while()<br/> <br/> [\code]<br/> <br/> <br/> so any suggestion on getting child process termination indication without wait time ( that hangs the parent process.<br/> <br/> <br/> thank you.<br/> <br/> <br/> <br/> <br/> <br/> <br/>Sun, 15 Nov 2009 11:57:40 Z2009-11-27T15:29:27Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/b09a27b7-7fa2-4b1b-ba89-c82af42d64e0http://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/b09a27b7-7fa2-4b1b-ba89-c82af42d64e0kapil rajakhttp://social.msdn.microsoft.com/Profile/de-DE/?user=kapil%20rajakbuild failed<p>I am building my project at the end of build process, it shows:<br/><br/>========== Build: 122 succeeded, 1 failed, 0 up-to-date, 14 skipped ==========<br/><br/>there are  3 errors showing on the output of Debug Panel.<br/><br/>This three erors I can identify.<br/><br/>55&gt;Error: C:\Documents and Settings\guest1\Desktop\svn ref\libs\sounds\freeswitch-sounds-en-us-callie-8000-.tar.gz is not supported archive<br/>58&gt;Project : error PRJ0019: A tool returned an error code from &quot;Performing Post-Build Event...&quot;<br/>58&gt;8khz - 1 error(s), 0 warning(s)</p>Fri, 27 Nov 2009 11:13:17 Z2009-11-27T15:19:24Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/9d925573-6a6a-48c7-9ea2-2d8a639231echttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/9d925573-6a6a-48c7-9ea2-2d8a639231eccpzaohttp://social.msdn.microsoft.com/Profile/de-DE/?user=cpzaoSerial Port, events and timeoutsHello,<br/> <br/> I have been developping an application which will connect to a device using RS232.<br/> <br/> When the device sends a request, my application must respond (client/server).<br/> <br/> Initially, I had a thread which was always waiting for characters to appear. If they did not appear within the timeout, I flagged an error variable. As the client sends messages periodically, I could identify when the connection was lost. This was possible, because I was always waiting for characters to arrive.<br/> <br/> After reading some stuff and talking with some colleagues, I was advised to drop the thread and use events instead. When a message arrives, the event is raised and executes eveything I need, which is pretty nice, leaving all the threading stuff behind. But now, there's one thing I cannot do, which is to identify when the connection is lost.<br/> <br/> As I do not have a thread waiting for characters anymore, I cannot detect a timeout situation and I think I would need to create a thread just to do identify an excessive amount of time between ReadEvents detected. Am I right?<br/> <br/> Is there any other way how to do this?<br/> <br/> Best regards<br/> <br/> CarlosFri, 27 Nov 2009 13:14:47 Z2009-11-27T15:07:50Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/043fbd38-30fc-4bd5-99e3-592862430515http://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/043fbd38-30fc-4bd5-99e3-592862430515MichaelWojcikhttp://social.msdn.microsoft.com/Profile/de-DE/?user=MichaelWojcikOnInitialUpdate IssueHello<br/> <br/>   I been having a problem that is simple, but is a blocking issue.  When I make a MFC/C++ application, OnInitialUpdate calls for a while but randomly stops working after a few minutes to hours of development.<br/> <br/> The entry function where the problem occurs is in the *app class<br/> <br/> <span style="font-size:x-small"><br/> <span style="font-size:x-small"><span style="font-size:x-small"> </span> </span> <p><span style="color:#008000;font-size:x-small"><span style="color:#008000;font-size:x-small"> <pre>// Dispatch commands specified on the command line. Will return FALSE if<br/> // app was launched with /RegServer, /Register, /Unregserver or /Unregister.<br/> if (!ProcessShellCommand(cmdInfo))<br/> return FALSE;</pre> <span style="font-size:x-small"><span style="color:#008000;font-size:x-small"><span style="color:#008000;font-size:x-small"> </span> </span> </span> </span> </span></p> </span> <span style="font-size:x-small"> <pre>This began happening ever since I've been using VS2008. At first I had the trial version but I uninstalled it and installed my full edition but unfortunatly, the issue still persists. I am running this on an XP. I have tried this on my Windows7 Beta and it seems to behave properly. But are there any users who can make a MFC application with VS2008 on XP and not experience this issue? Any advice and ideas are more than welcomed as well. Help is Greatly appreciated. Thanks</pre> <br/> </span>Tue, 24 Nov 2009 10:29:11 Z2009-11-27T15:07:30Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/26738f2a-5283-448f-a473-0492c6b22df6http://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/26738f2a-5283-448f-a473-0492c6b22df6Rahul Dhamechahttp://social.msdn.microsoft.com/Profile/de-DE/?user=Rahul%20DhamechaDebug Assertion Failure in CTreeCtrlhi,<br/> I have a dialog(variable name is b1) in which I have created a TreeCtrl(m_bandtree) using the toolbox. I have also created a variable for the same using the class wizard. On a particular condition in my Dialog Based applicatoin this Dialog(b1) is opened. Now, I want to add 4 Tree Items into its TreeCtrl structure. I am unable to do the same. Please help me out.<br/> This is the code snippet.<br/> <br/> if(condition)<br/>   MultiBank *b1=new MultiBank;<br/> for(int i=0;i&lt;4;i++)<br/> <br/>         {<br/>            // AfxMessageBox(&quot;Hi&quot;);<br/>             band_tree_name=&quot;Band&quot;+i;<br/>             tvInsert.hParent=NULL;<br/>             tvInsert.hInsertAfter=TVI_LAST;<br/>             tvInsert.item.hItem=NULL;<br/>             tvInsert.item.iImage=0;<br/>             tvInsert.item.pszText=const_cast&lt;char*&gt;(band_tree_name.operator LPCTSTR());<br/>             b1-&gt;m_bandtree.InsertItem(&amp;tvInsert);//line where I am getting Debug Assertion Failed Error<br/> <br/>         } <br/> <br/> I have also referred to &quot;http://social.msdn.microsoft.com/forums/en-US/vcgeneral/thread/fdf5b6ba-5d0d-4cb3-a924-5cdc917ee895/&quot; but it has been of any help to me.<br/> <br/> Pls AdviceFri, 27 Nov 2009 12:10:12 Z2009-11-27T14:41:42Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/73f1613b-fbff-48ea-a4d5-8423535d4fd8http://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/73f1613b-fbff-48ea-a4d5-8423535d4fd8pacheslehttp://social.msdn.microsoft.com/Profile/de-DE/?user=pachesleurldownloadtofile hangs in Vista but not in XP when internet connection is downHi,<br/>I'm using URLDownloadToFile to download an upgrade for an application inside that application.<br/>I'm using IBindStatusCallback to get status updates with the OnProgress method.<br/>When the internet connection is lost, I warn the user and tell her to try it later.<br/>However, this works in XP but in Vista, it does not.<br/>In Vista, if you remove the ethernet cable, URLDownloadToFile seems to hang, does not return, and OnProgress is not called.<br/>Sometimes if you reconnect the cable, it can take up the download where it was left off, although this does not happen always.<br/>It seems in Windows 7, it is working properly. After you remove the cable, the URLDownloadToFile seems to hang,  but when you<br/>put it back on, OnProgress knows that binding has stopped. Is there a bug with URLDownloadToFile in Vista?<br/>This is also reported here:<br/><a href="http://msdn.microsoft.com/en-us/library/ms775123(VS.85).aspx">http://msdn.microsoft.com/en-us/library/ms775123(VS.85).aspx</a><br/>(a comment by a user: <div>Seems to hang when used under Vista and network connection is lost</div> <span><span style="color:#c0c0c0">Added by:</span></span><span><span style="color:#2178e0">BarnyJuno)<br/>Thanks and regards,<br/><br/>pau</span></span>Fri, 27 Nov 2009 13:34:42 Z2009-11-27T13:34:43Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/6feb43a8-0e6e-4303-bc97-c15e4e4e6819http://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/6feb43a8-0e6e-4303-bc97-c15e4e4e6819ucancode softwarehttp://social.msdn.microsoft.com/Profile/de-DE/?user=ucancode%20softwarea few good vc++ extension library<p>I find a few good vc++ extension library, I think it will be useful for everyone.<br/>A list of good VC++ Extension Library for every developers:<br/>1. Office 2007 like GUI toolkit: (From bcgsoft)<br/><a href="http://www.bcgsoft.com">http://www.bcgsoft.com</a></p> <p>2. VC++ Flow Diagramming, Drawing, Printing, HMI Source Code Kit: (From ucancode software)<br/><a href="http://www.ucancode.net">http://www.ucancode.net</a></p> <p>3. VC++ Grid Control from Prof -uis:<br/><a href="http://www.prof-uis.com">http://www.prof-uis.com</a></p> <p>4. Great VC++ Samples and Articles:<br/><a href="http://www.codeproject.com">http://www.codeproject.com</a></p> <p>5. Great vc++ forum:<br/><a href="http://www.codeguru.com">http://www.codeguru.com</a></p> <p>6. Great vc++ tool:<br/><a href="http://www.wholetomato.com/">http://www.wholetomato.com/</a></p> <p>7. Free VC++ Project backup tool:<br/><a href="http://www.ucancode.net/Products/free product/toolbox_backup.htm">http://www.ucancode.net/Products/free%20product/toolbox_backup.htm</a></p> <p>8. Free VC++ Project rename tool:<br/><a href="http://www.ucancode.net/Products/free product/toolbox.htm">http://www.ucancode.net/Products/free%20product/toolbox.htm</a></p> <p>9. Free vc++ replace all in files tool:<br/><a href="http://www.ucancode.net/Products/free product/toolbox_replace.htm">http://www.ucancode.net/Products/free%20product/toolbox_replace.htm</a></p> <p>10. Manage and Renumber Resource Symbol IDs:<br/><a href="http://www.riverblade.co.uk">http://www.riverblade.co.uk</a></p> <p>...</p><hr class="sig">jackThu, 26 Nov 2009 13:29:48 Z2009-11-27T13:23:01Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/38f45138-5190-40e0-be96-2f793d1199e4http://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/38f45138-5190-40e0-be96-2f793d1199e4glen_ghttp://social.msdn.microsoft.com/Profile/de-DE/?user=glen_gCDC::DrawText compiled with Visual Studio 2008 does not display mbcs (japanese) characters correctlyHello, <div><br/></div> <div>We have an app which was ported from VS 6.0 (statically linked MFC) to VS 2008 (dynamically linked MFC).</div> <div>The peice of code in question uses the MFC device context to paint a bitmap on a button.</div> <div><br/></div> <div>The app built with VS 6.0 is able to display japanese characters correctly (on a JPN OS). However, the same app built with VS 2008 did not.</div> <div><br/></div> <div>Thanks for any feedback.</div> <div><br/></div> <div>Below is a code snippet.</div> <div><br/></div> <div> <div><span style="white-space:pre"></span></div> <pre> CString strButtonText; CString strTemp; GetWindowText(strButtonText); if(!m_bInitialized) LoadDefaults(); if(!m_mybitmap.m_hObject){ Invalidate(); return; } RECT rect; CDC *mydc=CDC::FromHandle(lpDrawItemStruct-&gt;hDC); CDC * pMemDC = new CDC; pMemDC-&gt;CreateCompatibleDC(mydc); CBitmap *pOldBitmap = pMemDC-&gt;SelectObject(&amp;m_mybitmap); mydc-&gt;SetBkMode(TRANSPARENT); mydc-&gt;SetMapMode(MM_TEXT); mydc-&gt;SetTextAlign(TA_TOP | TA_LEFT); SIZE size; int i = strButtonText.Find('&amp;'); if (i == -1) strTemp = strButtonText; else strTemp = strButtonText.Left(i) + strButtonText.Mid(i + 1); GetTextExtentPoint32(*mydc,strTemp,strTemp.GetLength(),&amp;size); GetWindowRect(&amp;rect); ScreenToClient(&amp;rect); int iWidth = rect.right - rect.left; int iHeight = rect.bottom - rect.top; int iLeft = (iWidth - size.cx)/2; int iTop = (iHeight - size.cy)/2; if(m_iAlign == ALIGN_TOP){ iTop = 0 + 2; } else if( m_iAlign == ALIGN_BOTTOM){ iTop = (iHeight - size.cy) -2; } if(iTop &lt; 0) iTop = 5;  if(iLeft &lt; 0) iLeft = 5;  // Disabled if((!IsWindowEnabled( )) &amp;&amp; (m_iStates == 4)){ mydc-&gt;SetTextColor(m_crTextDisabledColor); m_rcSrc.left = m_ButtonSize.cx*3; m_rcSrc.right = m_rcSrc.left + m_ButtonSize.cx; m_dibBmp.DrawDIBTransparent( mydc, m_rcDest, m_rcSrc); } //Selected else if(lpDrawItemStruct-&gt;itemState &amp; ODS_SELECTED){ if(m_bTextOverColorSet) mydc-&gt;SetTextColor(m_crTextOverColor); else mydc-&gt;SetTextColor(m_crTextColor); m_rcSrc.left = m_ButtonSize.cx; m_rcSrc.right = m_rcSrc.left + m_ButtonSize.cx; m_dibBmp.DrawDIBTransparent( mydc, m_rcDest, m_rcSrc); if(m_iAlign == ALIGN_CENTER){ iLeft++; iTop++; } } else{ mydc-&gt;SetTextColor(m_crTextColor); //Mouse Over if(m_bHover){ if(m_bTextOverColorSet) mydc-&gt;SetTextColor(m_crTextOverColor); m_rcSrc.left = m_ButtonSize.cx*2; m_rcSrc.right = m_rcSrc.left + m_ButtonSize.cx; m_dibBmp.DrawDIBTransparent( mydc, m_rcDest, m_rcSrc); } // Default else{ m_rcSrc.left = 0; m_rcSrc.right = m_rcSrc.left + m_ButtonSize.cx; m_dibBmp.DrawDIBTransparent( mydc, m_rcDest, m_rcSrc); } } rect.top = iTop; rect.left = iLeft; mydc-&gt;DrawText(strButtonText, &amp;rect, DT_SINGLELINE); // Draw the focus rectangle around the button if((m_bHasFocus) &amp;&amp; (m_bShowFocus)){ RECT rect; rect.top = 2; rect.bottom = m_ButtonSizeScaled.cy-2; rect.left = 2; rect.right = m_ButtonSizeScaled.cx-2; mydc-&gt;DrawFocusRect(&amp;rect); } if(m_bSelected){ RECT rect; rect.top = 2; rect.bottom = m_ButtonSizeScaled.cy-2; rect.left = 2; rect.right = m_ButtonSizeScaled.cx-2; CBrush cBrush; cBrush.CreateSolidBrush(m_crSelectedColor); mydc-&gt;FrameRect(&amp;rect, &amp;cBrush); } // clean up pMemDC-&gt;SelectObject(pOldBitmap); delete pMemDC; </pre> <br/> <div><br/></div> </div>Thu, 17 Sep 2009 23:08:50 Z2009-11-27T13:18:42Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/629aeac4-0426-427c-a104-ae0d99a98ecahttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/629aeac4-0426-427c-a104-ae0d99a98ecaunclepauly2http://social.msdn.microsoft.com/Profile/de-DE/?user=unclepauly2how to get installed hotfixes on vista using C++hello,<br/><br/>as part my install, i need to be able to tell if the install pc has a certain hotfix on it, and if not, install the hotfix. for XP this is fine, i can use WMI with the Win32_QuickFixEngineering class, doing a <span style="color:#a31515;font-size:x-small"><span style="color:#a31515;font-size:x-small"> <p>SELECT * FROM Win32_QuickFixEngineering WHERE HotFixID='xxxxxxx'</p> </span></span><br/>query, and this works great. however, the msdn documentation says that :<br/><br/>Starting with Windows Vista, this class returns only the updates supplied by Component Based Servicing (CBS). These updates are not listed in the registry. Updates supplied by Microsoft Windows Installer (MSI) or the Windows update site (<a href="http://go.microsoft.com/FWLink/?LinkId=84398"><span style="color:#0033cc">http://update.microsoft.com</span></a>) are not returned by <strong>Win32_QuickFixEngineering</strong>.<br/><br/><br/><br/>so how can i reliably get all the hotfixes installed on a vista pc, ie the ones installed using MSI or Windows Update ? i am using C++.<br/><br/>any help appreciated.Fri, 27 Nov 2009 13:17:31 Z2009-11-27T14:51:42Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/2c85aa74-f160-4009-ab59-320ad2cb91bbhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/2c85aa74-f160-4009-ab59-320ad2cb91bbRomTibihttp://social.msdn.microsoft.com/Profile/de-DE/?user=RomTibiListing user accounts in Windows using VC++6Is possible to list the user accounts in Windows using VC++6Fri, 27 Nov 2009 05:01:16 Z2009-11-27T13:01:16Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/3843f1ec-6570-4d93-a201-588e63f56cfehttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/3843f1ec-6570-4d93-a201-588e63f56cfenerdinatorhttp://social.msdn.microsoft.com/Profile/de-DE/?user=nerdinatorinfinite arrayI have been having this problem when it came to using arrays. <div><br/> <div>I want to take in as many arrays a user gives.</div> <div><br/></div> <div>I used list&lt;int&gt;.</div> <div>But how do you perform operations</div> <div>(Operations,I mean something like,int y=1st element array/2nd element of array.) with it?</div> <div><br/></div> <div>It is just used to store and display.</div> <div>The numbers stored are just stored like strings.So how do I make array like</div> <div>int x[],</div> <div>which lets me put in infinite number of elements in it and also lets me perform operations with it?</div> <div><br/></div> <div><br/></div> <div><br/></div> </div>Fri, 27 Nov 2009 09:01:51 Z2009-11-27T11:38:37Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/e0aaeaa5-2f51-498e-999e-b27019aa257bhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/e0aaeaa5-2f51-498e-999e-b27019aa257bkdinhttp://social.msdn.microsoft.com/Profile/de-DE/?user=kdinWinDBG: How to find out Memory Leak with WinDBG<p>Hi guys,<br/><br/>i have a app that has memory leaks but i can't find out with windbg.<br/><br/>void AllocateMemory() <br/>{ <br/>     int* a = new int[2000]; <br/>     ZeroMemory(a, 8000); <br/>     Sleep(1); <br/>}</p> <p>int _tmain(int argc, _TCHAR* argv[])<br/>{   while(1) <br/>     { <br/>        AllocateMemory(); <br/>     } <br/>     return 0; <br/>} <br/><br/><br/>i can't a complete call stack from my app. i know the real problem is in Testcpp!AllocateMemory function but this function doesn't show in the call stack.<br/><br/>options from my app in release mode: <br/><br/>Debug information format: /Zi<br/>Generate debug info: YES (/DEBUG)<br/>Optimization: Disabled (/0d)<br/><br/>In debug mode the call stack is OK but in release mode is NOK.<br/><br/>0:001&gt; !heap -p -a 1156b8f0    <br/>    address 1156b8f0 found in<br/>    _HEAP @ 390000<br/>      HEAP_ENTRY Size Prev Flags    UserPtr UserSize - state<br/>        1156b8e8 03eb 0000  [07]   1156b8f0    01f40 - (busy)<br/>        Trace: 003f<br/>        7c96eed2 ntdll!RtlDebugAllocateHeap+0x000000e1<br/>        7c94b394 ntdll!RtlAllocateHeapSlowly+0x00000044<br/>        7c918f21 ntdll!RtlAllocateHeap+0x00000e64<br/>        40174c Testcpp!malloc+0x0000007a</p>Wed, 25 Nov 2009 19:10:56 Z2009-11-27T11:27:41Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/801ba6d7-a284-4b5d-a75b-3652138d6dffhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/801ba6d7-a284-4b5d-a75b-3652138d6dffm0ng00sehttp://social.msdn.microsoft.com/Profile/de-DE/?user=m0ng00seLINK : fatal error LNK1000: Internal error during IncrBuildImage<font face=Arial size=2><font size=1><font size=1> <p>LINK : fatal error LNK1000: Internal error during IncrBuildImage</p></font></font><font size=3></font> <p align=left><font size=3></font> </p> <p align=left><font size=3>I get that error every single time I build in VC++ 2008 Express. I checked on Google and on this site and this issue was reported over 60 days ago. 10 - 20 people complained until Microsoft closed the thread so nobody else could report it. It is also reported in several forums and Blogs on Google plus my Vista system automatically sends a report to Microsoft about it sometimes.</font></p> <p align=left><font size=3></font> </p> <p align=left><font size=3>It happens with every single debug build I do except very tiny sample apps though it's even done it with them sometimes. With a few hundred lines of code (which is tiny) it does it every single build and it seems to be taking longer and longer to recover each time. A second build usually builds okay.</font></p> <p align=left><font size=3></font> </p> <p align=left><font size=3>Microsoft closed the thread because they said they &quot;could not reproduce the issue in their lab&quot; yet customers were actively sending in bucket dumps, error logs, sample code etc to try and help the Microsoft Team reproduce the error... when Microsoft closed the thread. What is with that?</font></p> <p align=left><font size=3></font> </p> <p align=left><font size=3>I have had this issue for over a month and as I build at least fifty times a day sometimes then it is incredibly frustrating. People all over the world seem to be getting the exact same problem.</font></p> <p align=left><font size=3></font> </p> <p align=left><font size=3>I re-installed VC++ from scratch and ran registry repair tools, defragged my hard disk, ran DLL check software, did a &quot;rescue&quot; check of my Vista build, made sure that I had all updates, patches etc... yet nothing has made the slightest bit of difference.</font></p> <p align=left><font size=3></font> </p> <p align=left><font size=3>m0ng00se (NZ)</font></p> <p align=left><font size=3></font> </p> <p align=left><font size=3>m0ng00se@xtra.co.nz</font></font></p>Sun, 27 Jan 2008 07:55:41 Z2009-11-27T11:17:25Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/c8c346bb-8097-4d7c-8d45-4b6566ef625dhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/c8c346bb-8097-4d7c-8d45-4b6566ef625ddipakbshttp://social.msdn.microsoft.com/Profile/de-DE/?user=dipakbsCFileFind Class does not work in Windows server 2008<br/> The following peace of code works perfectly on windows xp. But it does not work on windows  server 2008. It(oFileFind) does not  recognize the root directory to search  a given file. What would be the possible cause? <br/> <br/>                CFileFind oFileFind;<br/>                 if ( oFileFind.FindFile( strFilename ) )<br/>                 {<br/>                     bFoundIt = TRUE;<br/>                     break;                    // file with this extension exists<br/>                 }<br/> <br/>Fri, 20 Nov 2009 11:31:43 Z2009-11-27T10:53:52Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/a22b664e-cb30-44f4-bf77-b7a385de49f3http://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/a22b664e-cb30-44f4-bf77-b7a385de49f3Gaute.http://social.msdn.microsoft.com/Profile/de-DE/?user=Gaute.SHBrowseForFolder bug in Windows 7?I use BFFM_SETSELECTION and BIF_NEWDIALOGSTYLE in the code below.  <br/>In XP and Vista this selects the folder and scrolls the list to make the selected folder visible to the user.<br/><br/>In Windows 7 the list is not scrolled to show the selected folder.<br/><br/><strong>Is there a workaround?</strong> (without removing BIF_NEWDIALOGSTYLE)<br/><br/><br/><br/><br/> <div style="background-color:white;color:black"> <pre><span style="color:blue">int</span> CALLBACK BrowseCallbackProc(HWND hWnd,UINT uMsg, LPARAM, LPARAM ) { TCHAR szDir[MAX_PATH+1]; <span style="color:blue">switch</span>(uMsg) { <span style="color:blue">case</span> BFFM_INITIALIZED: <span style="color:blue">if</span>( ::GetCurrentDirectory( MAX_PATH, szDir)) ::SendMessage(hWnd,BFFM_SETSELECTION,<span style="color:blue">true</span>,(LPARAM)szDir); <span style="color:blue">break</span>; } <span style="color:blue">return</span> 0; } <span style="color:blue">bool</span> BrowseForFolder( HWND hParent, LPTSTR szOutPath ) { <span style="color:blue">bool</span> bSelected = <span style="color:blue">false</span>; { <span style="color:green">/* Gets the Shell's default allocator */</span> LPMALLOC pMalloc; <span style="color:blue">if</span>( SUCCEEDED(::SHGetMalloc(&amp;pMalloc)) ) { BROWSEINFO bi; ZeroMemory(&amp;bi,<span style="color:blue">sizeof</span>(bi)); bi.hwndOwner = hParent; bi.ulFlags = BIF_NEWDIALOGSTYLE | BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS; bi.lpfn = BrowseCallbackProc; LPITEMIDLIST pidl = ::SHBrowseForFolder(&amp;bi); <span style="color:blue">if</span>( pidl ) { bSelected = ::SHGetPathFromIDList(pidl,szOutPath)!=0; pMalloc-&gt;Free(pidl); <span style="color:green">// Free the PIDL allocated by SHBrowseForFolder.</span> } pMalloc-&gt;Release(); <span style="color:green">// Release the shell's allocator.</span> } } <span style="color:blue">return</span> bSelected; } </pre> </div>Wed, 25 Nov 2009 13:17:39 Z2009-11-27T10:47:04Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/7a552abf-e815-423c-8c66-5114c7bac6fchttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/7a552abf-e815-423c-8c66-5114c7bac6fcVyasahttp://social.msdn.microsoft.com/Profile/de-DE/?user=VyasaHow to List the Folders in a DirectoryHello, <div><br/></div> <div>I have a application where I need the folder names inside the directory and I want to put the folder names to a ListBox or to a ComboBox. </div> <div>Help me out to do this.</div> <div><br/></div> <div>Thanks</div>Tue, 24 Nov 2009 08:47:28 Z2009-11-27T10:46:07Zhttp://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/df89e7ae-c1a4-475c-b188-6550e7340026http://social.msdn.microsoft.com/Forums/de-DE/vcgeneral/thread/df89e7ae-c1a4-475c-b188-6550e7340026Rajiv Podarhttp://social.msdn.microsoft.com/Profile/de-DE/?user=Rajiv%20PodarGet a compile time of each cpp file?Hi Guys,<br/><br/>I am new to this forum. I want some information regarding the build time.<br/>I have a requirement in which I want to calculate the time required by each file to get compiled.<br/>I got one setting <br/><strong>Tools &gt; Options &gt; Project and Solutions &gt; VC++ Project Settings &gt;Build Timing<br/></strong>But this tells the build time of whole project, but I want for each signle cpp file.<br/>So is there any way to do this or any third party tool is available which can be used??<br/>Pls guys it's urgent so pls reply.........Mon, 23 Nov 2009 09:23:03 Z2009-11-27T10:31:28Z