Visual C++ General ForumGeneral questions about Visual C++ , including the development environment, libraries, setup, debugger, samples, and documentation.© 2009 Microsoft Corporation. All rights reserved.Wed, 25 Nov 2009 23:36:38 Z805bdc3f-bf13-4784-9e81-548b5030302bhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/05e1fb09-5995-497a-b801-d88fe236641chttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/05e1fb09-5995-497a-b801-d88fe236641cwzvh3chttp://social.msdn.microsoft.com/Profile/en-US/?user=wzvh3cerror LNK2019: unresolved external symbol "void __cdecl GetVals(int &,int &)"Why do I get the following linking error.  I am using Visual c++ 2008 Express Edition?<br/>Following is the code.<br/><br/><span style="color:#008000;font-size:x-small"><span style="color:#008000;font-size:x-small"> <p>// Listing 14.8 Without function pointers</p> </span></span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small"><font size=2 color="#0000ff"><font size=2 color="#0000ff"> <p>#include</p> </font></font></span><font size=2 color="#0000ff"> <p> </p> </font></span> <p><span style="font-size:x-small"> </span><span style="color:#a31515;font-size:x-small"><span style="color:#a31515;font-size:x-small">&lt;iostream&gt;</span></span></p> <span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small"><font size=2 color="#0000ff"><font size=2 color="#0000ff"> <p>using</p> </font></font></span><font size=2 color="#0000ff"> <p> </p> </font></span> <p><span style="font-size:x-small"> </span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">namespace</span></span><span style="font-size:x-small"> std;</span></p> <span style="color:#008000;font-size:x-small"><span style="color:#008000;font-size:x-small"> <p>//void Square (int&amp;,int&amp;);</p> <p>//void Cube (int&amp;, int&amp;);</p> <p>//void Swap (int&amp;, int &amp;);</p> </span></span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small"><font size=2 color="#0000ff"><font size=2 color="#0000ff"> <p>void</p> </font></font></span><font size=2 color="#0000ff"> <p> </p> </font></span> <p><span style="font-size:x-small"> GetVals(</span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">int</span></span><span style="font-size:x-small">&amp;, </span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">int</span></span><span style="font-size:x-small">&amp;);</span></p> <span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small"><font size=2 color="#0000ff"><font size=2 color="#0000ff"> <p>void</p> </font></font></span><font size=2 color="#0000ff"> <p> </p> </font></span> <p><span style="font-size:x-small"> PrintVals(</span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">void</span></span><span style="font-size:x-small"> (*)(</span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">int</span></span><span style="font-size:x-small">&amp;, </span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">int</span></span><span style="font-size:x-small">&amp;),</span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">int</span></span><span style="font-size:x-small">&amp;, </span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">int</span></span><span style="font-size:x-small">&amp;);</span></p> <span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small"><font size=2 color="#0000ff"><font size=2 color="#0000ff"> <p>enum</p> </font></font></span><font size=2 color="#0000ff"> <p> </p> </font></span> <p><span style="font-size:x-small"> BOOL { FALSE, TRUE };</span></p> <span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small"><font size=2 color="#0000ff"><font size=2 color="#0000ff"> <p>void</p> </font></font></span><font size=2 color="#0000ff"> <p> </p> </font></span> <p><span style="font-size:x-small"> main() <p>{</p> <font size=2> <p> </p> </font></span></p> <p><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">int</span></span><span style="font-size:x-small"> valOne=1, valTwo=2;<font size=2> <p> </p> </font></span></p> <p><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">int</span></span><span style="font-size:x-small"> choice; <p>BOOL fQuit = FALSE;</p> <font size=2> <p> </p> </font></span></p> <p><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">void</span></span><span style="font-size:x-small"> (*pFunc)(</span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">int</span></span><span style="font-size:x-small">&amp;, </span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">int</span></span><span style="font-size:x-small">&amp;);<font size=2> <p> </p> </font></span></p> <p><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">while</span></span><span style="font-size:x-small"> (fQuit == FALSE) <p>{</p> <font size=2> <p>cout &lt;&lt;</p> </font></span></p> <p><span style="color:#a31515;font-size:x-small"><span style="color:#a31515;font-size:x-small">&quot;(0)Quit (1)Change Values (2)Square (3)Cube (4)Swap: &quot;</span></span><span style="font-size:x-small">; <p>cin &gt;&gt; choice;</p> <font size=2> <p> </p> </font></span></p> <p><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">switch</span></span><span style="font-size:x-small"> (choice) <p>{</p> <font size=2> <p> </p> </font></span></p> <p><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">case</span></span><span style="font-size:x-small"> 1:pFunc = GetVals; </span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">break</span></span><span style="font-size:x-small">;<font size=2> <p> </p> </font></span></p> <p><span style="color:#008000;font-size:x-small"><span style="color:#008000;font-size:x-small">//case 2:pFunc = Square; break;</span></span></p> <span style="font-size:x-small"><font size=2> <p> </p> </font></span> <p><span style="color:#008000;font-size:x-small"><span style="color:#008000;font-size:x-small">//case 3:pFunc = Cube; break;</span></span></p> <span style="font-size:x-small"><font size=2> <p> </p> </font></span> <p><span style="color:#008000;font-size:x-small"><span style="color:#008000;font-size:x-small">//case 4:pFunc = Swap; break;</span></span></p> <span style="font-size:x-small"><font size=2> <p> </p> </font></span> <p><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">default</span></span><span style="font-size:x-small">:fQuit = TRUE; </span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">break</span></span><span style="font-size:x-small">; <p>}</p> <font size=2> <p> </p> </font></span></p> <p><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">if</span></span><span style="font-size:x-small"> (fQuit == TRUE)<font size=2> <p> </p> </font></span></p> <p><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">break</span></span><span style="font-size:x-small">; <p>PrintVals ( pFunc, valOne, valTwo);</p> <p>}</p> <p>}</p> </span></p> <span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small"><font size=2 color="#0000ff"><font size=2 color="#0000ff"> <p>void</p> </font></font></span><font size=2 color="#0000ff"> <p> </p> </font></span> <p><span style="font-size:x-small"> PrintVals( </span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">void</span></span><span style="font-size:x-small"> (*pFunc)(</span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">int</span></span><span style="font-size:x-small">&amp;, </span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">int</span></span><span style="font-size:x-small">&amp;),</span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">int</span></span><span style="font-size:x-small">&amp; x, </span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">int</span></span><span style="font-size:x-small">&amp; y) <p>{</p> <font size=2> <p>cout &lt;&lt;</p> </font></span></p> <p><span style="color:#a31515;font-size:x-small"><span style="color:#a31515;font-size:x-small">&quot;x: &quot;</span></span><span style="font-size:x-small"> &lt;&lt; x &lt;&lt; </span><span style="color:#a31515;font-size:x-small"><span style="color:#a31515;font-size:x-small">&quot; y: &quot;</span></span><span style="font-size:x-small"> &lt;&lt; y &lt;&lt; endl; <p>pFunc(x,y);</p> <font size=2> <p>cout &lt;&lt;</p> </font></span></p> <p><span style="color:#a31515;font-size:x-small"><span style="color:#a31515;font-size:x-small">&quot;x: &quot;</span></span><span style="font-size:x-small"> &lt;&lt; x &lt;&lt; </span><span style="color:#a31515;font-size:x-small"><span style="color:#a31515;font-size:x-small">&quot; y: &quot;</span></span><span style="font-size:x-small"> &lt;&lt; y &lt;&lt; endl; <p>}</p> </span></p> <br/>Wed, 25 Nov 2009 23:22:53 Z2009-11-25T23:36:37Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/6b2c2845-f2f4-4c0e-a2f1-54c413607492http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/6b2c2845-f2f4-4c0e-a2f1-54c413607492john.pricehttp://social.msdn.microsoft.com/Profile/en-US/?user=john.priceMFC MDI app shell file open behavior changed on Windows 7<p class=MsoNormal style="margin:0in 0in 10pt"><span style="font-family:Calibri;font-size:small">Hi,<br/><br/>I have developed an MFC application with Visual Studio 2008 SP1 using the Feature Pack for MFC. It was started with an MFC App Wizard project as an MDI app and supports two file types. It has been developed on x64 versions of Windows as an x64 app. On Windows XP x64 and Windows Vista x64 when I click on a registered file type in Windows Explorer, my app opens and loads the file. Without closing the app and clicking on a second file, the file is loaded into a new MDI window in the same app instance. The same is true for a third, fourth and so on number of files. This is the desired behavior.</span></p> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="font-family:Calibri;font-size:small">I have recently moved the project to Windows 7 release (Windows 7 Ultimate x64). The only consequence I have found so far is a behavior change in the way shell open of my file types is working on Windows 7. In Windows 7 when I click on a registered file type in Windows Explorer, my app opens and loads the file. Without closing the app and clicking on a second file, the file is opened in a new instance of my app, not a new MDI window in the same instance. I really prefer the former behavior, and would like some help with getting this to work like it did on previous versions of Windows. <br/><br/>Thanks,<br/><br/>John Price</span></p>Wed, 25 Nov 2009 17:55:12 Z2009-11-25T20:59:53Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/cef6584d-d05e-4510-a7c2-7ab529c303f9http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/cef6584d-d05e-4510-a7c2-7ab529c303f9spujiahttp://social.msdn.microsoft.com/Profile/en-US/?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-25T20:27:34Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/465a99e8-e67c-413d-b98c-3735796791c0http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/465a99e8-e67c-413d-b98c-3735796791c0Charlweedhttp://social.msdn.microsoft.com/Profile/en-US/?user=Charlweed"Class doesn't support automation" error in VSI have exactly the same problem as described in<a title="this post of sept/11/2007" href="http://social.msdn.microsoft.com/Forums/en-US/vcplus2008prerelease/thread/f6d24c3e-d44f-4de2-a5ef-51a3eb8f4380?prof=required&amp;ppud=4" title="this post of sept/11/2007"> this post of <span class=date>9/11/2007</span> </a> .<br/> <span style="font-family:Arial;font-size:x-small"> I'm trying to add a add an ATL Simple Object (Add, Class...). After I type in the short name and click Finish, I get a &quot;Class doesn't support automation&quot; popup error message. </span> <br/> <br/> Microsoft Visual Studio 2008<br/> Version 9.0.30729.1 SP<br/> OS Name    Microsoft Windows 7 Professional<br/> Version    6.1.7600 Build 7600<br/> <br/> <br/> <br/> I'm trying to write a shell extension, but I cant get started...Sat, 21 Nov 2009 06:03:56 Z2009-11-25T20:12:00Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/e0aaeaa5-2f51-498e-999e-b27019aa257bhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/e0aaeaa5-2f51-498e-999e-b27019aa257bkdinhttp://social.msdn.microsoft.com/Profile/en-US/?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-25T20:05:52Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/6f9dd73c-6a6c-495a-a55b-ab52f2356462http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/6f9dd73c-6a6c-495a-a55b-ab52f2356462RobC123http://social.msdn.microsoft.com/Profile/en-US/?user=RobC123Win23 Threads and Child WindowsHi,<br/> <br/> I've been reading for sometime about win32 threads and can't quite understand if it's possible to create a child window to run in a different thread from it's parent?Wed, 25 Nov 2009 17:36:11 Z2009-11-25T20:40:46Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/881d5ef3-0953-44ee-a116-4586e957d2cbhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/881d5ef3-0953-44ee-a116-4586e957d2cbKeith Godwin Chapmanhttp://social.msdn.microsoft.com/Profile/en-US/?user=Keith%20Godwin%20ChapmanCompiling C code on Visual StudioI have some C code which I need to compile on Visual Studio 2008. The code uses some features available in freebsd hence I provide the freebsd header files as a additional include dir.<br/> <br/> I regularly get errors of the following form though,<br/> <br/> c:\test\a\tools\Target\usr\<span class=keyword>include</span> \sys/_types.h(88) : error C2628: <span class=literal>'__ct_rune_t'</span> followed by <span class=literal>'__wchar_t'</span> is illegal (did you forget a <span class=literal>';'</span> ?)<br/> <br/> It seems that Visual studio is treating it as a C++ compilation instead of C. The extensions of the files are .c and I have set the property of the compiler to be used to the C compiler. Is there any other setting that I need to do?<br/> <br/> I'm sure I'm missing some additional configuration step.<br/> <br/> Thanks for your help.Mon, 23 Nov 2009 16:08:44 Z2009-11-25T19:21:48Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/a47f2077-7a05-46f8-a3a3-8f7c3f43fb22http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/a47f2077-7a05-46f8-a3a3-8f7c3f43fb22oldfishhttp://social.msdn.microsoft.com/Profile/en-US/?user=oldfishhow to create a 64 bit c++ application with visual studio 2008?I am trying to build a c++ application for 64 bit platform.<br/> I use visual studio 2008 and window server 2003 . i selelcted x64 platform at project property window and build solution with X64 configure tools. But the application can not run. The error message is: The imige file is valid, but is for a machine other than the current one. What is wrong with my application? how can I resolve this problem? Thanks!  <br/> <br/> <br/> my code is very simple for the purose of testing whether it is possible to create large matrix in 64 bit system. see below.<br/> <br/> #include &lt;iostream&gt;<br/> #include &lt;vector&gt;<br/> using namespace std;<br/> <br/> vector&lt;vector&lt;double&gt; &gt; dis;<br/> int main()<br/> {<br/>     int N;<br/>     cout&lt;&lt;&quot;choose a size:&quot;&lt;&lt;endl;<br/>     cin&gt;&gt;N;<br/>     <br/>     dis.resize(N);<br/>     for(int i=0; i&lt;N;i++)<br/>     {<br/>         for(int j=0; j&lt;N;j++)<br/>             dis[i].push_back(j*1.11);<br/>     }<br/>     cout&lt;&lt;&quot;rows of matrix&quot;&lt;&lt;dis.size()&lt;&lt;endl;<br/>     cout&lt;&lt;&quot;cols of matrix&quot;&lt;&lt;dis[0].size()&lt;&lt;endl;<br/>     return 0;<br/> }<br/> <br/>Wed, 25 Nov 2009 15:10:17 Z2009-11-25T18:27:06Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/c589e12e-d472-4991-8056-c4e4461b4b56http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/c589e12e-d472-4991-8056-c4e4461b4b56siavoshkchttp://social.msdn.microsoft.com/Profile/en-US/?user=siavoshkcWindows 7 Memory DumpWhen I start debugging Windows 7 Memory Dump file after a crash. VS Pro 2008 SP1 says the binary is not compatible. Why?<hr class="sig">System NoviceWed, 25 Nov 2009 16:58:06 Z2009-11-25T18:15:18Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/d14b0aec-a5a0-41a6-8663-8725b6822fa9http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/d14b0aec-a5a0-41a6-8663-8725b6822fa9akira32http://social.msdn.microsoft.com/Profile/en-US/?user=akira32CLR,How do I calculate FPSI use Application::Idle to calculate FPS, but it seems to be unsuitable. Becuase the Application::Idle does not like the CWinApp::Idle in MFC.<br/>Application::Idle event is not called in every frame. Could somebody know how to calculate FPS in Visual C++ CLR project?<br/><br/> <p>[STAThreadAttribute]<br/>int main(array&lt;System::String ^&gt; ^args)<br/>{<br/> Application::EnableVisualStyles();<br/> Application::SetCompatibleTextRenderingDefault(false);</p> <p> Form1^ form1=gcnew Form1();<br/> Application::Idle += gcnew System::EventHandler(form1,&amp;Form1::Form1_Idle);<br/> Application::Run(form1);<br/> return 0;<br/>}</p> <p> public: System::Void Form1_Idle(System::Object^  sender, System::EventArgs^  e) <br/>   {<br/>    DWORD currentTime=GetTickCount();<br/>    DWORD deltaTime=currentTime-m_PlayCurrentTime;</p> <p>    m_PlayCurrentTime=currentTime;</p> <p>    m_FPS-&gt;FrameCnt++;<br/>    m_FPS-&gt;TimeElapsed+=deltaTime;</p> <p>    if (m_FPS-&gt;TimeElapsed &gt;= 1000)<br/>    {<br/>     m_FPS-&gt;CalculateFPS();<br/>     m_FPS-&gt;TimeElapsed -= 1000;<br/>     m_FPS-&gt;FrameCnt    = 0;<br/>     FPStoolStripStatusLabel-&gt;Text=L&quot;FPS=&quot; + m_FPS-&gt;dFPS.ToString(); <br/>    }       <br/>   }</p>Mon, 23 Nov 2009 07:18:14 Z2009-11-25T17:08:36Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/8e1e504e-fa91-426a-97b8-f5640f64ad93http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/8e1e504e-fa91-426a-97b8-f5640f64ad93TX_http://social.msdn.microsoft.com/Profile/en-US/?user=TX_Windows 7 Taskbar - the undocumented MSTaskListWClass !!!<div><span style="font-family:Arial;font-size:small"><span style="font-size:13px;white-space:pre"><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:small"><span style="font-size:11px;white-space:normal"> <div> <div>Hello everybody.</div> <div><br/></div> <div>Sometimes it is needed to programmatically access the windows shell's taskbar. In previous versions of Windows, it was firstly the Tab-Control, then (for example in XP) the Toolbar. E.g. in XP, to access the taskbar (which is actually nothing more than a standard Toolbar) you should find Explorer.exe's windows in this hierarchy (of their classnames) : Shell_TrayWnd -&gt; RebarWindow32 -&gt; MSTaskSwWClass -&gt; ToolbarWindow32. The last one - window named &quot;Running Applications&quot; of class &quot;ToolbarWindow32&quot; is the one which is usually subclassed.</div> <div><br/></div> <div>Now in Windows 7 things changed. The last window in that chain - the actual taskbar - is not standard Toolbar (ToolbarWindow32) anymore. It is the window with MSTaskListWClass class now! This window does not react on any Toolbar messages like TB_BUTTONCOUNT or TB_HITTEST, etc. So it is impossible to interact with taskbar anymore!</div> <div><br/></div> <div>Does anyone have any idea of how to access the Taskbar in Windows 7? Google gives nothing on MSTaskListWClass. Where can the documentation be found?</div> <div><br/></div> <div>P.S.: The ITaskbarList interface is very poor, so it ain't an option :)</div> <div><br/></div> <div>Thank you in advance.</div> </div> </span></span></span></span></div>Fri, 20 Nov 2009 22:33:42 Z2009-11-25T17:01:45Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/d350982d-af95-4b35-a607-16d0b794ba6ahttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/d350982d-af95-4b35-a607-16d0b794ba6ajswigarthttp://social.msdn.microsoft.com/Profile/en-US/?user=jswigartMemory corruption possible with _SECURE_SCL ?So I had been having a problem for a few weeks where the dll for my bot would crash while unloading. It's one of those crashes where something was jacked up with the heap and the crash is when the program/dll is in the process of unloading, specifically the crash was when cleaning up boost::regex which I statically link to.<br> <br> The odd thing, is that I could never reproduce this crash, but it would happen consistantly on other peoples machine.<br> <br> A friend was even building the exact same code with the exact same version of visual studio 2005, resulting in a differently sized dll, and no crashes. I then started thinking something must be wrong with my 2005 install, maybe some jacked up libraries or something. Just before I re-installed 2005, it occured to me that I might know what the problem is. Also a few weeks ago, after discovering you can disable checked iterators and stuff in release mode, I changed some property sheets to define _SECURE_SCL=0, going for some extra performance. After removing that, and compiling again, the crash was finally gone, and the dll sized matched my friends. Problem solved.<br> <br> My best guess as to the problem is that when I built boost to begin with, it wasn't built with _SECURE_SCL=0, so linking it into a program that was built with _SECURE_SCL=0 was resulting in something that hosed some memory. Does this sound accurate? <span style="font-weight:bold">Is _SECURE_SCL one of those options that must be defined in everything or nothing at all?</span> I could find no mention of that in the docs, but after this experience it appears that it is a possibility. FYI I had it defined under preprocessor under project settings in the property sheet of my project.<br> <br>Another part that stumps me, is why couldn't I ever reproduce the crash on my machine, even though it was building the same code, with the same msvc, with the same boost libraries as my friend, and him and other users got the crash(and resulting minidump file) on every single shutdown.Thu, 26 Oct 2006 18:28:21 Z2009-11-25T17:00:08Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/90d5fefa-d620-49ac-8392-bb4964a185fehttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/90d5fefa-d620-49ac-8392-bb4964a185feEd..http://social.msdn.microsoft.com/Profile/en-US/?user=Ed..worker thread (MFC)I am looking for updating input data to worker threads in a multi-thread environment. I am thinking of terminating all worker threads and then creating new ones whenever the update request is received. Anyone knows how to terminate a worker thread from outside of it, meaning not using AfxEndThread()...<br/> <br/> Or any other better solutions? Really appreciate all the suggestions.....Wed, 25 Nov 2009 03:27:58 Z2009-11-25T16:35:01Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/872e8ff6-4246-4fb3-861b-6e5f87492fcfhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/872e8ff6-4246-4fb3-861b-6e5f87492fcfEduardo de Paula Mirandahttp://social.msdn.microsoft.com/Profile/en-US/?user=Eduardo%20de%20Paula%20MirandaSet printer on SHELLEXECUTEINFO<div><span style="font-family:Arial;font-size:small"><span style="font-size:13px;white-space:pre"> <div>Hello guys,  </div> <div><br/></div> <div>I am trying to print a file using <strong>SHELLEXECUTEINFO</strong>. I have to use <strong>SHELLEXECUTEINFO </strong>because my file is <strong>*.html</strong> </div> <div>and <strong>PrintDocument </strong>doesn't print correctly this kind of files. I want give to the user the option the select the printer on the network </div> <div>and with the selected printer send directly to the selected printer the <strong>html </strong>file. When I execute this code, always the file is printed </div> <div>on default printer. My code is below.</div> <div><br/></div> <div> <div style="color:Black;background-color:White"> <pre><span style="color:Blue">if</span>( System::Windows::Forms::DialogResult::OK == <span style="color:Blue">this</span>-&gt;printDialog1-&gt;ShowDialog() ){ pin_ptr&lt;<span style="color:Blue">const</span> <span style="color:Blue">wchar_t</span>&gt; parameters = PtrToStringChars( <span style="color:Blue">this</span>-&gt;printDialog1-&gt;PrinterSettings-&gt;PrinterName-&gt;ToString() ); SHELLEXECUTEINFO si; memset(&amp;si,0,<span style="color:Blue">sizeof</span>(si)); si.cbSize = <span style="color:Blue">sizeof</span>(si); si.fMask = SEE_MASK_NOCLOSEPROCESS; si.hwnd = NULL; si.lpVerb = L<span style="color:#A31515">&quot;print&quot;</span>; si.lpParameters = LPCTSTR(parameters); si.lpDirectory = NULL; si.nShow = SW_SHOWNORMAL; si.hInstApp = NULL; si.lpFile = LPCTSTR(path); ShellExecuteEx(&amp;si); } </pre> </div> <br/></div> <div>Thanks,</div> </span></span></div> <hr class=sig> Eduardo MirandaTue, 24 Nov 2009 14:20:04 Z2009-11-25T16:17:10Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/9efb2196-1474-4a3b-a637-2dfda39f8997http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/9efb2196-1474-4a3b-a637-2dfda39f8997kalamramhttp://social.msdn.microsoft.com/Profile/en-US/?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-25T16:11:17Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/07402677-1046-4ba7-b4a3-544ce5dba2e8http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/07402677-1046-4ba7-b4a3-544ce5dba2e8Ares Leehttp://social.msdn.microsoft.com/Profile/en-US/?user=Ares%20LeeProblem of security_descriptor in NTFS volumeIn NTFS 3.0+, the security_descriptor data is stored in $Secure file, and there is a field in $STANDARD_INFORMATION to describ the id of file's security_descriptor information( but there is $SECURITY_DESCRIPTOR in some files such as root).<br/> My problem is : <br/> Whether one sd can be used by multiple files?(with the same id)?<br/> How to determine one sd is referenced by multiple files?<br/> How to determine how many files have referenced certain sd?<br/> <br/> Thx<hr class="sig">Ares LeeWed, 25 Nov 2009 14:59:59 Z2009-11-25T15:00:00Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/3356177b-a729-4407-a284-9ae47a99290ahttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/3356177b-a729-4407-a284-9ae47a99290aLarry in SJhttp://social.msdn.microsoft.com/Profile/en-US/?user=Larry%20in%20SJHow to tell cl.exe or the build process to report more errors during one compilationSorry, I can't recall how to do this and I can't seem to locate the information by searching, or in the MSDN documentation.<br/> This is in VC6 (VS6), C++ 6.0 ... I know it's a bit old.<br/> <br/> I had an undefined function call in my .cpp source file.<br/> When I do a Build in the IDE, the compiler reports an error.<br/> I fix the source, and rebuild.<br/> Then it finds a similar error, farther down in the file.  So I fix that.<br/> And on, and on, and on.  Dozens ...<br/> <br/> I thought that there's a build/compiler option somewhere, where I can tell it to &quot;keep going&quot;<br/> so then, I'll see a more or less complete list of the same error type, in the build log (in the console, or .plg).<br/> This is like a &quot;reduced&quot; output mode, or it gives up once it sees a significant error.<br/> <br/> I can't for the life of me find that setting, I'm pretty sure I used it in the past.  Thanks!  Larry.Sat, 21 Nov 2009 01:59:42 Z2009-11-25T14:56:32Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/a22b664e-cb30-44f4-bf77-b7a385de49f3http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/a22b664e-cb30-44f4-bf77-b7a385de49f3Gaute.http://social.msdn.microsoft.com/Profile/en-US/?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-25T14:29:08Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/02c716f1-652f-41bd-8a43-0fa8f8de4159http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/02c716f1-652f-41bd-8a43-0fa8f8de4159cutedevilhttp://social.msdn.microsoft.com/Profile/en-US/?user=cutedevilhow to save the data of usernames and passwords safely?As everyone knows, the application of Messenger and Skype can save a user's username and password. What is the solution?Wed, 25 Nov 2009 11:51:24 Z2009-11-25T14:20:22Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/670aed76-11b6-4a2c-ae3a-8cb0bac62f74http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/670aed76-11b6-4a2c-ae3a-8cb0bac62f74Ed Mitchellhttp://social.msdn.microsoft.com/Profile/en-US/?user=Ed%20MitchellPort to Win7 from XP build fails with message: "side-by-side" configuration is incorrectI have moved an app from XP to Win7 and try and rebuild it with VS2008.  The <br/> build fails with a message:<br/> <br/> ...<br/> &gt;Build log was saved at &quot;<a>file://c:\Users\Edward\Documents\Visual</a> Studio <br/> &gt;2008\Projects\RaceSail\Src\Lua51\LuaLib\Debug\BuildLog.htm&quot;<br/> 1&gt;LuaLib - 0 error(s), 1 warning(s)<br/> 2&gt;------ Build started: Project: Race, Configuration: Debug Win32 ------<br/> 2&gt;Copying  &quot;c:\Users\Edward\Documents\Visual Studio <br/> 2008\Projects\RaceSail\Src\RoboHlp\Racesail.hlp&quot; file to Target directory<br/> 2&gt;        1 file(s) copied.<br/> 2&gt;Compiling Lua Source Files<br/> 2&gt;The application has failed to start because its side-by-side configuration <br/> is incorrect. Please see the application event log or use the command-line <br/> sxstrace.exe tool for more detail.<br/> 2&gt;Project : error PRJ0019: A tool returned an error code from &quot;Compiling Lua <br/> Source Files&quot;<br/> ...<br/> The Lua library had been built successfully in an earlier step so there <br/> should be no need to compile the Lua Source files again.  I don't understand <br/> message about the &quot;side-by-side&quot; configuration is incorrect!  The warning <br/> was from the line:<br/> <br/> 1&gt;Compiling...<br/> 1&gt;cl : Command line warning D9035 : option 'Wp64' has been deprecated and <br/> will be removed in a future release<br/> <br/> Under XP there's no problem.<br/> <br/> Ed<br/>Wed, 25 Nov 2009 14:09:32 Z2009-11-25T14:09:33Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/ed5dafaf-26b7-4a21-adf1-8475dac859bdhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/ed5dafaf-26b7-4a21-adf1-8475dac859bdChristiawanhttp://social.msdn.microsoft.com/Profile/en-US/?user=ChristiawanHow to find and detect if an application( in my case, MS EXCEL ) is ACTIVE?I use MFC Visual C++ 4.2. <br><br>I have embedded a MS Excel automation process in my application. <br><br>I have it working well for the last 1 month. <br><br>Everytime my app do the automation process, it creates a new Excel dispatch app like this:<br><br><font color="#3333ff">    if( !app.CreateDispatch( &quot;Excel.Application&quot; ) ){<br>            MessageBox( &quot;Application Creation Failed&quot;, &quot;Inquiry Tool&quot;, MB_TOPMOST | MB_ICONERROR );<br>            return FALSE;<br>        }<br></font><br>My opinion, this process will take much time and slowing down the system. <br><br>So now I am thinking of how to handle if users have an Excel app ran and they also ran my application to do Excel automation. <br><br>I have the idea to check if the system has 1 Excel application ran, I just need to create / open a NEW WORKBOOK instead of creating a NEW EXCEL APPLICATION OBJECT that takes much time. <br><br>So to avoid system being slow down, I will just create a NEW EXCEL APPLICATION OBJECT if there HAS NOT BEEN any MS Excel app opened. <br><br>How to check if the MS Excel app has exist / ran? <br><br>Can I do it by using FindWindow?<br><br>Thank you. Thu, 02 Oct 2008 00:39:09 Z2009-11-25T14:40:01Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/efae080b-f8ac-41ee-bf3d-eeebf7ceee19http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/efae080b-f8ac-41ee-bf3d-eeebf7ceee19NIKHIL SISODIAhttp://social.msdn.microsoft.com/Profile/en-US/?user=NIKHIL%20SISODIAProblem with winsock recv functionHi, <div><br/></div> <div>I have an winsock service that receives and sends the data to the server.I have an two thread one is send thread and other is receiver thread.</div> <div>I am getting a problem  that when the thread has sent the data successfully we get the acknowledgement on the same socket from server for that i am using the funtion Recv() to receive the message on same socket but when the acknowledgement is not sent to the socket and Recv() is called then my send thread is hung at Recv() method.</div> <div>Following is the code i am using for sending:</div> <div><br/></div> <div> <div>WORD WINAPI CSendXmlThread::SocketWorkerThr(CSendXmlThread *pClass)</div> <div>{</div> <div><span style="white-space:pre"> </span>std::string sXml;</div> <div>    CSendSocket *sendSocket = NULL;</div> <div><span style="white-space:pre"> </span>char rcvBuf[8192] = {0};</div> <div><br/></div> <div>    std::string hostAddr = pClass-&gt;GetHostAddr();</div> <div>    UINT hostPort = pClass-&gt;GetHostPort();</div> <div><br/></div> <div><span style="white-space:pre"> </span>// Initialize the STA for this thread</div> <div><span style="white-space:pre"> </span>CoInitializeEx(NULL, COINIT_APARTMENTTHREADED );</div> <div><br/></div> </div> <div> <div>          while (pClass-&gt;m_State == CSendXmlThread::RIT_RUN)</div> <div><span style="white-space:pre"> </span>{</div> <div><span style="white-space:pre"> </span>while (pClass-&gt;GetNumRequestsToSend() &gt; 0)</div> <div><span style="white-space:pre"> </span>{</div> <div><span style="white-space:pre"> </span>sXml = pClass-&gt;GetNextXmlFromList();</div> <div><br/></div> <div>            sendSocket = new CSendSocket();</div> <div>            if (!sendSocket-&gt;Initialize(hostPort, hostAddr.c_str()))</div> <div>            {</div> <div>        <span style="white-space:pre"> </span>LOGERROR(E_FAIL, &quot;Failed to initialize send socket.&quot;, &quot;ePrescriber Service - Receive Socket Thread&quot;)</div> <div>            }</div> <div>            else if (!sendSocket-&gt;ConnectToSocket())</div> <div>            {</div> <div>        <span style="white-space:pre"> </span>LOGERROR(E_FAIL, &quot;Failed to conect send socket.&quot;, &quot;ePrescriber Service - Receive Socket Thread&quot;)</div> <div>            }</div> <div>            else if (!sendSocket-&gt;SendSocketData(sXml))</div> <div>            {</div> <div>        <span style="white-space:pre"> </span>LOGERROR(E_FAIL, &quot;Socket send failed.&quot;, &quot;ePrescriber Service - Receive Socket Thread&quot;)</div> <div>            }</div> <div>            else</div> <div>            {</div> <div>            }</div> <div><span style="white-space:pre"> </span></div> <div><span style="white-space:pre"> </span>if (!pClass-&gt;LogXMLMessageToFile(sXml.c_str()))</div> <div><span style="white-space:pre"> </span>{</div> <div><span style="white-space:pre"> </span>LOGERROR(E_FAIL, &quot;Logging Failed.&quot;, &quot; Send XML Thread- XML Logging Failed&quot;)</div> <div><span style="white-space:pre"> </span>}</div> <div><br/></div> <div><br/></div> <div><span style="white-space:pre"> </span></div> <div><span style="white-space:pre"> </span>// Receving the Acknowledgement</div> <div><br/></div> <div><span style="white-space:pre"> </span>int bytesRead = 0;</div> <div><span style="white-space:pre"> </span>Sleep(10000);</div> <div><span style="white-space:pre"> </span>if(pClass-&gt;RecvSocketData(sendSocket-&gt;GetMasterSocket(), rcvBuf, 8100, &amp;bytesRead))</div> <div><span style="white-space:pre"> <span style="white-space:pre"> </span></span>{</div> <div><span style="white-space:pre"> </span>rcvBuf[bytesRead] = '\0';</div> <div>                      ...</div> <div>.</div> <div>..</div> <div>..</div> <div>..</div> <div><span style="white-space:pre"><br/></span></div> <div>                        }</div> <div>             } </div> <div>    }</div> <div>}</div> <div>------</div> <div>-----</div> <div>-----</div> <div> <div>bool CSendXmlThread::RecvSocketData(SOCKET sock, char *cRecvBuffer, int iBuffSz, int *pBytesRead)</div> <div>{</div> <div><span style="white-space:pre"> </span></div> <div>        iResult = recv(sock, cRecvBuffer, iBuffSz, 0);   --my send thread is lost here  AS THERE WAS NO MESSAGE AT SOCKET......</div> <div> <div>        cRecvBuffer[*pBytesRead] = '\0';</div> <div><span style="white-space:pre"> </span></div> <div>    return true;</div> <div>}</div> </div> <div><br/></div> <div><br/></div> <div>Do we have any alternate to recv() which will return immediately if there is no data?</div> </div> </div>Wed, 25 Nov 2009 11:08:16 Z2009-11-25T13:08:37Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/431affa9-23b4-4d7e-a7ca-d3a3186868e4http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/431affa9-23b4-4d7e-a7ca-d3a3186868e4cpp-hackerhttp://social.msdn.microsoft.com/Profile/en-US/?user=cpp-hackerCEdit EM_GETFIRSTVISIBLELINE returns always 0 on vistaHello,<br/> I am using the message EM_GETFIRSTVISIBLELINE to get the zero-based index of the first visible character of a single line CEdit control. This works ok in W2k and XP, but not in Vista, there the call always returns 0.<br/> <br/> The msdn documentation says this should work:<br/> <p class=input><strong>Return Value</strong></p> <p>The return value is the zero-based index of the uppermost visible line in a multiline edit control.</p> <p><strong>Edit controls:</strong> For single-line edit controls, the return value is the zero-based index of the first visible character.</p> <strong>Rich edit controls:</strong> For single-line rich edit controls, the return value is zero. <br/> <br/> Is this a bug, is there a workaround to get the first visible character from a single-line edit control?<br/> <br/> Can anyone help me?<br/> Thanks, Andreas<br/>Tue, 24 Nov 2009 09:10:28 Z2009-11-25T13:08:19Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/551c67bb-10a9-452e-a0d2-fe0ba80a508dhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/551c67bb-10a9-452e-a0d2-fe0ba80a508dMartin Ba.http://social.msdn.microsoft.com/Profile/en-US/?user=Martin%20Ba.Sporadic (i.e. only sometimes) Linker Errors (LNK2001, LNK2019) when building with devenv.com (2005) from the command lineHi all.<br/> <br/> We face the problem that we see some very rare linker errors &quot;unresolved externals&quot; during our automated builds.<br/> Long story short is that one static lib is not resolved for one of dozens of projects once in a while.<br/> See the details below. <br/>  <br/> Environment:<br/> Visual Studio Professional 2005 SP1<br/> ####<br/> Microsoft Visual Studio 2005<br/> Version 8.0.50727.762  (SP.050727-7600)<br/> * Microsoft Visual Studio 2005 Professional Edition - ENU Service Pack 1 (KB926601)   <br/> * Security Update for Microsoft Visual Studio 2005 Professional Edition - ENU (KB971090)<br/> ####<br/> <br/> * 318 Projects in one SLN<br/> <br/> Problem:<br/> The solution - among all the other things - builds a common static lib for some of the projects and sometimes for one of the projects we will get unresolved external linker errors for the exported symbols of this static lib. <br/> This happened twice during the last 2 Weeks. That would be 2 times for about ~ 100 automated builds for all development branches.<br/> The error happened in two independent development branches.<br/> <br/> + The project dependencies in the .sln File are set correctly.<br/> + The generated command line as shown in the GUI correctly displays the library.<br/> + Building the SLN a second time after the error will &quot;just work&quot;<br/> <br/> Logging Output:<br/> ####<br/> Solution C:\...xyz.sln<br/> Running C:\Programme\Microsoft Visual Studio 8\Common7\IDE\devenv.com with parameters : /build &quot;Release|Win32&quot; &quot;C:\...xyz.sln&quot;<br/> ------<br/> Microsoft (R) Visual Studio Version 8.0.50727.762.<br/> Copyright (C) Microsoft Corp 1984-2005. All rights reserved.<br/> 1&gt;------ Build started: Project: P001, Configuration: Release Win32 ---<br/> 2&gt;------ Build started: Project: P002, Configuration: Release Win32 ---<br/> 3&gt;------ Build started: Project: P003, Configuration: Release Win32 ---<br/> 4&gt;------ Build started: Project: P004, Configuration: Release Win32 ---<br/> 3&gt;Compiling...<br/> 4&gt;Compiling...<br/> 2&gt;Performing Custom Build Step<br/> (....)<br/> 22&gt;------ Build started: Project: CD_Driver, Configuration: Release Win3<br/> (...)<br/> 22&gt;CommonDriver.cpp<br/> (...)<br/> 22&gt;CDriver.cpp<br/> (...)<br/> 22&gt;ErrorTools.cpp<br/> 22&gt;Generating Code...<br/> (...)<br/> 22&gt;Creating library...<br/> 18&gt;a.cpp<br/> 18&gt;b.cpp<br/> 22&gt;Build log was saved at &quot;file://c:\...\CD_Driver\Release\BuildLog.htm&quot;<br/> 22&gt;CD_Driver - 0 error(s), 0 warning(s)<br/> (....)<br/> 264&gt;------ Build started: Project: CDHM13, Configuration: Release Win32<br/> 265&gt;------ Build started: Project: P265, Configuration: Release Win32 <br/> 264&gt;Compiling...<br/> 265&gt;Compiling...<br/> 262&gt;Linking...<br/> (....)<br/> 264&gt;HoribaMDLT1300.obj : error LNK2019: unresolved external symbol &quot;public: void __thiscall CCDriver::LogString(int,char const *)&quot; (?LogString@CCDriver@@QAEXHPBD@Z) referenced in function &quot;private: int __thiscall CHoribaMDLT1300::InitDeviceLAN(void)&quot; (?InitDeviceLAN@CHoribaMDLT1300@@AAEHXZ)<br/> (.... more LNK2019 ....)<br/> 264&gt;HoribaMDLT1300.obj : error LNK2001: unresolved external symbol &quot;protected: virtual void __thiscall CCDriver::ResetErrorCodes(void)&quot; (?ResetErrorCodes@CCDriver@@MAEXXZ)<br/> (.... more LNK2001 ....)<br/> 264&gt;.\..\..\Release/CDHM13.dll : fatal error LNK1120: 69 unresolved externals<br/> 264&gt;Build log was saved at &quot;file://c:\.....\Release\BuildLog.htm&quot;<br/> 264&gt;CDHM13 - 71 error(s), 0 warning(s)<br/> 267&gt;Compiling...<br/> (....)<br/> ========== Build: 312 succeeded, 1 failed, 0 up-to-date, 0 skipped ===<br/> devenv.com returned Error code : 1<br/> ####<br/> <br/> The other time this happened in exactly the same manner for another project in another build two weeks earlier, where it was project build number 78.<br/> <br/> The linker commandline as shown in the GUI for these projects:<br/> (78)<br/> /OUT:&quot;.\..\..\Release/CDH900G.dll&quot; /INCREMENTAL:NO /NOLOGO <br/> /LIBPATH:&quot;C:\Programme\boost_library-1_34_1\vc8libs&quot; /DLL /MANIFEST <br/> /MANIFESTFILE:&quot;.\Release\CDH900G.dll.intermediate.manifest&quot; /DEBUG <br/> /PDB:&quot;.\..\..\Release/CDH900G.pdb&quot; /SUBSYSTEM:WINDOWS /BASE:&quot;0x49600000&quot;<br/> /IMPLIB:&quot;.\..\..\Release/CDH900G.lib&quot; /MACHINE:X86 /ERRORREPORT:PROMPT<br/> winmm.lib &quot;..\..\release\ttools.lib&quot; &quot;..\..\release\tdm.lib&quot; &quot;..\..\release\cd_driver.lib&quot;<br/> <br/> (264)<br/> /OUT:&quot;.\..\..\Release/CDHM13.dll&quot; /INCREMENTAL:NO /NOLOGO <br/> /LIBPATH:&quot;C:\Programme\boost_library-1_34_1\vc8libs&quot; /DLL /MANIFEST <br/> /MANIFESTFILE:&quot;.\Release\CDHM13.dll.intermediate.manifest&quot; /DEBUG <br/> /PDB:&quot;.\..\..\Release/CDHM13.pdb&quot; /SUBSYSTEM:WINDOWS /BASE:&quot;0x43000000&quot; <br/> /IMPLIB:&quot;.\..\..\Release/CDHM13.lib&quot; /MACHINE:X86 /ERRORREPORT:PROMPT <br/> Mpr.lib winmm.lib &quot;..\..\release\ttools.lib&quot; &quot;..\..\release\tdm.lib&quot; &quot;..\..\release\cd_driver.lib&quot;<br/>   <br/> As can be seen, the GUI tells me that the cd_driver.lib is correctly referenced.<br/> <br/> <br/> So ... anyone got any idea, why Visual Studio 2005 would rarely ignore linker dependencies and just spit out unresolved externals instead of linking the library?<br/> <br/> <br/> Note: I have found some references on the net that there are problems when there are transitive dependencies (ProjA &gt; ProjB &gt; ProjC) with MSBuild, but this is not the case here. We're not using MSBuild and the dependency is direct.<br/> <br/> cheers,<br/> Martin<br/>Mon, 16 Nov 2009 10:14:54 Z2009-11-25T12:51:44Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/d936e4b4-fe9c-457a-a8e9-44d63c400ac9http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/d936e4b4-fe9c-457a-a8e9-44d63c400ac9Mellonzzhttp://social.msdn.microsoft.com/Profile/en-US/?user=MellonzzVisual C++ syntax to managed code<p>I am trying to use the new COM client API which can be used for unmanaged and managed clients alike. The only documentation currently available through MSDN only gives examples in unmanaged VC++. The header file for the interface definition is UIAutomation.h. The following code declares a global pointer to an IUIAutomation interface, initialise COM, and create an instance of the CUIAutomation class and retrieve the IUIAutomation interface in the global pointer.</p> <pre lang=x-cpp>IUIAutomation * pAutomation; CoCreateInstance(__uuidof(CUIAutomation), NULL, CLSCTX_INPROC_SERVER, __uuidof(IUIAutomation), (void **)&amp;pAutomation); </pre> <p>However I want to use this native API with managed code (C# Windows form) for performance reasons (it's much faster than the managed API). I am not overly familiar with C++ syntax so the question is how does this translate into managed code (presumably I wouldn't be using a global pointer for a start). Sorry but I can't quite get my head around the relationship between the pointers interface and class.</p> <p>Any help greatly appreciated.<br/><br/>Melanie</p>Tue, 24 Nov 2009 19:37:42 Z2009-11-25T12:04:56Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/a3669b16-e1a2-44c3-940e-3d6cbf44bb88http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/a3669b16-e1a2-44c3-940e-3d6cbf44bb88JeffR2http://social.msdn.microsoft.com/Profile/en-US/?user=JeffR2Get remote server online from a service at bootI need to determine if a server is online at boot time (before login) from my messaging service, which runs as Local System on an XP computer. I have the name of the server, and I need to get WMI information off of that server (2003). <div><br/></div> <div>Can anyone help? I'm having trouble finding this answer. Thanks!</div>Tue, 24 Nov 2009 23:01:07 Z2009-11-25T12:03:23Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/0954ecba-0e3e-428b-99a2-ccd4b2705733http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/0954ecba-0e3e-428b-99a2-ccd4b2705733maxybosshttp://social.msdn.microsoft.com/Profile/en-US/?user=maxybossvc++ services using timeri have a service that is has been set to be able to interact with the desktop. It execute exe(appliaction) and watches an exe and determines if it is running by using timer in vc++ 1.1..its running .but mouse pointer move on window(appliaction) appliaction gets hangingSat, 21 Nov 2009 09:02:12 Z2009-11-25T11:41:33Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/043fbd38-30fc-4bd5-99e3-592862430515http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/043fbd38-30fc-4bd5-99e3-592862430515MichaelWojcikhttp://social.msdn.microsoft.com/Profile/en-US/?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-25T11:28:34Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/bd70fd09-e6dc-42df-8262-d2c0f42838c4http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/bd70fd09-e6dc-42df-8262-d2c0f42838c4Engineer Mahdihttp://social.msdn.microsoft.com/Profile/en-US/?user=Engineer%20Mahdierror: "This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem."Hi to all<br/> <br/> I use setup and deployment projects to publish my program.<br/> On the destination computer that doesn't have visual C++, firstly I install the <br/> .net Framework, and run the setup file. The setup process ran without any problem but the installed exe file doesn't work.<br/> It gives the error &quot;This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.&quot;.<br/> What's the problem?Tue, 17 Nov 2009 10:25:17 Z2009-11-25T20:40:55Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/d19efbc1-ab2d-4708-9720-abd52479181ahttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/d19efbc1-ab2d-4708-9720-abd52479181aKarmaflutehttp://social.msdn.microsoft.com/Profile/en-US/?user=KarmafluteLink dependencies automatically from the command line?<span class=Apple-style-span style="background-color:transparent;border-collapse:separate;color:#000000;font-family:'Times New Roman';font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span class=Apple-style-span style="color:#333333;font-family:'Lucida Grande',Verdana,Helvetica,Arial,sans-serif;font-size:13px;line-height:18px;white-space:pre-wrap">I'm trying to compile a program from the command line that uses the Win32 API command &quot;MessageBox&quot;. It compiles just fine using g++ but when I use Visual Studio's compiler it can't seem to resolve the external dependencies by itself.<br/> <br/> I tried:<br/> <br/> cl main.obj Util.obj /Fea.exe</span> </span> <br/> <span class=Apple-style-span style="background-color:transparent;border-collapse:separate;color:#000000;font-family:'Times New Roman';font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span class=Apple-style-span style="color:#333333;font-family:'Lucida Grande',Verdana,Helvetica,Arial,sans-serif;font-size:13px;line-height:18px;white-space:pre-wrap"> <br/> and<br/> <br/> link main.obj Util.obj /OUT:a.exe<br/> <br/> As well as trying to point to the User32 include and libpaths to cl and linker using /I and /LIBPATH.<br/> <br/> This is the error:<br/> <br/> main.obj : error LNK2019: unresolved external symbol __imp__MessageBoxA@16 referenced in function _main<br/> a.exe : fatal error LNK1120: 1 unresolved externals<br/> <br/> This can easily be fixed by including the library directly:<br/> <br/> cl main.obj Util.obj /Fea.exe /link User32.lib<br/> <br/> But I want the compiler to look at the libraries path and resolve the dependency automatically.<br/> <br/> I am using the command line that starts from the IDE so all of the paths and environment variables are correctly set.</span> </span>Mon, 16 Nov 2009 12:29:42 Z2009-11-25T10:54:13Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/191110c8-9695-47d3-808a-72ffb40a9966http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/191110c8-9695-47d3-808a-72ffb40a9966PaulH79http://social.msdn.microsoft.com/Profile/en-US/?user=PaulH79ATL Collection of non-trival objectsI would like to expose an ATL COM collection of CMainClass objects such that it can be accessed by a C#, VB, or C++ client.<br><br>I don't have a problem setting up the collection itself, but I don't know how to allow the COM clients access to classes A, B, and C. Should I make A, B, &amp; C COM objects with the ones containing a std::list&lt;&gt; each ATL collections in their own right? <br><br>Is there an easier way to do this?!?!<br><br>Thanks,<br>PaulH<br><br> <div style="border-right:#7f9db9 1px solid;border-top:#7f9db9 1px solid;font-size:11px;overflow:auto;border-left:#7f9db9 1px solid;line-height:100%! important;border-bottom:#7f9db9 1px solid;font-family:Courier New;background-color:white"> <table style="border-top-width:0px;border-left-width:0px;margin:2px 0px;width:99%;border-bottom:#eee 0px solid;border-collapse:collapse;background-color:#fff;border-right-width:0px" cellspacing=0 cellpadding=0> <colgroup> <col style="padding-left:10px;font-size:11px;border-bottom:#f7f7f7 1px solid;font-family:Courier New;white-space:nowrap"> <tbody> <tr> <td><font style="font-size:11px"></font><font style="color:blue">class</font><font style="font-size:11px"> C    </font></td></tr> <tr> <td style="background-color:#f7f7f7">{    </td></tr> <tr> <td></font><font style="color:blue">public</font><font style="font-size:11px">:    </font></td></tr> <tr> <td style="background-color:#f7f7f7">    </font><font style="color:green">// get/set functions...   </font><font style="font-size:11px"> </font></td></tr> <tr> <td>        </td></tr> <tr> <td style="background-color:#f7f7f7"></font><font style="color:blue">protected</font><font style="font-size:11px">:    </font></td></tr> <tr> <td>    std::</font><font style="color:blue">string</font><font style="font-size:11px"> str1_;    </font></td></tr> <tr> <td style="background-color:#f7f7f7">    std::list&lt; std::</font><font style="color:blue">string</font><font style="font-size:11px"> &gt; list1_;    </font></td></tr> <tr> <td>};    </td></tr> <tr> <td style="background-color:#f7f7f7">    </td></tr> <tr> <td></font><font style="color:blue">class</font><font style="font-size:11px"> A    </font></td></tr> <tr> <td style="background-color:#f7f7f7">{    </td></tr> <tr> <td></font><font style="color:blue">public</font><font style="font-size:11px">:    </font></td></tr> <tr> <td style="background-color:#f7f7f7">    </font><font style="color:green">// get/set functions...   </font><font style="font-size:11px"> </font></td></tr> <tr> <td>        </td></tr> <tr> <td style="background-color:#f7f7f7"></font><font style="color:blue">protected</font><font style="font-size:11px">:    </font></td></tr> <tr> <td>    std::list&lt; C &gt; list1_;    </td></tr> <tr> <td style="background-color:#f7f7f7">};    </td></tr> <tr> <td>    </td></tr> <tr> <td style="background-color:#f7f7f7"></font><font style="color:blue">class</font><font style="font-size:11px"> B    </font></td></tr> <tr> <td>{    </td></tr> <tr> <td style="background-color:#f7f7f7"></font><font style="color:blue">public</font><font style="font-size:11px">:    </font></td></tr> <tr> <td>    </font><font style="color:green">// get/set functions...   </font><font style="font-size:11px"> </font></td></tr> <tr> <td style="background-color:#f7f7f7">        </td></tr> <tr> <td></font><font style="color:blue">protected</font><font style="font-size:11px">:    </font></td></tr> <tr> <td style="background-color:#f7f7f7">    std::</font><font style="color:blue">string</font><font style="font-size:11px"> str1_;    </font></td></tr> <tr> <td>    std::</font><font style="color:blue">string</font><font style="font-size:11px"> str2_;    </font></td></tr> <tr> <td style="background-color:#f7f7f7">};    </td></tr> <tr> <td>    </td></tr> <tr> <td style="background-color:#f7f7f7"></font><font style="color:blue">class</font><font style="font-size:11px"> CMainClass    </font></td></tr> <tr> <td>{    </td></tr> <tr> <td style="background-color:#f7f7f7"></font><font style="color:blue">public</font><font style="font-size:11px">:     </font></td></tr> <tr> <td>    </font><font style="color:blue">void</font><font style="font-size:11px"> GetA( A* a ) </font><font style="color:blue">const</font><font style="font-size:11px">;    </font></td></tr> <tr> <td style="background-color:#f7f7f7">    </font><font style="color:blue">void</font><font style="font-size:11px"> SetA( </font><font style="color:blue">const</font><font style="font-size:11px"> A&amp; a );    </font></td></tr> <tr> <td>    </font><font style="color:blue">void</font><font style="font-size:11px"> GetB( B* b ) </font><font style="color:blue">const</font><font style="font-size:11px">;    </font></td></tr> <tr> <td style="background-color:#f7f7f7">    </font><font style="color:blue">void</font><font style="font-size:11px"> SetB( </font><font style="color:blue">const</font><font style="font-size:11px"> B&amp; b );    </font></td></tr> <tr> <td>        </td></tr> <tr> <td style="background-color:#f7f7f7"></font><font style="color:blue">protected</font><font style="font-size:11px">:    </font></td></tr> <tr> <td>    A a_;    </td></tr> <tr> <td style="background-color:#f7f7f7">    B b_;    </td></tr> <tr> <td>};    </td></tr> <tr> <td style="background-color:#f7f7f7"> </td></tr></tbody></table></div>Thu, 19 Feb 2009 19:07:36 Z2009-11-25T10:51:03Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/10969f64-7576-4492-ad48-fc390b09cf82http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/10969f64-7576-4492-ad48-fc390b09cf82cricri-larsonhttp://social.msdn.microsoft.com/Profile/en-US/?user=cricri-larsonHow to create an independant .exe application in Visual C++ ?<p>Hi</p> <p>I'm using Visual C++ 2008 and I'm working on an MFC application using the &quot;Debug&quot; configuration on a win32 platform.<br/>I'm struggling to create a .exe application which is able to work independantly, on computers which don't have Visual Studio 2008.<br/>Is it possible to create an independant .exe file and how would I go about doing this? Or do I have to install Visual Studio on all the computers to be able to run the application?</p> <p>Thanks,<br/><br/>Christophe</p>Tue, 24 Nov 2009 13:33:49 Z2009-11-25T10:25:26Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/6d44d4d2-72b8-426b-bae4-ca17a0bd7e37http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/6d44d4d2-72b8-426b-bae4-ca17a0bd7e37RITESH_SHINDEhttp://social.msdn.microsoft.com/Profile/en-US/?user=RITESH_SHINDEHow to destroy SafeArrayHello every one;<br/> <br/> I have created the safearray in the COM component and i want to destroy it in the client code that is  in the VB.net code so how can i destroy the safearray in the client code which is created in the com dll.<br/> <br/> Thanks in advance.<br/><hr class="sig">Logic is my Greatest Asset !Wed, 18 Nov 2009 08:01:13 Z2009-11-25T10:12:10Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/8512e517-3cd1-4b16-894d-f19953459d5fhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/8512e517-3cd1-4b16-894d-f19953459d5fPhil Atkinhttp://social.msdn.microsoft.com/Profile/en-US/?user=Phil%20AtkinMDA 'LoaderLock' report unreliable?I have a managed (C#) app calling a mixed (managed/unmanaged) class library written in C++, which in turn is calling methods on an in-process COM object, which loads a DLL. <div>All is fine until, in response to a mouse click, I call a method on the COM object that causes it to call FreeLibrary on the bottom-level DLL.  During the execution of FreeLibrary, I get an MDA 'LoaderLock' pop up.  The additional information provided says &quot;Attempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a DllMain or image initialization function since doing so can cause the application to hang&quot;.  Since the DLL is a 'plain C' DLL, and pre-dates .Net, I do not think it likely that it could be trying to run any managed code (the call stack and stepping through the disassembly tends to support my view).</div> <div><br/></div> <div>Is it possible that the debugging assistant is detecting some <em>other </em>'not recommended' behaviour of the DLL as it executes DllMain, but is misreporting it as an attempt to execute managed code?</div>Thu, 05 Nov 2009 17:36:09 Z2009-11-25T10:03:53Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/f95edb8a-2170-4ee0-b7bc-17cf466cc814http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/f95edb8a-2170-4ee0-b7bc-17cf466cc814LMD1986http://social.msdn.microsoft.com/Profile/en-US/?user=LMD1986tab order for dynamically added activeX controls in VC++How to add tab order for the controls which have been created dynamically.....Wed, 25 Nov 2009 09:17:45 Z2009-11-25T09:35:06Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/f63b5451-3af1-4d92-8e62-96298c8886a7http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/f63b5451-3af1-4d92-8e62-96298c8886a7teaburgerhttp://social.msdn.microsoft.com/Profile/en-US/?user=teaburgerGetClientRect includes status bar areaHello,<br/> <br/> For some reason whenever I call GetClientRect it appears to include the status bar area.  I am creating it with the default flags, and one of the panels is owner-drawn.  I can't figure out why this keeps happening!Tue, 24 Nov 2009 23:58:06 Z2009-11-25T09:32:58Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/2b6b8c16-58e5-4efc-bad1-dbc2a270647ahttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/2b6b8c16-58e5-4efc-bad1-dbc2a270647aGary.Gaohttp://social.msdn.microsoft.com/Profile/en-US/?user=Gary.GaoBug Report:ITextServices::Release() doesn't effect.That causes memory leaking.I do call ITextServices::Release() to release that reference. But the allocated memory isn't released. I got following stack trace by &quot;!heap -p -a&quot; in Windbg after ITextServices::Release() is called. <br/> Or, who can tell me what is the offical steps to release ITextServices correctly?<br/> That issue block my work. Anybody could help me? Thanks in advance.<br/> <br/> <pre>0:001&gt; !heap -p -a 027b5360 address 027b5360 found in _HEAP @ 150000 HEAP_ENTRY Size Prev Flags UserPtr UserSize - state 027b5360 0013 0000 [07] 027b5368 00080 - (busy) Trace: 02fb 7c98ee72 ntdll!RtlDebugAllocateHeap+0x000000e1 7c96b3a2 ntdll!RtlAllocateHeapSlowly+0x00000044 7c93aa2b ntdll!RtlAllocateHeap+0x00000e64 7c8099ef kernel32!LocalAlloc+0x00000058 74de8f78 RICHED20!CW32System::PvReAlloc+0x00000026 74d9577c RICHED20!CArrayBase::ArAdd+0x00000040 74d957d1 RICHED20!CArrayBase::ArInsert+0x0000001a 74da426c RICHED20!CTxtArray::AddBlock+0x0000001c 74dd90d6 RICHED20!CTxtPtr::InsertRange+0x00000034 74dd99bf RICHED20!CTxtPtr::ReplaceRange+0x00000110 74dcb3a6 RICHED20!CRchTxtPtr::ReplaceRange+0x0000039c 74da7b24 RICHED20!CTxtEdit::SetRichDocEndEOP+0x00000041 74daa42f RICHED20!CTxtEdit::Init+0x000003be 74ddd88a RICHED20!CreateTextServices+0x000000a0 *** WARNING: Unable to verify checksum for d:\Build\BooguNT\BooguNote_2009_11_22_datime\BooguNote\Debug\BooguNote.exe 4b7b40 BooguNote!CBooguNoteText::Init+0x00000260 4bd4ad BooguNote!CreateHost+0x000000fd 4bd5f2 BooguNote!CreateTextControl+0x00000062 4cb745 BooguNote!CBooguNoteView::CreateTextBlock+0x00000085 4bf801 BooguNote!CBooguNoteView::LoadData+0x00000141 4bea3b BooguNote!CBooguNoteView::OpenFile+0x0000002b 4beb5e BooguNote!CBooguNoteView::OnCreate+0x0000008e 4e7790 BooguNote!CBooguNoteView::ProcessWindowMessage+0x000000a0 4a786a BooguNote!ATL::CWindowImplBaseT&lt;ATL::CWindow,ATL::CWinTraits&lt;1442840576,0&gt; &gt;::WindowProc+0x0000007a 77d18734 USER32!InternalCallWinProc+0x00000028 77d18816 USER32!UserCallWinProcCheckWow+0x00000150 77d1b4c0 USER32!DispatchClientMessage+0x000000a3 77d1f9fe USER32!__fnINLPCREATESTRUCT+0x0000008b 7c92e473 ntdll!KiUserCallbackDispatcher+0x00000013 77d1fecc USER32!_CreateWindowEx+0x000001ed 77d1fc58 USER32!CreateWindowExW+0x00000033 4aa5f2 BooguNote!ATL::CWindowImplBaseT&lt;ATL::CWindow,ATL::CWinTraits&lt;1442840576,0&gt; &gt;::Create+0x00000122 4f0e29 BooguNote!ATL::CWindowImpl&lt;CBooguNoteView,ATL::CWindow,ATL::CWinTraits&lt;1442840576,0&gt; &gt;::Create+0x000000a9 </pre> <pre>:001&gt; !heap -p -a 027b53f8 address 027b53f8 found in _HEAP @ 150000 HEAP_ENTRY Size Prev Flags UserPtr UserSize - state 027b53f8 0008 0000 [07] 027b5400 00028 - (busy) Trace: 02fe 7c98ee72 ntdll!RtlDebugAllocateHeap+0x000000e1 7c96b3a2 ntdll!RtlAllocateHeapSlowly+0x00000044 7c93aa2b ntdll!RtlAllocateHeap+0x00000e64 7c8099ef kernel32!LocalAlloc+0x00000058 74d919fb RICHED20!CW32System::PvAlloc+0x00000011 74d919e3 RICHED20!operator new+0x0000000f 74dde615 RICHED20!CTxtEdit::GetDocInfo+0x00000013 74ddd7e1 RICHED20!CTxtEdit::TxSetText+0x0000001b 4b7bc5 BooguNote!CBooguNoteText::Init+0x000002e5 4bd4ad BooguNote!CreateHost+0x000000fd 4bd5f2 BooguNote!CreateTextControl+0x00000062 4cb745 BooguNote!CBooguNoteView::CreateTextBlock+0x00000085 4bf801 BooguNote!CBooguNoteView::LoadData+0x00000141 4bea3b BooguNote!CBooguNoteView::OpenFile+0x0000002b 4beb5e BooguNote!CBooguNoteView::OnCreate+0x0000008e 4e7790 BooguNote!CBooguNoteView::ProcessWindowMessage+0x000000a0 4a786a BooguNote!ATL::CWindowImplBaseT&lt;ATL::CWindow,ATL::CWinTraits&lt;1442840576,0&gt; &gt;::WindowProc+0x0000007a 77d18734 USER32!InternalCallWinProc+0x00000028 77d18816 USER32!UserCallWinProcCheckWow+0x00000150 77d1b4c0 USER32!DispatchClientMessage+0x000000a3 77d1f9fe USER32!__fnINLPCREATESTRUCT+0x0000008b 7c92e473 ntdll!KiUserCallbackDispatcher+0x00000013 77d1fecc USER32!_CreateWindowEx+0x000001ed 77d1fc58 USER32!CreateWindowExW+0x00000033 4aa5f2 BooguNote!ATL::CWindowImplBaseT&lt;ATL::CWindow,ATL::CWinTraits&lt;1442840576,0&gt; &gt;::Create+0x00000122 4f0e29 BooguNote!ATL::CWindowImpl&lt;CBooguNoteView,ATL::CWindow,ATL::CWinTraits&lt;1442840576,0&gt; &gt;::Create+0x000000a9 4ef8d8 BooguNote!CMainFrame::OpenFileByName+0x00000158 4e900c BooguNote!CMainFrame::OnDropFiles+0x0000013c 4e10b7 BooguNote!CMainFrame::ProcessWindowMessage+0x000003a7 5166ca BooguNote!ATL::CWindowImplBaseT&lt;ATL::CWindow,ATL::CWinTraits&lt;114229248,262400&gt; &gt;::WindowProc+0x0000007a 77d18734 USER32!InternalCallWinProc+0x00000028 77d18816 USER32!UserCallWinProcCheckWow+0x00000150</pre> <pre>0:001&gt; !heap -p -a 027b5438 address 027b5438 found in _HEAP @ 150000 HEAP_ENTRY Size Prev Flags UserPtr UserSize - state 027b5438 001b 0000 [07] 027b5440 000c0 - (busy) Trace: 02ff 7c98ee72 ntdll!RtlDebugAllocateHeap+0x000000e1 7c96b3a2 ntdll!RtlAllocateHeapSlowly+0x00000044 7c93aa2b ntdll!RtlAllocateHeap+0x00000e64 7c8099ef kernel32!LocalAlloc+0x00000058 74de8f78 RICHED20!CW32System::PvReAlloc+0x00000026 74d9577c RICHED20!CArrayBase::ArAdd+0x00000040 74da202d RICHED20!CDisplayML::RecalcLines+0x000000a3 74da2ba2 RICHED20!CDisplayML::RecalcView+0x00000033 74d9ee4e RICHED20!CDisplay::RecalcView+0x00000029 74ddb211 RICHED20!CTxtEdit::OnTxInPlaceActivate+0x00000066 4b7c7c BooguNote!CBooguNoteText::Init+0x0000039c 4bd4ad BooguNote!CreateHost+0x000000fd 4bd5f2 BooguNote!CreateTextControl+0x00000062 4cb745 BooguNote!CBooguNoteView::CreateTextBlock+0x00000085 4bf801 BooguNote!CBooguNoteView::LoadData+0x00000141 4bea3b BooguNote!CBooguNoteView::OpenFile+0x0000002b 4beb5e BooguNote!CBooguNoteView::OnCreate+0x0000008e 4e7790 BooguNote!CBooguNoteView::ProcessWindowMessage+0x000000a0 4a786a BooguNote!ATL::CWindowImplBaseT&lt;ATL::CWindow,ATL::CWinTraits&lt;1442840576,0&gt; &gt;::WindowProc+0x0000007a 77d18734 USER32!InternalCallWinProc+0x00000028 77d18816 USER32!UserCallWinProcCheckWow+0x00000150 77d1b4c0 USER32!DispatchClientMessage+0x000000a3 77d1f9fe USER32!__fnINLPCREATESTRUCT+0x0000008b 7c92e473 ntdll!KiUserCallbackDispatcher+0x00000013 77d1fecc USER32!_CreateWindowEx+0x000001ed 77d1fc58 USER32!CreateWindowExW+0x00000033 4aa5f2 BooguNote!ATL::CWindowImplBaseT&lt;ATL::CWindow,ATL::CWinTraits&lt;1442840576,0&gt; &gt;::Create+0x00000122 4f0e29 BooguNote!ATL::CWindowImpl&lt;CBooguNoteView,ATL::CWindow,ATL::CWinTraits&lt;1442840576,0&gt; &gt;::Create+0x000000a9 4ef8d8 BooguNote!CMainFrame::OpenFileByName+0x00000158 4e900c BooguNote!CMainFrame::OnDropFiles+0x0000013c 4e10b7 BooguNote!CMainFrame::ProcessWindowMessage+0x000003a7 5166ca BooguNote!ATL::CWindowImplBaseT&lt;ATL::CWindow,ATL::CWinTraits&lt;114229248,262400&gt; &gt;::WindowProc+0x0000007a </pre> <br/>Sun, 22 Nov 2009 15:13:05 Z2009-11-25T09:26:15Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/271432a4-3371-4d6b-b66d-21ea27f84028http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/271432a4-3371-4d6b-b66d-21ea27f84028cpzaohttp://social.msdn.microsoft.com/Profile/en-US/?user=cpzaocreating an array of BitArray in visual C++hi,<br/> <br/> I would like to create an array of BitArrays. Basically I need an array of 12 BitArrays with 32 bits each.<br/> <br/> I know I could try to do this by declaring a matrix of bools but it is not as elegant.<br/> <br/> Normally I declare a BitArray like this:<br/> <br/> <pre>BitArray^ array1;</pre> and I allocate room for it by doing something like this<br/> <br/> <pre>array1 = gcnew BitArray(NoOfBits);</pre> How do I declare an array of bitArrays and how do I access it afterwards? Is this even possible?<br/> <br/> Best regards<br/> <br/> CThu, 19 Nov 2009 15:48:49 Z2009-11-25T09:08:09Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/d19f4a4c-bf3c-4425-bbe2-9bbc94029d07http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/d19f4a4c-bf3c-4425-bbe2-9bbc94029d07Vegan Fanatichttp://social.msdn.microsoft.com/Profile/en-US/?user=Vegan%20FanaticChange Filenames to all lower caseAnybody have any code to rename every file in a directory to all lowercase so that file associations work properly.<br/> <br/> I have some files restored from DVD that are all uppercase and they do not work until I rename the extensions etc.<br/><hr class="sig">Vote if answered or helpful, I am running for Office (joke)! <a href="http://contract-developer.dyndns.biz">IT/Developer, Windows/Linux/Mainframe</a> <p><b>Server:</b> P4-2GHz, 1.5 GB RAM, Linux Server, need IDE/SATA disks for my <a href="http://computer-chess.dyndns.biz">chess site</a></p> <b>Workstation:</b> Asus M2NBP-VM CSM, Athlon64 X2 4200+ 65W CPU, 2GB RAM, NVIDIA 8600GT, 320GB + 160G backup, Windows 7 Ultimate x64.Mon, 23 Nov 2009 23:08:01 Z2009-11-25T21:00:54Zhttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/ca381c3d-157c-49e0-a902-f5618b0755cahttp://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/ca381c3d-157c-49e0-a902-f5618b0755caVyasahttp://social.msdn.microsoft.com/Profile/en-US/?user=VyasaHow to create a MFC project in Visual C++ 2010 express edition.Hello Guys, <div><br/></div> <div>I have downloaded Visual C++ 2010 express edition and installed it in my PC . Now i don't know how to create a MFC Dialog based application in this . Please help me...</div> <div><br/></div> <div>Thanks</div>Wed, 25 Nov 2009 06:20:34 Z2009-11-25T08:30:58Z