Visual C++ Language フォーラムIssues regarding the C++ language, compiler, and linker. This forum covers all standardized languages, extensions, and interop technologies supported by Visual C++.© 2009 Microsoft Corporation. All rights reserved.Sat, 28 Nov 2009 07:52:15 Z5ac7f30f-4625-4162-bdbb-2416a72b7047http://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/4a2cf062-83aa-4307-96de-43c36d86cb74http://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/4a2cf062-83aa-4307-96de-43c36d86cb74KARTHIKA ARUhttp://social.msdn.microsoft.com/Profile/ja-JP/?user=KARTHIKA%20ARUC PROGRAMHOW TO USE A LETTER S FOR SCANF IN #DEFINE PREPOSSEROR DIRECTIVESat, 28 Nov 2009 07:52:14 Z2009-11-28T07:52:15Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/16089dbc-d994-47ce-94f4-6561b1050999http://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/16089dbc-d994-47ce-94f4-6561b1050999胡小林http://social.msdn.microsoft.com/Profile/ja-JP/?user=%u80e1%u5c0f%u6797yhh gfdgdSat, 28 Nov 2009 06:32:41 Z2009-11-28T06:32:42Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/e58ddab0-0b21-4dbe-96c0-22cb4123fcfehttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/e58ddab0-0b21-4dbe-96c0-22cb4123fcfeShiv1983http://social.msdn.microsoft.com/Profile/ja-JP/?user=Shiv1983Need a similar interface audiovideoplayback in unmanage codehi,<br/><br/>audiovideoplayback namespace of directX is available in manage code to handle audio and video.<br/>it have two class Audio and Video. So if you want to handle video volume then get object of audio class from video object and use it.<br/><br/><br/>But i am unable to find this type of API (AudioVideoPlayBack) in unmanage directX.<br/><br/>I want to control to play two video file in two diffrent different speaker (Left and Right).<br/><br/>Sat, 28 Nov 2009 06:15:48 Z2009-11-28T06:15:48Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/ee459d39-733f-4e2d-8d52-bbc3e35dac4dhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/ee459d39-733f-4e2d-8d52-bbc3e35dac4dLilProblemshttp://social.msdn.microsoft.com/Profile/ja-JP/?user=LilProblemshelp with classesI am having issues writing the code for a plasma pistol for my C++ class I keep getting this error:<br/> error C3867: 'plasmaPistolClass::pressTrigger': function call missing argument list; use '&amp;plasmaPistolClass::pressTrigger' to create a pointer to member <br/>The problem is we have not learned pointers yet so I am not sure what to do Here is my code that I have: <pre lang=x-cpp>int main() { plasmaPistolClass oldPistol; plasmaPistolClass newPistol(7,75); cout &lt;&lt; &quot;Firing Old pistol&quot; &lt;&lt; endl; oldPistol.pressTrigger; //this is where my error is system(&quot;pause&quot;); return 0; }</pre> I would so much appreciate any help I can get with this Thank youSat, 28 Nov 2009 04:08:53 Z2009-11-28T05:08:08Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/239cb18f-5ae4-462e-bad3-ff50cdd3c275http://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/239cb18f-5ae4-462e-bad3-ff50cdd3c275Nano HEhttp://social.msdn.microsoft.com/Profile/ja-JP/?user=Nano%20HEC++ and C# COM Event Performance. Help.<p>Hi All,</p> <p>Good day.</p> <p>My CppApp and CsApp Event Handle Design Changed. <br/>It is for Industry automatically control application.</p> <p>Old design.</p> <p>CsApp pull event from CppApp. There are a lot of events from CppApp. So we created two threads in CsApp to handle the events from CppApp. It worked very well.</p> <p>New design.</p> <p>CsApp and CppApp com event (fire event method) design instead of the push/pull event method. Only one pointer in Cpp IDL file created, but it could still handle two fire events function, we didn't change the CppApp event related part code. That means One Com Event Channel between CppApp and CsApp now.</p> <p>Test Result. We tested and it on simulation mode and it worked very well. But there is not enough real machine online testing till now. Specially there where be a lot of event at industry online production envrionment.<br/>We worry about if there is some Com Event Sending from CppApp to CsApp delay.</p> <p>Is there any resource which i could research about Com Event performance for industry application?</p> <p><br/>Pre Posted about my project: <br/><span>Com Event Fire Event Question.</span><br/><a href="http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/00c8a97b-bb9f-48da-a0fb-59d02800513f">http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/00c8a97b-bb9f-48da-a0fb-59d02800513f</a><br/><br/><br/><br/>Thanks a lot in advance here.</p> <p>BR! Nano</p><hr class="sig">// Newbie with OS: Windows XP Pro SP3 IDE: VS2005 Pro &amp; .NET: V2.0 and V3.0.V3.5 installed too.Sat, 28 Nov 2009 02:47:55 Z2009-11-28T02:47:56Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/23ef740b-ea9d-4908-b4a4-7d5e5f93e4c2http://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/23ef740b-ea9d-4908-b4a4-7d5e5f93e4c2miclushttp://social.msdn.microsoft.com/Profile/ja-JP/?user=miclusIssues modifying system in Windows 7Hi.  In my program, sometimes it has to execute an external process to update the program.  Also, it sometimes has to save some registry settings.  Well, in Windows 7, it can't execute the process or save any registry settings unless I run it as administrator.  So, my questions are<br/><br/>1.  Why when I tell it to require administrator in my manifest file do I still have to right-click and select run as admin?<br/><br/>2.  How do other programs that I install in Windows 7 seem to be able to modify the registry and execute external processes without any problem, even though I don't tell those programs to run as administrator (for example, my antivirus program)?<br/>Fri, 27 Nov 2009 08:32:59 Z2009-11-28T01:39:50Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/a6811087-18b8-43a0-830d-7e88970e004ehttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/a6811087-18b8-43a0-830d-7e88970e004emiclushttp://social.msdn.microsoft.com/Profile/ja-JP/?user=miclusWindows 7 WoesMy posts keep getting deleted for some reason.  But, basically, I am wondering why my program has to be run as administrator to modify the registry or shell execute another process, even when my manifest says to require administrator?<br/><br/>What I don't get is, why do other programs I install seem to be able to save to the registry and spawn other processes without me saying to run as admin.  How do they do it?Fri, 27 Nov 2009 18:08:42 Z2009-11-27T23:15:10Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/5ca20291-66d4-41df-927b-81a2cc35b026http://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/5ca20291-66d4-41df-927b-81a2cc35b026carl89_Phttp://social.msdn.microsoft.com/Profile/ja-JP/?user=carl89_PNeed help with arrayI have code which is working well but need to do the same thing with array so please help<br/> <pre lang=x-cpp>#include&lt;iostream&gt; using namespace std; int fibonacci(int n) { if (n == 1 || n == 2 || n==3) { return 1; } else { return fibonacci(n-3)+fibonacci(n-2)+fibonacci(n-1); } } void print(int J) { cout&lt;&lt;J&lt;&lt;endl; } int main() { int J; cin&gt;&gt;J; fibonacci(J); print(fibonacci(J)); return 0; }</pre>Thu, 26 Nov 2009 03:49:51 Z2009-11-27T22:33:03Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/7eed3a60-4c6d-4454-bff4-df850beedbd6http://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/7eed3a60-4c6d-4454-bff4-df850beedbd6Regnwaldhttp://social.msdn.microsoft.com/Profile/ja-JP/?user=RegnwaldMy first ASM in 30 years and it goes wrong of course!<span lang=EN-AU><span lang=EN-AU> <p>I haven’t tried ASM for over 30 years so perhaps I should expect a problem or two. It seems ASM cannot be used in managed code so I put the ASM in an ATL DLL and called it from a button on a VB form to invert an image. I have much more complicated conversions in mind that really nee the speed of ASM. In my experience the form designer of C++ is sometimes faulty. Everything seemed OK – no errors indicated in the VB, the DLL or the ASM. The VB call to the DLL returns true so the ProcID is correctly read but there is no effect on the image and no crash. Is there a managed/unmanaged code issue or have I done something silly with the pointer? Is my loop/label wrong? I can’t see the problem (but then at 72, 'insight’ is not at its best).<br/>Regards<br/>Ron <br/><br/>In the VB prog<br/><span style="color:#0000ff"><br/>Public</span> <span style="color:#0000ff">Class</span> <span style="color:#008080">Form1<br/></span><span style="color:#0000ff"><br/>Public</span> <span style="color:#0000ff">Declare</span> <span style="color:#0000ff">Function</span> ProcImage <span style="color:#0000ff">Lib</span> <span style="color:#800000">&quot;c:\CODE TEST\_<br/>     TestVBAsmCppDll\debug\TestCppAtlDllAsm.dll&quot;</span> (<span style="color:#0000ff">ByVal</span> ProcID <span style="color:#0000ff">As</span> <span style="color:#008080">Int32</span>, <span style="color:#0000ff">ByVal_<br/></span>     StartAddr <span style="color:#0000ff">As</span> <span style="color:#008080">IntPtr</span>, <span style="color:#0000ff">ByVal</span> Nbytes <span style="color:#0000ff">As</span> <span style="color:#008080">Int32</span>) <span style="color:#0000ff">As</span> <span style="color:#0000ff">Boolean<br/></span><span style="color:#0000ff"><span style="color:#800000">     <br/>     </span>Public</span> <span style="color:#0000ff">Const</span> ProcIDNull <span style="color:#0000ff">As</span> <span style="color:#0000ff">Integer</span> = <span style="color:#800000">0<br/>     </span><span style="color:#0000ff">Public</span> <span style="color:#0000ff">Const</span> ProcIDBiasR <span style="color:#0000ff">As</span> <span style="color:#0000ff">Integer</span> = <span style="color:#800000">1<br/>     </span><span style="color:#0000ff">Public</span> <span style="color:#0000ff">Const</span> ProcIDInv <span style="color:#0000ff">As</span> <span style="color:#0000ff">Integer</span> = <span style="color:#800000">9<br/>     </span><span style="color:#0000ff">Public</span> ProcID <span style="color:#0000ff">As</span> <span style="color:#008080">Int32<br/></span><span style="color:#0000ff"><span style="color:#800000">     </span>Public</span> StartAddr <span style="color:#0000ff">As</span> <span style="color:#008080">IntPtr<br/></span><span style="color:#0000ff"><span style="color:#800000">     </span>Public</span> Nbytes <span style="color:#0000ff">As</span> <span style="color:#008080">Int32<br/></span><span style="color:#0000ff"><br/><span style="color:#800000">     </span>Public</span> bmp1 <span style="color:#0000ff">As</span> <span style="color:#008080">Bitmap ''A global object is unaffected by GC<br/></span><span style="color:#0000ff"><span style="color:#800000">     </span>Private</span> <span style="color:#0000ff">Sub</span> Form1_Load(<span style="color:#0000ff">ByVal</span> sender <span style="color:#0000ff">As</span> System.<span style="color:#008080">Object</span>, <span style="color:#0000ff">ByVal</span> e <span style="color:#0000ff">As_</span> System.<span style="color:#008080">EventArgs</span>) _<br/><span style="color:#0000ff"><span style="color:#800000">               </span>Handles</span> <span style="color:#0000ff">MyBase</span>.Load<br/><span style="color:#0000ff"><br/><span style="color:#800000">     </span>Dim</span> ofd <span style="color:#0000ff">As</span> <span style="color:#0000ff">New</span> <span style="color:#008080">OpenFileDialog<br/></span><span style="color:#800000">     </span>ofd.ShowDialog(<span style="color:#0000ff">Me</span>)<br/><span style="color:#0000ff"><span style="color:#800000">     </span>If</span> ofd.FileName &lt;&gt; <span style="color:#800000">&quot;&quot;</span> <span style="color:#0000ff">Then<br/></span><span style="color:#800000">          </span>PictureBox1.Load(ofd.FileName)<br/><span style="color:#800000">          </span>bmp1 = PictureBox1.Image<br/><span style="color:#800000">          </span>Nbytes = bmp1.Width * bmp1.Height * <span style="color:#800000">3</span> - <span style="color:#800000">1<br/>          </span><span style="color:#0000ff">Dim</span> bmpData <span style="color:#0000ff">As</span> System.Drawing.Imaging.<span style="color:#008080">BitmapData<br/></span><span style="color:#0000ff"><span style="color:#800000">          </span>Dim</span> rect <span style="color:#0000ff">As</span> <span style="color:#0000ff">New</span> <span style="color:#008080">Rectangle</span>(<span style="color:#800000">0</span>, <span style="color:#800000">0</span>, bmp1.Width, bmp1.Height)<br/><span style="color:#800000">          </span>bmpData = bmp1.LockBits(rect,_ Drawing.Imaging.<span style="color:#008080">ImageLockMode</span>.ReadWrite,_<br/><span style="color:#800000">                    </span>bmp1.PixelFormat)<br/><span style="color:#800000">          </span>StartAddr = bmpData.Scan0 <br/><span style="color:#800000">                    </span>''Address of bitmap data (to be changed by dll method)<br/><span style="color:#800000">          </span>bmp1.UnlockBits(bmpData)<br/><span style="color:#0000ff"><span style="color:#800000">     </span>End</span> <span style="color:#0000ff">If<br/></span><span style="color:#0000ff">End</span> <span style="color:#0000ff">Sub<br/></span><span style="color:#0000ff"><br/>Private</span> <span style="color:#0000ff">Sub</span> Button2_Click(<span style="color:#0000ff">ByVal</span> sender <span style="color:#0000ff">As</span> System.<span style="color:#008080">Object</span>, <span style="color:#0000ff">ByVal</span> e <span style="color:#0000ff">As</span> System.<span style="color:#008080">EventArgs</span>)_<br/><span style="color:#0000ff"><span style="color:#800000">          </span>Handles</span> Button2.Click<br/><span style="color:#800000">     </span>''To make call to dll<br/><span style="color:#0000ff"><br/><span style="color:#800000">     </span>Dim</span> res <span style="color:#0000ff">As</span> <span style="color:#0000ff">Boolean</span> = <span style="color:#0000ff">False<br/></span><span style="color:#800000">     </span>res = ProcImage(ProcIDInv, StartAddr, Nbytes)<br/><span style="color:#0000ff"><span style="color:#800000">     </span>If</span> res = <span style="color:#0000ff">True</span> <span style="color:#0000ff">Then<br/></span><span style="color:#800000">          </span>TextBox2.Text = Str(StartAddr.ToInt32)<br/><span style="color:#008000"><span style="color:#800000">               </span>'The call returns true so ProcIDInv was correctly received by DLL<br/></span><span style="color:#008000"><span style="color:#800000">               </span>''However, BMP1 is unaffected<br/></span><span style="color:#0000ff"><span style="color:#800000">     </span>Else<br/></span><span style="color:#800000">          </span>TextBox2.Text = <span style="color:#800000">&quot;&quot;<br/>     </span><span style="color:#0000ff">End</span> <span style="color:#0000ff">If<br/></span><span style="color:#800000">     <br/>     </span>PictureBox1.Image = bmp1<br/><span style="color:#800000">     </span>PictureBox1.Refresh()<br/><span style="color:#0000ff">End</span> <span style="color:#0000ff">Sub<br/></span>End Class<br/><br/>In the ATL DLL:<br/><span style="color:#0000ff"><br/>extern</span> <span style="color:#800000">&quot;C&quot;</span> BOOL <span style="color:#0000ff">__stdcall</span> ProcImage(<span style="color:#0000ff">int</span> ProcID, <span style="color:#0000ff">int</span> StartAddr, <span style="color:#0000ff">int</span> Nbytes )<br/>{<br/><span style="color:#0000ff"><span style="color:#800000">     </span>int</span> <span style="color:#0000ff">const</span> ProcIDNull = <span style="color:#800000">0</span>;<br/><span style="color:#0000ff"><span style="color:#800000">     </span>int</span> <span style="color:#0000ff">const</span> ProcIDBiasR = <span style="color:#800000">1</span>;<br/><span style="color:#0000ff"><span style="color:#800000">     </span>int</span> <span style="color:#0000ff">const</span> ProcIDInv = <span style="color:#800000">9</span>;<span style="color:#008000">/* Selected in VB )*/<br/></span><span style="color:#0000ff"><span style="color:#800000">     <br/>     </span>switch</span> (ProcID)<br/><span style="color:#800000">     </span>{<br/><span style="color:#0000ff"><span style="color:#800000">          </span>case</span> ProcIDNull: ;<br/><span style="color:#008000"><span style="color:#800000">               </span>/*Null entry warning*/<br/></span><span style="color:#0000ff"><span style="color:#800000">               </span>return</span> <span style="color:#0000ff">false</span>;<br/><span style="color:#0000ff"><span style="color:#800000">               </span>break</span>;<br/><span style="color:#0000ff"><span style="color:#800000">          </span>case</span> ProcIDBiasR: ;<br/><span style="color:#008000"><span style="color:#800000">               </span>/*Not used*/<br/></span><span style="color:#0000ff"><span style="color:#800000">               </span>return</span> <span style="color:#0000ff">false</span>;<br/><span style="color:#0000ff"><span style="color:#800000">               </span>break</span>;<br/><span style="color:#0000ff"><span style="color:#800000">          </span>case</span> ProcIDInv: ;<br/><span style="color:#008000"><span style="color:#800000">               </span>/*INVERT*/<br/></span><span style="color:#0000ff"><span style="color:#800000">               </span>_asm<br/></span><span style="color:#800000">               </span>{<br/><span style="color:#800000">                    </span>push ebx;<span style="color:#800000">               </span> preserve <span style="color:#0000ff">register<br/></span><span style="color:#800000">                    </span>mov ebx,Nbytes; <span style="color:#800000">     </span>enter loop size<br/>loopInv:<br/><span style="color:#800000">                    </span>not [StartAddr]; <span style="color:#800000">      </span>invert the byte (pixel colour)<br/><span style="color:#800000">                    </span>inc StartAddr; <span style="color:#800000">         </span>move to next byte<br/><span style="color:#800000">                    </span>dec ebx; <span style="color:#800000">                 </span>count down byte<br/><span style="color:#800000">                    </span>jnz loopInv; <span style="color:#800000">            </span><span style="color:#0000ff">if</span> count is not zero repeat<br/><span style="color:#800000">                    </span>pop ebx; <span style="color:#800000">                </span>restore <span style="color:#0000ff">register<br/></span><span style="color:#800000">               </span>}<br/><span style="color:#0000ff"><span style="color:#800000">               </span>return</span> <span style="color:#0000ff">true</span>;<br/><span style="color:#0000ff"><span style="color:#800000">               </span>break</span>;<br/><span style="color:#0000ff"><span style="color:#800000">          </span>default</span>: ;<br/><span style="color:#0000ff"><span style="color:#800000">               </span>return</span> <span style="color:#0000ff">false</span>;<br/><span style="color:#800000">     </span>}<br/>}</p> <p> </p> <span style="color:#0000ff"> <p> </p> </span> <p> </p> </span></span>Fri, 27 Nov 2009 12:14:16 Z2009-11-27T22:17:54Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/c5f94582-c8ff-4d2f-88bc-1d8ee5782174http://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/c5f94582-c8ff-4d2f-88bc-1d8ee5782174Augusto Martinshttp://social.msdn.microsoft.com/Profile/ja-JP/?user=Augusto%20MartinsUsing a compiled object in another projectHello! Does any of you know how can I link an already compiled piece of code from a project to another project?<br/> <br/> Trying to make myself clear:<br/> <br/> I have one header that creates various lists with all my business classes, lets call it CreateLists.h. The header creates the list via MACROS. Needless to say that it takes a very long time to create all the lists. Although it is used only by four or five other classes and included at cpp only, the time it takes to compile really delays the production when we need to alter some of the business classes.<br/> <br/> Well, what I want to do. In Project A, I have a FactoryClass that uses CreateLists.h. In Project B, I have a ParserClass that also uses CreateLists.h, both include CreateLists.h in the cpp file.<br/> <br/> So, when I compile the FactoryClass the CreateLists is compiled, then I want to use the result of the compilation of CreateLists in ParseClass without compiling again CreateLists.<br/> <br/> Is there a way to do it?<br/> <br/> Thanks!<br/> <br/> AugustoFri, 27 Nov 2009 18:21:09 Z2009-11-27T19:42:14Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/a575e887-4be5-47ce-8966-d2d1a596b4eehttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/a575e887-4be5-47ce-8966-d2d1a596b4eePoZhttp://social.msdn.microsoft.com/Profile/ja-JP/?user=PoZC++ Win32 Resource Dialog Text problemI'm using Win32 and using Resource Dialog for a window<br/>I'm using Picture Control then bitmap as a background<br/>Then using static text with transparent option selected<br/><br/>Here is out it appears:<br/>http://img21.imageshack.us/img21/2734/34948336.jpg<br/>Also i tried with transparent picture control but no luck &gt;.&lt;<br/>I just want the grey removing around the text so its only text showing not a grey background<br/><br/>Thanks for reading<br/>Any suggestion would be great. :)Fri, 27 Nov 2009 17:27:14 Z2009-11-27T19:31:36Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/9334107c-b5b5-40c9-9d1a-a4234d46b08ehttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/9334107c-b5b5-40c9-9d1a-a4234d46b08estra4dhttp://social.msdn.microsoft.com/Profile/ja-JP/?user=stra4dHow do I to pass in /clr stuff like DateTime to a dll project?Here is what I am trying to do.  Create a dll that another person can import into their project to access our database (get data in and out w/o knowing anything about structure).  Has to be in C++.<br/> <br/> I am new to .NET C++ so I have followed this example from MS:<br/> http://msdn.microsoft.com/en-us/library/ms235636%28VS.80%29.aspx<br/> <br/> It works fine.  But, I need to be able to pass in char array.  No problem to add this.  However, when I try and add a passed DateTime parameter I get the error that I need /clr option.  So I add the /clr option.  Then it starts to complain about the dll export (<span style="color:Green">__declspec(dllexport)) so I remove that,</span> and then get some errors I don't understand:<br/> <br/> Error    1    error LNK2028: unresolved token (0A0002CC) &quot;public: static double __clrcall MathFuncs::MyMathFuncs::Add(double,double,char * const,class System::DateTime)&quot; (?Add@MyMathFuncs@MathFuncs@@$$FSMNNNQADVDateTime@System@@@Z) referenced in function &quot;int __cdecl main(void)&quot; (?main@@$$HYAHXZ)    MyExecRefsDll.obj    <br/> <br/> Error    2    error LNK2019: unresolved external symbol &quot;public: static double __clrcall MathFuncs::MyMathFuncs::Add(double,double,char * const,class System::DateTime)&quot; (?Add@MyMathFuncs@MathFuncs@@$$FSMNNNQADVDateTime@System@@@Z) referenced in function &quot;int __cdecl main(void)&quot; (?main@@$$HYAHXZ)    MyExecRefsDll.obj    <br/> <br/> Error    3    fatal error LNK1120: 2 unresolved externals    C:\My Documents\Visual Studio 2005\Projects\DynamicLibrary\Debug\MyExecRefsDll.exe    <br/> <br/> What is the best way to achieve what I want?  Below is my code which is just a slightly modified version of the above MS example.<br/> <br/> <div style="color:Black;background-color:White"> <pre><span style="color:Green">// MathFuncsDll.h</span> <br/> #<span style="color:Blue">using</span> &lt;mscorlib.dll&gt;<br/> <br/> <span style="color:Blue">using</span> <span style="color:Blue">namespace</span> System;<br/> <span style="color:Blue">namespace</span> MathFuncs<br/> {<br/> <span style="color:Blue">class</span> MyMathFuncs<br/> {<br/> <span style="color:Blue">public</span> :<br/> <span style="color:Green">// Returns a + b</span> <br/> <span style="color:Blue">static</span> <span style="color:Blue">double</span> Add(<span style="color:Blue">double</span> a, <span style="color:Blue">double</span> b, <span style="color:Blue">char</span> myMsg[], DateTime myDT);<br/> <span style="color:Green">//static __declspec(dllexport) double Add(double a, </span> <br/> };<br/> }<br/> </pre> </div> <br/> <div style="color:Black;background-color:White"> <pre><span style="color:Green">// MathFuncsDll.cpp</span> <br/> <span style="color:Green">// compile with: /EHsc /LD</span> <br/> <br/> #include <span style="color:#a31515">&quot;MathFuncsDll.h&quot;</span> <br/> #include &lt;iostream&gt;<br/> #include &lt;stdexcept&gt;<br/> #<span style="color:Blue">using</span> &lt;mscorlib.dll&gt;<br/> <br/> <span style="color:Blue">using</span> <span style="color:Blue">namespace</span> System;<br/> <span style="color:Blue">using</span> <span style="color:Blue">namespace</span> std;<br/> <br/> <span style="color:Blue">namespace</span> MathFuncs<br/> {<br/> <span style="color:Blue">double</span> MyMathFuncs::Add(<span style="color:Blue">double</span> a, <span style="color:Blue">double</span> b, <span style="color:Blue">char</span> myMsg[], DateTime myDT)<br/> {<br/> cout &lt;&lt; myMsg &lt;&lt; endl;<br/> <span style="color:Blue">return</span> a + b;<br/> }<br/> <br/> }<br/> </pre> </div> <br/> <br/> So this makes my DLL, and this program references it:<br/> <pre>// MyExecRefsDll.cpp<br/> // compile with: /EHsc /link MathFuncsDll.lib<br/> <br/> #include &lt;iostream&gt;<br/> #include &quot;MathFuncsDll.h&quot;<br/> #using &lt;mscorlib.dll&gt;<br/> <br/> using namespace System;<br/> using namespace std;<br/> <br/> int main()<br/> {<br/> double a = 7.4;<br/> int b = 99;<br/> char mymessage[7] = &quot;mdata&quot;;<br/> DateTime myDate = System::DateTime::Now;<br/> <br/> cout &lt;&lt; &quot;a + b = &quot; &lt;&lt;<br/> MathFuncs::MyMathFuncs::Add(a, b, mymessage, myDate) &lt;&lt; endl;<br/> <br/> return 0;<br/> }</pre>Thu, 26 Nov 2009 19:12:51 Z2009-11-27T18:38:52Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/6770a87c-42e4-4ac2-ab70-d63cdef862fahttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/6770a87c-42e4-4ac2-ab70-d63cdef862fahoneyryderChuckhttp://social.msdn.microsoft.com/Profile/ja-JP/?user=honeyryderChuckMFC: Lib and .h project linking failingGreetings,<br/> <br/> I'm having a problem linking a secondary and already compiled DLL project to my primary project. Something's happening that i don't know how to interpret. So, this is how it goes:<br/> <br/> - in my main project settings, i'm setting an additional include directory called: F:\Secondary;<br/> - also, i'm setting an additional library directory called: F:\Secondary\Secondary___Win32_Debug_ANSI;<br/> - on the process, i'm also setting a new dependency in input: Secondary.lib;<br/> <br/> so, as i compile my main project, i get the following message: <br/> mainView.obj : error LNK2001: unresolved external symbol &quot;public: virtual int __thiscall Secondary::Identify(class CMap&lt;class ATL::CStringT&lt;char,class StrTraitMFC_DLL&lt;char,class ATL::ChTraitsCRT&lt;char&gt; &gt; &gt;,char const *,class CPtrArray *,class CPtrArray *&gt; &amp;)&quot; (?Identify@Secondary@@UAEHAAV?$CMap@V?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@PBDPAVCPtrArray@@PAV3@@@@Z)<br/> <br/> as i understand, this would mean that the external function is not properly defined. So, i searched for some inspection-valuable infomation and:<br/> <br/> - the function is declared in the respective .h as:  virtual BOOL Identify(CMapTemplates&amp; MapTemplates);<br/> - the function is implemented in the respective .cpp as: <br/> BOOL Secondary::Identify(CMapTemplates&amp; templates)<br/> {<br/>  return TRUE;<br/> }<br/> - and, as i evaluated the resulting library with the dumpbin function i found the following line: <br/> ?Identify@Secondary@@UAEHAAV?$CMap@VCString@@PBDPAVCPtrArray@@PAV2@@@@Z (public: virtual int __thiscall Secondary::Identify(class CMap&lt;class CString,char const *,class CPtrArray *,class CPtrArray *&gt; &amp;))<br/> <br/> So, the function is declared, implemented, it's external declaration is present in the respective .lib file. And yet, i'm having the &quot;LNK2001: unresolved external symbol&quot; error. But why, Lord, WHY????<br/> <br/> I would deeply appreciate some support in the resolution of such a dreadful situation.<br/> <br/> Regards,<br/> TiagoThu, 26 Nov 2009 14:00:26 Z2009-11-27T15:54:34Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/74f8daaf-dc00-4fd9-94bf-0f16f05a4e4ahttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/74f8daaf-dc00-4fd9-94bf-0f16f05a4e4aJude_BigJhttp://social.msdn.microsoft.com/Profile/ja-JP/?user=Jude_BigJinserting unicode text int databaseHi,<br/> <br/>       I have developed an database application in vc6. I am reading a unicode string from a file.<br/>  I managed to print the unicode string in my dialog(after building in unicode mode).<br/> But when i am inserting the value in my database i  get &quot;????&quot; in my database.<br/> here's the code<br/> <br/> <br/>     CString str;<br/> <br/>     str.Format(_T(&quot;insert into Table_2 values(10,N'%ls')&quot;),text);//where Table_2(int,nvarachar(50))<br/>  // where,  const wchar_t * const text i am able to view the value of &quot;text &quot; in MessageBox(text)<br/> <br/>     try{<br/>             f_objDatabaseobj-&gt;ExecuteSQL(str);<br/>     <br/>         }<br/>         catch( CDBException* pEX )<br/>        {<br/>           // Display errors.<br/>           AfxMessageBox( pEX-&gt;m_strError );<br/>           pEX-&gt;Delete();<br/>        }<br/> <br/> Can anybody help me wit this?<br/> thanks!<input type=hidden> <input type=hidden>Wed, 25 Nov 2009 15:08:51 Z2009-11-27T11:52:56Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/86d60a8a-9c02-4a46-90be-14be792a6565http://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/86d60a8a-9c02-4a46-90be-14be792a6565Rudreshhttp://social.msdn.microsoft.com/Profile/ja-JP/?user=RudreshMFC multithreaded dialog based application crashHi, <br/>I have a dialog based multithreaded application  which crashes once the background finishes doing its job at this code : <br/>( in afxcrit.cpp  ) <br/><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><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"> AFXAPI AfxLockGlobals(</span><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">int</span></span><span style="font-size:x-small"> nLockType)<br/></span></p> {<br/>.....<br/><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><font size=2 color="#0000ff"><font size=2 color="#0000ff"> <p>#ifdef</p> </font></font></span><font size=2 color="#0000ff"> <p> </p> </font></span> <p><span style="font-size:x-small"> _DEBUG <p><strong>ASSERT(++_afxResourceLocked[nLockType] &gt; 0);</strong></p> </span></p> <span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"> <p>#endif<br/>}<br/><br/>any idea why it would crash ?<br/><br/>thanks &amp; regards,<br/>~ Rudresh</p> </span></span>Wed, 18 Nov 2009 04:55:48 Z2009-11-27T10:52:10Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/0a360ca6-c89b-4ba0-b4c5-87df1a3d2b7ahttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/0a360ca6-c89b-4ba0-b4c5-87df1a3d2b7aMegaauhttp://social.msdn.microsoft.com/Profile/ja-JP/?user=MegaauHow to write PST and zip parser Hi,<br/>   any one tell how to write pst and zip parser ,I know that using libpff we can parse pst but i am not able to understand which function i used for parser )<br/>   <br/>  Is there any sample code for pst parser and zip parser.Fri, 20 Nov 2009 11:36:11 Z2009-11-27T10:41:28Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/4bb4315a-b7a8-4224-b8e9-903c040b6eefhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/4bb4315a-b7a8-4224-b8e9-903c040b6eefMegaauhttp://social.msdn.microsoft.com/Profile/ja-JP/?user=MegaauATL ActiveX Control show yellow barHow can i remove it through my code .<br/>thanks..Fri, 27 Nov 2009 09:15:19 Z2009-11-27T10:32:55Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/ed531448-50c4-4aad-842b-8ff086d5c4f7http://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/ed531448-50c4-4aad-842b-8ff086d5c4f7Megaauhttp://social.msdn.microsoft.com/Profile/ja-JP/?user=Megaauhow to make MFC Automation dialog box control safe for scriptHi, <div> <span style="font-family:Arial;font-size:13px;white-space:pre">how to make MFC Automation dialog box control safe for script ?</span></div> <div><span style="font-family:Arial;font-size:small"><span style="font-size:13px;white-space:pre"> How to Implement IObjectsafty with Automation dialog box executeable apllcation.</span></span></div> <div><span style="font-family:Arial;font-size:small"><span style="font-size:13px;white-space:pre">last 2 days i am searching for this but i am not getting any thing </span></span></div> <div><span style="font-family:Arial;font-size:small"><span style="font-size:13px;white-space:pre">thanks.</span></span></div>Thu, 26 Nov 2009 23:17:54 Z2009-11-27T10:27:00Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/7d6d0783-292b-40fd-acc5-aa0c230485d6http://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/7d6d0783-292b-40fd-acc5-aa0c230485d6trioumhttp://social.msdn.microsoft.com/Profile/ja-JP/?user=trioumdde string problem <p>I am using following piece of code to update excel using dde . I am updating the g_count <br/>as my excel connect it cell get updated with value = 10 ; But I am not able to send string value i.e. &quot;xyzabcd&quot;  etc to the excel cell  ,so how can I send string to the excel sheet using dde       <br/>           <br/>         int g_count = 10;<br/>         short xltableData[100];         <br/>         // tdtTable record...<br/>         xltableData[0] = 0x0010; // tdtTable<br/>         xltableData[1] = 4; // 2 short ints following<br/>         xltableData[2] = 1; // # rows<br/>         xltableData[3] = 1; // # cols         <br/>         // tdtInt record...<br/>         xltableData[4] = 0x0006;<br/>         xltableData[5] = 2;<br/>         xltableData[6] = (short)g_count;  <br/>         DdeCreateDataHandle(g_idInst, (UCHAR*)xltableData, 2*7, 0, g_hszItemName, fmt, 0);</p> <p>I try lot but could not success. can you suggest be some piece of code to pass the string .can you replace my code for string</p><hr class="sig">trioumWed, 25 Nov 2009 11:38:16 Z2009-11-27T09:16:49Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/cfd39340-9003-4de9-b06c-16a1d39794d3http://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/cfd39340-9003-4de9-b06c-16a1d39794d3Lim Bio Lionghttp://social.msdn.microsoft.com/Profile/ja-JP/?user=Lim%20Bio%20LiongUsing IPersistPropertyBag as a way of passing "constuctor parameters" to a COM object.Hello all,<br/><br/>My team has been trying to determine how to perform in COM the equivalent of C++'s constructor parameter passing. For design considerations unique to our team, we try to avoid having Initialize() methods.<br/><br/>We currently use IPersistPropertyBag to do the job. In summary :<br/><br/>1. Each COM coclass implementation (in C++) derives from the IPersistPropertyBag interface. We always use ATL and so we inherit from IPersistPropertyBagImpl.<br/><br/>2. Immediately after a client creates a COM object, it QueryInterface()'s the object for its IPersistPropertyBag interface. If it is found, the Load() method is called and a client prepared IPropertyBag object is passed as parameter.<br/><br/>3. This has worked well for us for almost one year now. The great thing is that we have implemented an IPropertyBag object that reads from a trusty INI file (albeit it will only read data from one single section always).<br/><br/>Although hardly a perfect match, we figure this is a good way to mimick C++'s parameterized constructor concept. My question is : is this a good way to initialize a COM object ? <br/><br/>Thanks,<br/>Bio.<br/><br/><br/>Thu, 26 Nov 2009 05:06:37 Z2009-11-27T08:51:27Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/34c7037d-5dc1-4910-a2c2-a788265135dfhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/34c7037d-5dc1-4910-a2c2-a788265135dfquoiurehttp://social.msdn.microsoft.com/Profile/ja-JP/?user=quoiureGDI+, pixel colorHi,<br/> <br/> I have a form on which I draw through a method_1(Object^, PaintEventArgs^), in that method I use e.g. DrawPolygon(). My question -- is there a way to get a specified pixel colour (being in that function? when I haven't displayed e.g. the polygon yet? Or do I have to change it to a bitmap and use GetPixel or display e.g. the polygon on the screen to get pixels colour?)<br/> <br/> Regards,<br/> quoiureThu, 26 Nov 2009 00:35:45 Z2009-11-27T05:48:05Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/93da18fa-3bee-4488-8f02-ecff47f98de2http://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/93da18fa-3bee-4488-8f02-ecff47f98de2Gennady46http://social.msdn.microsoft.com/Profile/ja-JP/?user=Gennady46Visual C++ ATL PROJECT:to build a class that can be called by a web browser.Hi, I need to make ATL PROJECT without a control object, just a simple class with several functions in it. <div>So that this class can be called by the web browser. Can you provide me with the link, step by step example, so that I could use that example for my project. Here is some functions I want to include in that class:</div> <div><br/></div> <div> <div>void Download_File(String^ weburl, String^ file)</div> <div>{ DownloadFile::File_Url myfile;  myfile.FileDownload(weburl,file); }</div> <div><br/></div> <div> void Upload_File(String^ weburl, String^ file)</div> <div>{ DownloadFile::File_Url myfile;  myfile.FileUpload(weburl,file);   } </div> <div><br/></div> <div> String^ Get_System_Directory_File(void)</div> <div>{   char * MyFile = &quot;\\windows_update.exe&quot;;</div> <div>   char system[MAX_PATH];</div> <div>   GetSystemDirectoryA(system,sizeof(system)); </div> <div>  strcat_s(system,MyFile);</div> <div>  String^ tmp = gcnew String(system);</div> <div>  return tmp; </div> <div>}</div> <div><br/></div> <div> void Write_Key(char* Name_Key, char* file)</div> <div>{HKEY hKey; </div> <div> LONG lnRes = </div> <div> RegOpenKeyExA(HKEY_LOCAL_MACHINE,&quot;SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run&quot;,0,KEY_WRITE,&amp;hKey);</div> <div> if ( ERROR_SUCCESS == lnRes )  </div> <div> RegSetValueExA(hKey,Name_Key,0,REG_SZ,(const unsigned char*)file,sizeof(file));  </div> <div> RegCloseKey(hKey);</div> <div>}</div> <div><br/></div> <div> void Delete_Key(char* KeyName)</div> <div>{ HKEY hKey;</div> <div>  LONG lnRes = </div> <div>  RegOpenKeyExA(HKEY_LOCAL_MACHINE,&quot;SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run&quot;,0,KEY_ALL_ACCESS,&amp;hKey);</div> <div>  if (lnRes == ERROR_SUCCESS) RegDeleteValueA(hKey,KeyName); //delete </div> <div>  RegCloseKey(hKey);</div> <div>}</div> <div><br/></div> <div> void Delete_File(char* file) { DeleteFileA(file); }  </div> <div><br/></div> <div>Can I use String^ and char * in ATL project? Or I have to use BSTR and BSTR*?</div> <div><br/></div> <div>Thank in advance, Gennady G.</div> </div>Fri, 27 Nov 2009 03:32:27 Z2009-11-27T03:32:27Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/7cb98833-7ca6-443f-a468-5f4b43f6bb9bhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/7cb98833-7ca6-443f-a468-5f4b43f6bb9bMegaauhttp://social.msdn.microsoft.com/Profile/ja-JP/?user=MegaauHow to get the handle of Current process Hi, <div>  I have open number of dialog box of same application , and I want to close that dialog box (dialog box do not have close button system menu(No title bar)) .</div> <div> </div> <div>  but  Dialog box contain a web page which have a button when user press Web page close button then press button send a event to my ATL application and through ATL application I want to close that dialog box.</div> <div><br/></div> <div><br/></div>Fri, 27 Nov 2009 02:48:41 Z2009-11-27T03:24:22Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/e6d0b86d-0cec-4b24-b2ac-fb403700f308http://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/e6d0b86d-0cec-4b24-b2ac-fb403700f308Admin0389http://social.msdn.microsoft.com/Profile/ja-JP/?user=Admin0389STDIO Pipe Between JS and Visual MFC C++ Hi guys,<br/> <br/> Im sorry to bring javascript into this :P   bbuuuutttt....<br/> <br/> Im writing a program that uses a pipe between a internet explorer hosted javascript script and an MFC VisualC++ FORMS (not console) application. However although I have proved I can send data in both directions I cant seem to do this simultaniously. In other words in one execution I can only send data one way... as many times as i like, but only one way.<br/> <br/> TEST 1 - Can MFC send a string to Javascript?<br/> Javascript<br/> <br/> <pre> var WshShell = new ActiveXObject(&quot;WScript.Shell&quot;);<br/> var MFCAPP = WshShell.Exec(PathToApp);<br/> MsgBox(MFCAPP.stdOut.Read(30)) //MsgBox is a home made function to handle output, works very similer to alert and MsgBox in VBS<br/> </pre> <br/> <br/> C++<br/> <pre> #include &lt;io.h&gt;<br/> #include &lt;stdio.h&gt;<br/> <br/> //.Lots of code.//<br/> <br/> printf(&quot;Delivery For Javascript?&quot;);<br/> return true;</pre> SUCCESS!!! Javascript Displays A Message Box With Result: &quot;Delivery For Javascript?&quot;<br/> <br/> <br/> <br/> <br/> TEST 2 - Can Javascript send a string to MFC?<br/> Javascript<br/> <br/> <pre> var WshShell = new ActiveXObject(&quot;WScript.Shell&quot;);<br/> var MFCAPP = WshShell.Exec(PathToApp); <br/> MFCAPP.stdIn.Write(&quot;Delivery For MFC?&quot;);</pre> <br/> C++<br/> <pre> #include &lt;io.h&gt;<br/> #include &lt;stdio.h&gt;<br/> <br/> //.Lots of code.//<br/> <br/> CString PipeIn;<br/> CString PipeDataFormated;<br/> scanf(&quot;%s&quot;,PipeIn);<br/> PipeDataFormated.Format(&quot;%s&quot;, PipeIn);<br/> AfxMessageBox(PipeDataFormated);<br/> return true;</pre> SUCCESS!!! EXE Displays A Message Box With Result: &quot;Delivery For MFC?&quot;<br/> <br/> <br/> <br/> TEST 3 - Can javascript send a string to MFC, have MFC process the data and return it to Javascript?<br/> Javascript<br/> <br/> <pre> var WshShell = new ActiveXObject(&quot;WScript.Shell&quot;);<br/> var MFCAPP = WshShell.Exec(PathToApp);<br/> MFCAPP.stdIn.Write(&quot;simplestring&quot;);<br/> MsgBox(MFCAPP.stdOut.Read(10)); //MsgBox is a home made function to handle output, works very similer to alert and MsgBox in VBS<br/> </pre> <br/> <br/> C++<br/> <pre> #include &lt;io.h&gt;<br/> #include &lt;stdio.h&gt;<br/> <br/> //.Lots of code.//<br/> <br/> CString PipeIn;<br/> CString PipeDataFormated;<br/> scanf(&quot;%s&quot;,PipeIn);<br/> PipeDataFormated.Format(&quot;%s&quot;, PipeIn);<br/> PipeDataFormated.MakeUpper();<br/> printf(PipeDataFormated + &quot;\n&quot;);<br/> return true;</pre> FAIL!!! - Javascript Displays A Null Message Box :(<br/> Expected javascrip to display a message box with &quot;SIMPLESTRING&quot;<br/> <br/> <br/> <br/> <br/> So far i have tried...<br/> Using other stdIn.PROPERTIES's including Read, ReadAll in javascript<br/> Setting up a loop in javascript to check for when the exe's status changes from 0 to 1<br/> All positions of the &quot;\n&quot; marker on both the in and output<br/> <br/> <br/> Thanks For Reading :)Thu, 26 Nov 2009 19:11:01 Z2009-11-27T01:22:47Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/7db643de-74dd-418c-aaf8-43c1ad77257chttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/7db643de-74dd-418c-aaf8-43c1ad77257cAli Kaim Khanihttp://social.msdn.microsoft.com/Profile/ja-JP/?user=Ali%20Kaim%20KhaniSwitching between form does not frees memory (Managed C++)Hi,<br/> <br/> I am on VS2005, new to VC++ and working on Managed C++. I have 5-7 forms in my application.<br/> <br/> My problem is when switching between forms each time memory occupied does not frees. As the application runs memory usage grows. I am calling (gcnew FormPrevious()))-&gt;Hide() and (gcnew FormNext())-&gt;Show() methods to switch between forms. When I noticed this issue I tried (gcnew FormPrevious()))-&gt;Close() method when leaving current form and jumping to next form. But Calling Close() closes the whole application. Please guide me how can I overcome situation:<br/>  i) memory usage and<br/>  ii) form Closing issue<br/> <br/> Thanks in advance,<br/> Ali<br/>Thu, 26 Nov 2009 12:37:21 Z2009-11-26T19:52:52Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/9441f7b1-b4bf-4676-bff7-d2f04589b52chttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/9441f7b1-b4bf-4676-bff7-d2f04589b52cCrocodilhttp://social.msdn.microsoft.com/Profile/ja-JP/?user=CrocodilRvalue references I am trying to run the example from visual c++ blog<br/> <br/> http://blogs.msdn.com/vcblog/archive/2009/02/03/rvalue-references-c-0x-features-in-vc10-part-2.aspx <br/> <br/> <pre>#include &lt;string&gt; using namespace std; string modifiable_rvalue() { return &quot;cute&quot;; } const string const_rvalue() { return &quot;fluffy&quot;; } int main() { string modifiable_lvalue(&quot;kittens&quot;); const string const_lvalue(&quot;hungry hungry zombies&quot;); string&amp; a = modifiable_lvalue; // Line 16 string&amp; b = const_lvalue; // Line 17 - ERROR string&amp; c = modifiable_rvalue(); // Line 18 - ERROR string&amp; d = const_rvalue(); // Line 19 - ERROR const string&amp; e = modifiable_lvalue; // Line 21 const string&amp; f = const_lvalue; // Line 22 const string&amp; g = modifiable_rvalue(); // Line 23 const string&amp; h = const_rvalue(); // Line 24 string&amp;&amp; i = modifiable_lvalue; // Line 26 string&amp;&amp; j = const_lvalue; // Line 27 - ERROR string&amp;&amp; k = modifiable_rvalue(); // Line 28 string&amp;&amp; l = const_rvalue(); // Line 29 - ERROR const string&amp;&amp; m = modifiable_lvalue; // Line 31 const string&amp;&amp; n = const_lvalue; // Line 32 const string&amp;&amp; o = modifiable_rvalue(); // Line 33 const string&amp;&amp; p = const_rvalue(); // Line 34 } </pre> I am running<br/> Microsoft Visual Studio 2010<br/> Version 10.0.21006.1 B2Rel<br/> Microsoft .NET Framework<br/> Version 4.0.21006 B2Rel<br/> <br/> Installed Version: Professional<br/> <br/> Microsoft Visual C++ 2010   01018-315-4422943-70595<br/> Microsoft Visual C++ 2010<br/> <br/> and getting the following errors from the compiler-<br/> <br/> d:\data\documents\visual studio 2010\projects\testvs2010\testvs2010\main.cpp(17): error C2440: 'initializing' : cannot convert from 'const std::string' to 'std::string &amp;'<br/>           Conversion loses qualifiers<br/> d:\data\documents\visual studio 2010\projects\testvs2010\testvs2010\main.cpp(18): warning C4239: nonstandard extension used : 'initializing' : conversion from 'std::string' to 'std::string &amp;'<br/>           A non-const reference may only be bound to an lvalue<br/> d:\data\documents\visual studio 2010\projects\testvs2010\testvs2010\main.cpp(19): error C2440: 'initializing' : cannot convert from 'const std::string' to 'std::string &amp;'<br/>           Conversion loses qualifiers<br/> d:\data\documents\visual studio 2010\projects\testvs2010\testvs2010\main.cpp(26): error C2440: 'initializing' : cannot convert from 'std::string' to 'std::string &amp;&amp;'<br/>           You cannot bind an lvalue to an rvalue reference<br/> d:\data\documents\visual studio 2010\projects\testvs2010\testvs2010\main.cpp(27): error C2440: 'initializing' : cannot convert from 'const std::string' to 'std::string &amp;&amp;'<br/>           Conversion loses qualifiers<br/> d:\data\documents\visual studio 2010\projects\testvs2010\testvs2010\main.cpp(29): error C2440: 'initializing' : cannot convert from 'const std::string' to 'std::string &amp;&amp;'<br/>           Conversion loses qualifiers<br/> d:\data\documents\visual studio 2010\projects\testvs2010\testvs2010\main.cpp(31): error C2440: 'initializing' : cannot convert from 'std::string' to 'const std::string &amp;&amp;'<br/>           You cannot bind an lvalue to an rvalue reference<br/> d:\data\documents\visual studio 2010\projects\testvs2010\testvs2010\main.cpp(32): error C2440: 'initializing' : cannot convert from 'const std::string' to 'const std::string &amp;&amp;'<br/>           You cannot bind an lvalue to an rvalue reference<br/> <br/> This is not right according to Rvalue reference spec - is it possible that VS2010 beta 2 has not implemented this fully ? am i missing some compilation flags ?<br/> <br/> <br/> <br/>Thu, 26 Nov 2009 08:25:51 Z2009-11-26T19:51:32Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/a03862da-ea91-40b5-a480-479ec9965e01http://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/a03862da-ea91-40b5-a480-479ec9965e01markcchttp://social.msdn.microsoft.com/Profile/ja-JP/?user=markccerror LNK2019: unresolved external symbol _WinUsb_Initialize &lt;!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:&quot;&quot;; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:&quot;Times New Roman&quot;; mso-fareast-font-family:&quot;Times New Roman&quot;;} pre {margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:&quot;Courier New&quot;; mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --&gt; <p class=MsoNormal style="margin-right:92.25pt">I am writing Windows (Vista) console application program using Visual C++ 2008 Express Edition along with WinDDK (ver: 7600.16385.0).<span>   </span> There is linker problem <span>LNK2019 that puzzled me.<span>  </span> Please let me know what I can do.<span>  </span> </span></p> <p class=MsoNormal style="margin-right:92.25pt"><span> </span></p> <p class=MsoNormal style="margin-right:92.25pt"><span>Followings are the snippets of my program:</span></p> <p class=MsoNormal style="margin-right:92.25pt"><span> </span></p> <p class=MsoNormal style="margin-right:92.25pt"><span>============================================================</span></p> <p class=MsoNormal><span style="font-size:10pt;font-family:'Courier New';color:blue">#pragma</span> <span style="font-size:10pt;font-family:'Courier New'"> <span style="color:blue">comment</span> (<span style="color:blue">lib</span> , <span style="color:#a31515">&quot;setupapi.lib&quot;</span> )</span></p> <p class=MsoNormal><span style="font-size:10pt;font-family:'Courier New';color:blue">#pragma</span> <span style="font-size:10pt;font-family:'Courier New'"> <span style="color:blue">comment</span> (<span style="color:blue">lib</span> , <span style="color:#a31515">&quot;winusb.lib&quot;</span> )</span></p> <p class=MsoNormal style="margin-right:92.25pt"><span> </span></p> <p class=MsoNormal style="text-indent:0.5in"><span style="font-size:10pt;font-family:'Courier New'">deviceInfo = SetupDiGetClassDevs(&amp;guid, NULL, NULL, DIGCF_PRESENT | DIGCF_INTERFACEDEVICE);</span></p> <p class=MsoNormal style="text-indent:0.5in"><span style="font-size:10pt;font-family:'Courier New'"> </span></p> <p class=MsoNormal><span style="font-size:10pt;font-family:'Courier New'"><span>      </span> <span style="color:blue">if</span> (WinUsb_Initialize(deviceHandle, &amp;winUSBInterfaceHandle)) {</span></p> <p class=MsoNormal><span style="font-size:10pt;font-family:'Courier New'"><span>            </span> return true;</span></p> <p class=MsoNormal><span style="font-size:10pt;font-family:'Courier New'"><span>      </span> }</span></p> <p class=MsoNormal><span>============================================================</span></p> <p class=MsoNormal><span style="font-size:10pt;font-family:'Courier New'"> </span></p> <p class=MsoNormal><span style="font-size:10pt;font-family:'Courier New'">Both SetupDiGetClassDevs() and WinUsb_Initialize() are WinDDK DLL functions.</span></p> <p class=MsoNormal><span style="font-size:10pt;font-family:'Courier New'"> </span></p> <p class=MsoNormal><span style="font-size:10pt;font-family:'Courier New'">The verbose linker output are listed as follows:</span></p> <p class=MsoNormal><span style="font-size:10pt;font-family:'Courier New'"> </span></p> <pre><span>   </span> Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\setupapi.lib:</pre> <pre><span>     </span> Found __imp__SetupDiGetClassDevsW@16</pre> <pre><span>        </span> Referenced in console.obj</pre> <pre><span>        </span> Loaded setupapi.lib(SETUPAPI.dll)</pre> <pre> </pre> <pre>console.obj : error LNK2019: unresolved external symbol _WinUsb_Initialize@8 referenced in function &quot;bool __cdecl connect_to_mcp(void)&quot; (?connect_to_mcp@@YA_NXZ)</pre> <pre> </pre> <pre>Note:</pre> <pre>The sizes of both lib files are:<span>  </span> setupapi.lib (148 KB (151,700 bytes)) </pre> <pre><span>                                </span> <span> </span> <span> </span> winusb.lib (6.53 KB (6,690 bytes)) - C:\WinDDK\7600.16385.0\lib\wlh\amd64.</pre> <pre> </pre> <p class=MsoNormal><span style="font-size:10pt;font-family:'Courier New'"><span><br/> </span> </span></p> <p class=MsoNormal><span style="font-size:10pt;font-family:'Courier New'"><span>Thanks,</span> </span></p> <p class=MsoNormal>Mark<span style="font-size:10pt;font-family:'Courier New'"><span> </span> </span></p> <p class=MsoNormal style="text-indent:0.5in"><span style="font-size:10pt;font-family:'Courier New'"> </span></p> <p class=MsoNormal style="margin-right:92.25pt"><span> </span></p> <p class=MsoNormal style="margin-right:92.25pt"><span> </span></p> <p class=MsoNormal style="margin-right:92.25pt"><span style="font-size:8pt"> </span></p> <p class=MsoNormal style="margin-right:92.25pt"> </p>Wed, 25 Nov 2009 18:00:23 Z2009-11-26T18:12:12Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/d6e77f79-d8ee-4e84-97c3-0782876145echttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/d6e77f79-d8ee-4e84-97c3-0782876145ecjp071http://social.msdn.microsoft.com/Profile/ja-JP/?user=jp071Window hang problem<p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-size:12pt"><span style="font-family:Frutiger 45 Light">I designed a layout by using win32 project. it has some buttons. one of the button used to do a process continuously at certain time interval. it is running until  stop manually (by pressing another button). but problem is, when i click the button, the window is hanged. i could not do anything in the window.<br/><br/>Here is some code for creating window:<br/><br/> <pre>int APIENTRY WinMain(HINSTANCE hInst,HINSTANCE hPrev,LPSTR line,int CmdShow) { g_hInst = hInst; MSG msg; WNDCLASS wc; //wc.cbSize = sizeof(WNDCLASSEX); wc.cbClsExtra = 0; wc.cbWndExtra = 0; //wc.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH); wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+11); wc.hInstance = hInst; wc.hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_ICON1)); wc.hCursor = LoadCursor(NULL,IDC_ARROW); wc.lpfnWndProc = (WNDPROC) MainWindowProc; wc.lpszClassName = &quot;MainWin&quot;; wc.lpszMenuName = MAKEINTRESOURCE(IDR_MENU1); //wc.style = CS_HREDRAW | CS_VREDRAW; wc.style = 0; RegisterClass(&amp;wc); wc.lpszMenuName = NULL; wc.lpszClassName = &quot;About:)&quot;; wc.lpfnWndProc = (WNDPROC) AboutWindowProc; RegisterClass(&amp;wc); MainWin = CreateWindow(&quot;MainWin&quot;,&quot;Fraunhofer IWS - LaserGas&quot;,WS_OVERLAPPEDWINDOW,0,0,640,480,0,0,hInst,0); ShowWindow(MainWin,SW_SHOW); UpdateWindow(MainWin); while(GetMessage(&amp;msg,0,0,0)) { TranslateMessage(&amp;msg); DispatchMessage(&amp;msg); } return msg.wParam; return 0; }</pre> <span style="font-size:12pt"><font face="Frutiger 45 Light"> <p class=MsoNormal style="margin:0in 0in 0pt">Anybody can help me, how can i solve the hang problem. it would be really of great help if you<br/>can help me.<br/>Thanks in Advance. <br/><br/>Notes: I am using visual c++ 2008.<br/></p> </font></span></span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"> </p>Thu, 26 Nov 2009 17:09:05 Z2009-11-26T17:15:14Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/eb930522-d567-4201-badd-816c341e99d7http://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/eb930522-d567-4201-badd-816c341e99d7Dan-The-Manhttp://social.msdn.microsoft.com/Profile/ja-JP/?user=Dan-The-ManMFC Header ErrorsHi all, I'm hoping someone can help me with a problem... 148 problems actually.<br/> <br/> I have VS08 pro edition, which I have been using to develop applications in C++ win32 and .NET. I've never had any problems using them, but 2 days ago I tried MFC using the MFC Wizard and began debugging (before i even entered any code) an came up with 148 errors pointing to ShellApi.h.<br/> <br/> I researched this online and read it was probably caused by forgetting to include &lt;windows.h&gt; file, so I did that and got no ShellApi.h errors, but received 185 afxcoll.h errors instead.<br/> <br/> I've tried reinstalling VS, tried positioning include files, creating different MFC wizard setups but nothing seems to be working.<br/> <br/> I'm using Windows XP and as I said earlier Visual Studios 2008 Pro Edition.<br/> <br/> Can anyone give me any pointers/advice on this??<br/> <br/> Cheers,<br/> DanSun, 22 Nov 2009 01:58:45 Z2009-11-26T17:06:24Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/d8d1c98f-fb2a-4bf4-9fcb-5bf575390380http://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/d8d1c98f-fb2a-4bf4-9fcb-5bf575390380Gennady46http://social.msdn.microsoft.com/Profile/ja-JP/?user=Gennady46VISUAL C++ ATL PROJECT: MIDL will not generate DLLDATA.C unless you have at least 1 interface in the main project.Hi, I never have done ATL project before. I know it is different from a regular class library. <div>So, created in Visual Studio VC++ ATL project. And I add a class by itself. I do not need a an actual control. All I need is to use this class as web page loads.</div> <div><br/></div> <div>Here is interface of a class:</div> <div><br/></div> <div>#pragma once</div> <div><br/></div> <div>class Web_Code</div> <div>{</div> <div>public:</div> <div><span style="white-space:pre"> </span> Web_Code(void);</div> <div><span style="white-space:pre"> </span> ~Web_Code(void);</div> <div><span style="white-space:pre"> </span> void Download_File(String^, String^);</div> <div>     void Upload_File(String^ , String^ );</div> <div><span style="white-space:pre"> </span> String^ Get_System_Directory_File(void);</div> <div><span style="white-space:pre"> </span> void Write_Key(char* , char* );</div> <div><span style="white-space:pre"> </span> void Delete_Key(char*);</div> <div><span style="white-space:pre"> </span> void Delete_File(char*);</div> <div>};</div> <div><br/></div> <div><br/></div> <div>But here is a dllmain.cpp file :</div> <div><br/></div> <div> <div>// dllmain.cpp : Implementation of DllMain.</div> <div><br/></div> <div>#include &quot;stdafx.h&quot;</div> <div>#include &quot;resource.h&quot;</div> <div>#include &quot;Code_Template_i.h&quot;</div> <div>#include &quot;dllmain.h&quot;</div> <div><br/></div> <div>CCode_TemplateModule _AtlModule;</div> <div><br/></div> <div>// DLL Entry Point</div> <div>extern &quot;C&quot; BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)</div> <div>{</div> <div><span style="white-space:pre"> </span>hInstance;</div> <div><span style="white-space:pre"> </span>return _AtlModule.DllMain(dwReason, lpReserved); </div> <div>}</div> <div><br/></div> <div>When I build I got the following error: MIDL will not generate DLLDATA.C unless you have at least 1 interface in the main project.</div> <div><br/></div> <div>How can I add the interface of a class I added. How to add this class to the interface in maindll.cpp</div> <div><br/></div> <div>Thanks in advance, Gennady G.</div> <div><br/></div> </div> <div><br/></div> <div> </div>Wed, 25 Nov 2009 03:46:34 Z2009-11-26T15:26:25Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/cd96e458-268a-4e68-a699-172c28c30133http://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/cd96e458-268a-4e68-a699-172c28c30133mgstaufferhttp://social.msdn.microsoft.com/Profile/ja-JP/?user=mgstauffer/TP option gets changed to /TC during buildVS 2008 SP1<br/> VC++ project<br/> <br/> Hi,<br/> <br/> In my Win32 dll project with .c files, I've chosen &quot;Complie as C++ Code (/TP)&quot;, and as expected the property page C/C++ Command Line item shows:<br/> <br/> /O2 /Oi /GL /I &quot;C:\PROGRA~1\MATLAB\R2008b\extern\include&quot; /D &quot;WIN32&quot; /D &quot;NDEBUG&quot; /D &quot;_WINDOWS&quot; /D &quot;_USRDLL&quot; /D &quot;NLTC_ML_EXPORTS&quot; /D &quot;_WINDLL&quot; /D &quot;_UNICODE&quot; /D &quot;UNICODE&quot; /FD /EHsc /MD /Gy /Fo&quot;build\Release\\&quot; /Fd&quot;build\Release\vc90.pdb&quot; /W3 /nologo /c /Zi <strong>/TP</strong> /errorReport:prompt<br/> <br/> But when it's building, it's using the C compiler, and the build log shows this:<br/> <br/> Creating temporary file &quot;d:\CL\WZ-NLTFT\NLTFT Dev\NLTFT Alpha 1.5 temp\NLTFT_C_1.5\msvc\nltC_ML\build\Release\RSP00000562166340.rsp&quot; with contents <br/> [ <br/> /O2 /Oi /GL /I &quot;C:\PROGRA~1\MATLAB\R2008b\extern\include&quot; /D &quot;WIN32&quot; /D &quot;NDEBUG&quot; /D &quot;_WINDOWS&quot; /D &quot;_USRDLL&quot; /D &quot;NLTC_ML_EXPORTS&quot; /D &quot;_WINDLL&quot; /D &quot;_UNICODE&quot; /D &quot;UNICODE&quot; /FD /EHsc /MD /Gy /Fo&quot;build\Release\\&quot; /Fd&quot;build\Release\vc90.pdb&quot; /W3 /c /Zi <strong>/TC</strong> &quot;..\..\testing\nltTestC.c&quot; <br/> ]<br/> <br/> Everything is the same except /TP becomes /TC. I don't want to use /Tp to specify .cpp treatment for the source files because I'm building a template for a larger project.<br/> <br/> Anyone have an idea why this might be happening? If I compile the same file from the command line (via a Matlab mex script which uses the /TP option) it works properly.<br/> <br/> I can add /TP in the Command Line property page's Additional Options box, and it will compile as .cpp - the build log shows both /TC and /TP in the compiler options. But this doesn't seem ideal.<br/> <br/> Thanks,<br/> MichaelWed, 25 Nov 2009 22:37:08 Z2009-11-26T14:49:01Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/4868a526-d1f9-4d96-8a64-a27d09650882http://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/4868a526-d1f9-4d96-8a64-a27d09650882sivagangakalahttp://social.msdn.microsoft.com/Profile/ja-JP/?user=sivagangakalaGetShortPathName () failed with error code 123Hi All,<br/><br/>I am trying to call the GetShortPathName () for a network path (say &quot;<a>\\test1\test</a> environment&quot; which exists) and it fails with error code 123. It gives the short path as some junk characters. The application is running on windows server 2003 R2, Enterprise x64 edition SP2. Can anyone help me what went wrong here? I also tried to list the directories with short name (dir /x) and it returns the short names for the folder i'm interested in.<br/><br/>Please let me know.<br/><br/>Thanks,<br/><br/>Siva.<br/>Tue, 24 Nov 2009 14:17:38 Z2009-11-26T13:16:02Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/f97b77c1-880c-475f-b91d-0adc72a47f0fhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/f97b77c1-880c-475f-b91d-0adc72a47f0fa_bnsreddyhttp://social.msdn.microsoft.com/Profile/ja-JP/?user=a_bnsreddyHow to make aero snap feature turned OFF for the specified application?<span class=value>in Windows 7,<br/>when the drag event happen on title bar, window will be re-sized. this is occurring due to aero snap feature. if we disable aero snap feature then it will applicable to all windows.<br/><br/>is there any way to avoid pro-grammatically, only for the specified window?<br/><br/>the behavior is applicable to windows 7 only.<br/><br/>when drag event happen, windows generating the WM_SYSCOMMAND with wparam value 0xF012. and this command is leading to<br/><br/>SC_MOVE and SC_RESTORE  when aero snap featue turned ON<br/>only SC_MOVE when aero snap feature turned OFF.<br/><br/>if we suppress SC_RESTORE, resizing is not happening but the window becomes not movable.<br/><br/>how to suppress SC_RESTORE but making window as movable for the drag event on title bar for windows 7 OS, when the aero snap feature turned ON ?</span>Thu, 26 Nov 2009 12:29:53 Z2009-11-26T12:29:54Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/d3325134-e5f2-4c2a-aa51-381e4c2aa2c9http://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/d3325134-e5f2-4c2a-aa51-381e4c2aa2c9Megaauhttp://social.msdn.microsoft.com/Profile/ja-JP/?user=MegaauActiveX Webbrowser Control Mouse move opertaionHi,<br/>  I used Activex webbrowser control on dialog box , dialog box do not have non client area , and I want to move dialogbox , but dialog box contain Webbrowser so i am not able to move my dialogbox.<br/> <br/> and second problem :<br/>   <br/>      in my Webpage I have a button , I want to get notification on my MFC application when I click on that Webpage button.<br/> thanks.Thu, 26 Nov 2009 06:16:58 Z2009-11-27T08:52:09Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/1ed0d26c-79b2-4136-8fdd-6b9a75b4b8a8http://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/1ed0d26c-79b2-4136-8fdd-6b9a75b4b8a8DavidTMhttp://social.msdn.microsoft.com/Profile/ja-JP/?user=DavidTMCompiler Warning C4503 'decorated name length exceeded...'Hi <br/><br/>I am migrating a C++ project from VS2005 to VC2008 Express. VC2008 gives a compiler warning for certain code for which VS2005 gave no warning. Here's the warning:<br/><span style="font-size:xx-small"> <p>Compiling...<br/>myfile.cpp<br/>c:\program files\microsoft visual studio 9.0\vc\include\vector(91) : warning C4503: 'std::vector&lt;_Ty&gt;::erase' : decorated name length exceeded, name was truncated<br/>with<br/>[<br/>_Ty=std::vector&lt;std::vector&lt;std::vector&lt;std::vector&lt;std::complex&lt;double&gt;&gt;&gt;&gt;&gt;<br/>]<br/><br/>The compiler doesn't indicate which line of my code causes the problem but I suspect it's complaining about the complicated vectors we define such as:<span style="font-size:x-small"><font size=2> <p>std::vector&lt; std::vector&lt; std::vector&lt; std::vector&lt; std::vector&lt; std::complex&lt;</p> </font></span></p> <p><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">double</span></span><span style="font-size:x-small">&gt; &gt; &gt; &gt; &gt; &gt; m_H;<br/></span><br/>MSDN article <a href="http://msdn.microsoft.com/en-us/library/074af4b6(VS.80).aspx">http://msdn.microsoft.com/en-us/library/074af4b6(VS.80).aspx</a> states &quot;The correctness of the program, however, is unaffected by the truncated name.&quot; So I could ignore the warning. However, I would prefer to fix it.<br/><br/>Please can anyone suggest how to fix it?<br/><br/>Best regards<br/><br/>David</p> </span><hr class="sig">DavidWed, 25 Nov 2009 15:42:58 Z2009-11-26T10:22:25Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/5503831d-47f7-4e77-9dd5-7eed8233ba1fhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/5503831d-47f7-4e77-9dd5-7eed8233ba1fGennady46http://social.msdn.microsoft.com/Profile/ja-JP/?user=Gennady46ActiveX Control Project : ProccessingProgressBar.Hi, I downloaded sample project MyActiveX . It is a progressing bar control. When I build in DEBUG folder is success. But in RELEASE folder Error: It says it cannot find MyActiveX.dll file. I am not suppose to have this file to begin with.  Can anyone tell me how to fix this. The reason I need to build to release folder so that I can open it with ActiveX Control Pad.<br/><br/>Thanks in advance, G.G.<br/> Wed, 18 Nov 2009 04:33:53 Z2009-11-26T10:12:15Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/70a98e70-e551-498e-93a7-d9aa5f5e5016http://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/70a98e70-e551-498e-93a7-d9aa5f5e5016metamofiahttp://social.msdn.microsoft.com/Profile/ja-JP/?user=metamofiarenaming a file in c++<pre>void CMyApp::OnFileSaveas() { // TODO: Add your command handler code here FILE *fs; errno_t err; static CString szFilter; char hdr[3]; char String[30]; int i; long position = 0; unsigned short sav_data; szFilter = &quot;BMP (*.bmp)|*.bmp||&quot;; CFileDialog FileSavedlg(FALSE, LPCTSTR(&quot;bmp&quot;), NULL, OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY, LPCTSTR(szFilter)); if (FileSavedlg.DoModal() == IDOK) { pen = false; man_segment_select = false; //Don't set the flag for Selecting region manually for Segmentation const size_t StringSize = 100; size_t CharactersConverted = 0; char filename[StringSize]; wcstombs_s(&amp;CharactersConverted, filename, FileSavedlg.GetFileName().GetLength()+1, FileSavedlg.GetFileName(), _TRUNCATE); if ((err = fopen_s(&amp;fs, filename, &quot;wb+&quot;)) != 0) { printf(&quot;Cannot open binary file. &quot;); fclose(fs); } else { //**************************************************************************************** if (bmp_count == 24){ if (no_of_rows == 256 &amp;&amp; no_of_cols == 256) { for (i=0; i&lt;256*256; i++) { fputc (image256[i], fs); fputc (image256[i], fs); fputc (image256[i], fs); } } else if (no_of_rows == 512 &amp;&amp; no_of_cols == 512) { for (i=0; i&lt;512*512; i++) { fputc (image[i], fs); fputc (image[i], fs); fputc (image[i], fs); } } } else if (bmp_count == 8){ if (no_of_rows == 256 &amp;&amp; no_of_cols == 256) { for (i=0; i&lt;256*256; i++) { fputc (image256[i], fs); } } else if (no_of_rows == 512 &amp;&amp; no_of_cols == 512) { for (i=0; i&lt;512*512; i++) { fputc (image[i], fs); } } } } //**************************************************************************************** fclose(fs); fclose(fbmap2); remove(&quot;New.bmp&quot;); } }</pre> Hi all, im working on a save as dialog box for my MFC application.<br/><br/>Right now i got trouble renaming a file to what the user keyed in the dialog box. In other words, i have a file called new.bmp but i want it to be rename it into 'john.bmp' IF the user keyed to save the file as 'john' in the dialog box. <br/><br/>Here is my code:<br/><br/>Fri, 20 Nov 2009 01:31:23 Z2009-11-26T09:38:06Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/7acd8fb0-5329-4bbe-ba1a-06afa8b3b58dhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/7acd8fb0-5329-4bbe-ba1a-06afa8b3b58dMedinochttp://social.msdn.microsoft.com/Profile/ja-JP/?user=MedinocBest practices regarding DLLs and __stdcallHi,<br/> I am currently writing DLLs in C and C++, and know that exported functions should have the __stdcall calling convention. However, I wonder how I should write it:<br/> <ul> <li>WINAPI?</li> <li>APIENTRY?</li> <li>STDMETHODCALLTYPE?</li> <li>No define at all, just type __stdcall?</li> <li>A custom #define?</li> </ul> Is there any recommended practice for this?<br/> <br/> <strong>Note:</strong> I'm not talking about the declspecs/dllimport/dllexport here; I already use DLLNAME_API for that.Thu, 26 Nov 2009 09:37:58 Z2009-11-26T09:37:59Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/12e9001d-a110-451b-9220-f9e1d99353dfhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/12e9001d-a110-451b-9220-f9e1d99353dfgrrakeshhttp://social.msdn.microsoft.com/Profile/ja-JP/?user=grrakeshlist::sort throws debug assertion in Visual Studio 2008.Hi,<br/><br/>In the following code snippet, a debug assertion is thrown during the &quot;sort&quot; on list. It seems to happen when the list contains two items with the same value and during comparision the &quot;CompareStrings&quot; method returns true for such condition. This behavior is observed in VS 2008. Does anyone know a reason for this debug assertion?<br/><span style="font-size:x-small"> <p>The same code snippet works fine in VS2003 environment.<br/><br/><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><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> <p><span style="font-size:x-small"> </span><span style="font-size:x-small;color:#a31515"><span style="font-size:x-small;color:#a31515">&lt;iostream&gt;</span></span></p> <span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><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="font-size:x-small;color:#a31515"><span style="font-size:x-small;color:#a31515">&lt;list&gt;</span></span></p> <span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><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="font-size:x-small;color:#a31515"><span style="font-size:x-small;color:#a31515">&lt;string&gt;</span></span></p> <span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><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="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">namespace</span></span><span style="font-size:x-small"> std; <p> </p> </span></p> <span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><font size=2 color="#0000ff"><font size=2 color="#0000ff"> <p>class</p> </font></font></span><font size=2 color="#0000ff"> <p> </p> </font></span> <p><span style="font-size:x-small"> StringOperations <p>{</p> </span></p> <span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><font size=2 color="#0000ff"><font size=2 color="#0000ff"> <p>private</p> </font></font></span><font size=2 color="#0000ff"> <p> </p> </font></span> <p><span style="font-size:x-small">:<font size=2> <p> </p> </font></span></p> <p><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">typedef</span></span><span style="font-size:x-small"> list&lt;string&gt; StringList;<font size=2> <p> </p> </font></span></p> <p><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">static</span></span><span style="font-size:x-small"> </span><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">bool</span></span><span style="font-size:x-small"> CompareStrings(string a, string b) <p>{</p> <font size=2> <p> </p> </font></span></p> <p><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">return</span></span><span style="font-size:x-small"> (a.compare(b)&lt;=0); </span><span style="font-size:x-small;color:#008000"><span style="font-size:x-small;color:#008000">// This comparision is throwing debug assertion.</span></span></p> <span style="font-size:x-small"><font size=2> <p> </p> </font></span> <p><span style="font-size:x-small;color:#008000"><span style="font-size:x-small;color:#008000">//return (a.compare(b)&lt;0); // This works fine. </span></span></p> <span style="font-size:x-small"> <p> </p> <p>}</p> </span><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><font size=2 color="#0000ff"><font size=2 color="#0000ff"> <p>public</p> </font></font></span><font size=2 color="#0000ff"> <p> </p> </font></span> <p><span style="font-size:x-small">:<font size=2> <p> </p> </font></span></p> <p><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">void</span></span><span style="font-size:x-small"> SortList() <p>{</p> <p>StringList list1;</p> <p>list1.clear();</p> <font size=2> <p>list1.push_back(</p> </font></span></p> <p><span style="font-size:x-small;color:#a31515"><span style="font-size:x-small;color:#a31515">&quot;abc&quot;</span></span><span style="font-size:x-small">);<font size=2> <p>list1.push_back(</p> </font></span></p> <p><span style="font-size:x-small;color:#a31515"><span style="font-size:x-small;color:#a31515">&quot;back&quot;</span></span><span style="font-size:x-small">);<font size=2> <p>list1.push_back(</p> </font></span></p> <p><span style="font-size:x-small;color:#a31515"><span style="font-size:x-small;color:#a31515">&quot;tap&quot;</span></span><span style="font-size:x-small">);<font size=2> <p>list1.push_back(</p> </font></span></p> <p><span style="font-size:x-small;color:#a31515"><span style="font-size:x-small;color:#a31515">&quot;abc&quot;</span></span><span style="font-size:x-small">);<font size=2> <p>list1.push_back(</p> </font></span></p> <p><span style="font-size:x-small;color:#a31515"><span style="font-size:x-small;color:#a31515">&quot;dud&quot;</span></span><span style="font-size:x-small">);<font size=2> <p>cout &lt;&lt;</p> </font></span></p> <p><span style="font-size:x-small;color:#a31515"><span style="font-size:x-small;color:#a31515">&quot;Before sorting: list1 =&quot;</span></span><span style="font-size:x-small">; <p>DiaplayList(list1);</p> <p>list1.sort(CompareStrings);</p> <font size=2> <p>cout &lt;&lt;</p> </font></span></p> <p><span style="font-size:x-small;color:#a31515"><span style="font-size:x-small;color:#a31515">&quot;After sorting: list1 =&quot;</span></span><span style="font-size:x-small">; <p>DiaplayList(list1);</p> <p>}</p> </span></p> <span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><font size=2 color="#0000ff"><font size=2 color="#0000ff"> <p>public</p> </font></font></span><font size=2 color="#0000ff"> <p> </p> </font></span> <p><span style="font-size:x-small"> :<font size=2> <p> </p> </font></span></p> <p><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">void</span></span><span style="font-size:x-small"> DiaplayList(StringList&amp; c1) <p>{</p> <font size=2> <p> </p> </font></span></p> <p><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">typedef</span></span><span style="font-size:x-small"> list&lt;string&gt;::iterator StringList_Iter; <p>StringList_Iter c1_Iter ;</p> <font size=2> <p> </p> </font></span></p> <p><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">for</span></span><span style="font-size:x-small"> ( c1_Iter = c1.begin( ); c1_Iter != c1.end( ); c1_Iter++ )<font size=2> <p>cout &lt;&lt;</p> </font></span></p> <p><span style="font-size:x-small;color:#a31515"><span style="font-size:x-small;color:#a31515">&quot; &quot;</span></span><span style="font-size:x-small"> &lt;&lt; *c1_Iter; <p>cout &lt;&lt; endl;</p> <p>}</p> <p>};</p> </span></p> <span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><font size=2 color="#0000ff"><font size=2 color="#0000ff"> <p>int</p> </font></font></span><font size=2 color="#0000ff"> <p> </p> </font></span> <p><span style="font-size:x-small"> main() <p>{</p> <p>StringOperations xlist;</p> <p>xlist.SortList();</p> <font size=2> <p> </p> </font></span></p> <p><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">return</span></span><span style="font-size:x-small"> 0; <p>}<br/><br/><br/>thanks in advance.</p> </span></p> </span>Wed, 25 Nov 2009 07:09:46 Z2009-11-26T09:09:06Zhttp://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/5fe47e60-d8e1-4e0a-8a12-70113b906e55http://social.msdn.microsoft.com/Forums/ja-JP/vclanguage/thread/5fe47e60-d8e1-4e0a-8a12-70113b906e55ngs_bugkillerhttp://social.msdn.microsoft.com/Profile/ja-JP/?user=ngs_bugkillerAbout Heap ErrorI am working on my project in VC++2005 Express Edition on Windows Vista Home Basic. While optimizing my project I added a structure to my class. After this the project began to crash . But the unique this was it was crashing after giving the result and during the freeing of all the resources. The output is coming as per desired. Also i tied to use page heap .exe but I think they dont work on Vista systems. Plz help me??Thu, 26 Nov 2009 06:28:12 Z2009-11-26T07:43:28Z