Visual C++ Language ForumIssues 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.Sun, 29 Nov 2009 10:53:26 Z5ac7f30f-4625-4162-bdbb-2416a72b7047http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/a54e62f1-71be-4a0d-994b-ac7971f0272bhttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/a54e62f1-71be-4a0d-994b-ac7971f0272bIvoahttp://social.msdn.microsoft.com/Profile/en-US/?user=IvoaHow to add (concatenate) a character at the end of a stringHi every one,<br/> I want to add a character at the end of all the values of my matrix, but I'm not sure how to do it. I wrote this code :<br/> <pre lang=x-cpp>std::vector&lt;std::vector&lt;std::string&gt; &gt; TextData::AddNoise(char noise) { std::vector&lt;std::vector&lt;std::string&gt; &gt; l_mResult; for(int i = 0; i &lt; m_iNBColumn; i++) { std::vector&lt;std::string&gt; l_vColumn; for(int j = 0; j &lt; m_iNBRow ; j++) { l_vColumn.push_back(m_Matrix[i][j] + noise); } l_mResult.push_back(l_vColumn); } return l_mResult; }</pre> When I compiled, I got these errors :<br/> <span class="medium_text"><span style="background-color:#ffffff" title="error C2676: '+' binaire : 'std::basic_string&lt;_Elem,_Traits,_Ax&gt;' ne définit pas cet opérateur ou une conversion vers un type acceptable pour l'opérateur prédéfini">error C2676: '+' binary 'std:: basic_string &lt;_Elem,_Traits,_Ax&gt;' does not define this operator or a conversion to a type acceptable to the predefined operator</span> </span> <br/> <span class="long_text"><span style="background-color:#ffffff" title="error C2784: 'std::_Revranit&lt;_RanIt,_Base&gt; std::operator +(_Diff,const std::_Revranit&lt;_RanIt,_Base&gt; &amp;)' : impossible de déduire l'argument modèle pour 'const std::_Revranit&lt;">error C2784: 'std:: _Revranit &lt;_RanIt,_Base&gt; std:: operator + (_Diff, const std:: _Revranit &lt;_RanIt,_Base&gt; &amp;)': could not deduce template argument for 'const std:: _Revranit &lt; </span> <span title="_RanIt,_Base&gt; &amp;' à partir de 'std::string'">_RanIt, _base&gt; &amp; 'from' std:: string ' <br/> </span> <span style="background-color:#ffffff" title="ity(2003) : voir la déclaration de 'std::operator +'">ity (2003): see declaration of 'std:: operator +'</span> </span> <br/> <br/> Would you please help me ?<br/> Thanks in advance !<br/>Sun, 29 Nov 2009 10:16:49 Z2009-11-29T10:29:22Zhttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/54406bd2-65b7-41b1-89bb-43b55d73747fhttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/54406bd2-65b7-41b1-89bb-43b55d73747fMegaauhttp://social.msdn.microsoft.com/Profile/en-US/?user=MegaauCreate Desktop Side bar using VC++ ATL MFCHi,<br/>   I want to create a desktop side bar for Windows xp and Vista like a google desktop using VC++ MFC ATL so pls give me a way to create this application.<br/> Thanks.<br/>Sun, 01 Nov 2009 11:46:24 Z2009-11-29T10:10:19Zhttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/d6e77f79-d8ee-4e84-97c3-0782876145echttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/d6e77f79-d8ee-4e84-97c3-0782876145ecjp071http://social.msdn.microsoft.com/Profile/en-US/?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-29T09:57:41Zhttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/86620f11-7e32-45d3-9c69-f21a59f3d30bhttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/86620f11-7e32-45d3-9c69-f21a59f3d30bmsn92http://social.msdn.microsoft.com/Profile/en-US/?user=msn92MFC: Uploading a file using CInternetSessionHi everybody<br/> <br/> I'm uploading a file using CInternetSession, CHttpConnection and CHttpFile.<br/> The program is working properly, but I don't know how to track the data sent/left (percentage done):<br/> <br/> <pre lang=x-cpp>CInternetSession ises = NULL; CHttpFile* httpf = NULL; CHttpConnection *connection = NULL; file=new CFile(L&quot;file2upload.txt&quot;,CFile::modeRead); connection = ises.GetHttpConnection(L&quot;myserver.com&quot;); http = connection-&gt;OpenRequest(CHttpConnection::HTTP_VERB_POST, L&quot;upload.php&quot;,0,1,0,0,INTERNET_FLAG_KEEP_CONNECTION); CString hdrs /* = My appropriate headers to send */; httpf-&gt;AddRequestHeaders(hdrs); PreFileData /* = prefile data */; PostFileData /* = postfile data */; httpf-&gt;SendRequestEx(DWORD(PreFileData.GetLength()+file-&gt;GetLength()+PostFileData.GetLength()), HSR_SYNC | HSR_INITIATE); httpf-&gt;Write((LPSTR)(LPCSTR)PreFileData, PreFileData.GetLength()); UINT len=1024; char buf[1024]; /*BUFFER SIZE = 1024 HOW BIG ACTUALLY SHOULD IT BE?*/ while(len&gt;0){ len=f-&gt;Read(&amp;buf,1024); if(len&gt;0)httpf-&gt;Write(&amp;buf,len); } httpf-&gt;Write((LPSTR)(LPCSTR)PostFileData, PostFileData.GetLength()); httpf-&gt;EndRequest(HSR_SYNC); file-&gt;Close(); httpf-&gt;Close(); connection-&gt;Close();</pre> But how can I track the percent done?<br/> I overrode CInternetSession::OnStatusCallBack(). <br/> <br/> <br/> This is what I get:<br/> 1) Nothing is sent until CHttpFile::EndRequest() called.<br/> 2) When CHttpFile::EndRequest() called, it starts sending data.  CInternetSession::OnStatusCallBack()'s  dwInternetStatus is equal to INTERNET_STATUS_RECEIVING_RESPONSE.<br/> 3) It wait's until all the data is sent.<br/> <br/> So how can I know how much of the file is sent/left while it is sending the data(during EndRequest())?Sat, 28 Nov 2009 20:21:56 Z2009-11-29T08:42:02Zhttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/9b143f93-62f3-42be-a9f4-ee6ec22660eehttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/9b143f93-62f3-42be-a9f4-ee6ec22660eerhitamhttp://social.msdn.microsoft.com/Profile/en-US/?user=rhitamMicrosoft Visual C++ 2008 Express gets function skipped inside class method definition Hi all , <div><br/></div> <div>I searched in google a lot but couldnt find a solution . I am using Microsoft Visual C++ 2008 Express Edition with SP1 - ENU,windows vista home edition   and trying to create a Win32 console App( not CLR) . I am facing a weird problem with the gets function. When i directly use it in the _tmain function  like this :</div> <div><br/></div> <div> <div style="color:Black;background-color:White"> <pre><span style="color:Blue">int</span> _tmain(<span style="color:Blue">int</span> argc, _TCHAR* argv[]) { <span style="color:Blue">char</span> name[30]; <span style="color:Blue">int</span> age; gets(name); cin&gt;&gt;age; cout&lt;&lt;name&lt;&lt;age; } </pre> </div> The above code works perfectly fine . But when i try to use inside a class methos definition , Like this :</div> <div><br/></div> <div> <pre>class bus { char name[30]; public: void inputdata(int); }; void bus::inputdata(int sn) { cout&lt;&lt;&quot;Input Name? &quot;; gets(name); char gender; cout&lt;&lt;&quot;input gender?&quot;; cin&gt;&gt;gender; } int _tmain(int argc, _TCHAR* argv[]) { bus a; a.inputdata(); }</pre> <br/></div> <div>at this point , the gets function is simply ignored  and the output is  :</div> <div><br/></div> <div>Input name?  Input gender? (without waiting for me to enter the value for name). I have tried fgets and cin.getline also. Both have the same problem. For reasons difficult to explain , I HAVE  to use  null terminated array of characters and cannot use the string data type provided by &quot;string.h&quot;  library .</div> <div><br/></div> <div>Any help would be appreciated. </div> <div><br/></div> <div><br/></div> <div>Thanks and  regards,</div> <div>Rhitam</div> <div><br/></div> <div><br/></div> <hr class=sig> rhitamSun, 29 Nov 2009 07:01:35 Z2009-11-29T07:01:35Zhttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/5caf748c-7bf9-467c-8d33-d0fbb9bb1077http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/5caf748c-7bf9-467c-8d33-d0fbb9bb10773unj800http://social.msdn.microsoft.com/Profile/en-US/?user=3unj800AlphaBlend example please?Hi,<br/> I've been having a lot of trouble with the AlphaBlend function. Could someone please post an example so I know how it's done?<br/> I need the example to involve loading a 32-bit bitmap with LoadImage, and drawing it multiple times to demonstrate the semi-transparency of the bitmap. Also, please don't use MFC, it's very confusing to me!<br/> Thanks in advance!Sat, 28 Nov 2009 16:57:14 Z2009-11-29T06:03:58Zhttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/e53fe667-f383-4053-a3d5-db1e3918a678http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/e53fe667-f383-4053-a3d5-db1e3918a678Fatalis Programmerhttp://social.msdn.microsoft.com/Profile/en-US/?user=Fatalis%20ProgrammerError Problem: 'System::String' : cannot use this type here without a top-level '^'__<p>I get this error and Ive tried everything can anyone tell me what I'm doing wrong, I'm a total begginer in visual c++ 2008. Here is the code below:<br/><span style="font-size:x-small"> <p>String Program;</p> <p>Program == textBox1-&gt;Text;</p> <p>Process::Start(Program);</p> </span></p>Sun, 29 Nov 2009 02:20:14 Z2009-11-29T05:26:35Zhttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/b881454e-9d18-4210-bfb6-7a3c2883c496http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/b881454e-9d18-4210-bfb6-7a3c2883c496Balaji MS CShttp://social.msdn.microsoft.com/Profile/en-US/?user=Balaji%20MS%20CSdebug process of warning in vc 2005is it possible to leave the debug process of warning in vc 2005 because in my program nearly 2000 warnings it takes long time to complete approx 20 minutesThu, 01 Oct 2009 20:32:17 Z2009-11-29T05:03:54Zhttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/ab0e4d86-e907-43d8-b5df-e9eadf481abehttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/ab0e4d86-e907-43d8-b5df-e9eadf481abesengottian.ehttp://social.msdn.microsoft.com/Profile/en-US/?user=sengottian.eConversion of control character (þ) toupper fails for a particular user profileHi Everyone,<br/> <br/> Could any one of you help me out. Our application is developed using Visual C++ (Visual studio 6.0) . All our machines uses Windows XP enterprise edition.we use many Dlls in our application. In that application we use a customised database file system .For database retrieval and updation we make use of some control characters(ie .128 to 256 ) .<br/> <br/> It involves code to convert the 'þ' to upper case .The value of 'þ' is 254. so as result of conversion to upper case we should get 'Þ' whose value is 222.But we dint get the expected.instead we got the value same 254(the same character 'þ').The problem is specific to particular user profile.<br/> <br/> In another user login on the same machine, when the code is executed i got the value 222, 'Þ' for 'þ'.i.e the conversion to upper case works as expected.for same code i had two different values for different user profiles.I searched and found the toupper(x) is dependent on msvcrt.dll.Later on i remembered that in our application we use Outsidex.ocx an oracle outside in technology this depends on MSVcr80.dll  so is there any conflicts of using msvcrt.dll and msvcr80.dll . <br/> <br/> But we uninstalled outsidex.ocx and tried in faulty user profile, it works fine with out any issues. My question is How does MSVcr80.dll affect the &quot;toupper(x)&quot; functionality and that too user specific . We are clue less regarding this. Thanks in advance.Sun, 22 Nov 2009 16:49:40 Z2009-11-29T00:55:28Zhttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/b5071a1a-f44d-4c31-81eb-0eee010ea03fhttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/b5071a1a-f44d-4c31-81eb-0eee010ea03fHewwatt Xuhttp://social.msdn.microsoft.com/Profile/en-US/?user=Hewwatt%20Xuno exception was thrown nor does app crashed when invalid/dangling pointer was deleted, why?<div>code snippet as follows:</div> <div><br/></div> <div>#include &lt;stdio.h&gt;</div> <div>static int myCount = 0;</div> <div>class XXX{</div> <div>public:</div> <div><span style="white-space:pre"> </span>XXX(){}</div> <div><span style="white-space:pre"> </span>~XXX(){++myCount;}</div> <div>};</div> <div>int main(int argc, char* argv[])</div> <div>{</div> <div><span style="white-space:pre"> </span>XXX* myPointer = 0;</div> <div><span style="white-space:pre"> </span>try{</div> <div><span style="white-space:pre"> </span>myPointer = new XXX;</div> <div><span style="white-space:pre"> </span>delete myPointer;</div> <div><span style="white-space:pre"> </span>puts(&quot;valid pointer deleted&quot;);</div> <div><span style="white-space:pre"> </span>delete myPointer;</div> <div><span style="white-space:pre"> </span>puts(&quot;dangling pointer deleted?!&quot;);</div> <div><span style="white-space:pre"> </span>myPointer = (XXX*)(argv[0]);</div> <div><span style="white-space:pre"> </span>delete myPointer;</div> <div><span style="white-space:pre"> </span>puts(&quot;invalid pointer deleted?!&quot;);</div> <div><span style="white-space:pre"> </span>}catch(...){</div> <div><span style="white-space:pre"> </span>puts(&quot;catched&quot;);</div> <div><span style="white-space:pre"> </span>}</div> <div><span style="white-space:pre"> </span>printf(&quot;myCount:%d\r\n&quot;, myCount);</div> <div><span style="white-space:pre"> </span>return 0;</div> <div>}</div> <div><br/></div> <div>and output is as follows:</div> <div> <div><br/></div> <div>valid pointer deleted</div> <div>dangling pointer deleted?!</div> <div>invalid pointer deleted?!</div> <div>myCount:3</div> <div><br/></div> </div> <div><br/></div> <div>This can be produced by VC6.0+sp6. Is this a bug of VC6 compiler?</div> <div>Why an invalid pointer or dangling pointer could be 'deleted' with NO </div> <div>exception thrown nor a crashed app?</div> <div><br/></div> <div>Thanks for any help in advance!</div> <div><br/></div> <div><br/></div> <div><br/></div> <div>Hewwatt Xu.</div> <div><br/></div> <div><br/></div>Sat, 28 Nov 2009 12:32:18 Z2009-11-28T23:59:47Zhttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/a575e887-4be5-47ce-8966-d2d1a596b4eehttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/a575e887-4be5-47ce-8966-d2d1a596b4eePoZhttp://social.msdn.microsoft.com/Profile/en-US/?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-28T19:04:05Zhttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/4a2cf062-83aa-4307-96de-43c36d86cb74http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/4a2cf062-83aa-4307-96de-43c36d86cb74KARTHIKA ARUhttp://social.msdn.microsoft.com/Profile/en-US/?user=KARTHIKA%20ARUC PROGRAMHOW TO USE A LETTER S FOR SCANF IN #DEFINE PREPOSSEROR DIRECTIVESat, 28 Nov 2009 07:52:14 Z2009-11-28T16:47:15Zhttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/f13cc816-b790-4c69-9bca-aa4add44f9f1http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/f13cc816-b790-4c69-9bca-aa4add44f9f1Michael.H.Tanghttp://social.msdn.microsoft.com/Profile/en-US/?user=Michael.H.TangProcess was hanged due CFtpConnection::GetFile()Hello All,<br/><br/>I created a code and tried to download a file from FTP site (e.g. <a href="ftp://ftp.microsoft.com">ftp.microsoft.com</a>), But the process was hanged. <br/><br/> <div style="background-color:white;color:black"> <pre> CString m_strFileName(<span style="color:#a31515">&quot;myftp.txt&quot;</span>); CFileFind find; CInternetSession *m_pInetSession; CFtpConnection *m_pFtpConnection; <span style="color:blue">if</span> (find.FindFile(m_strFileName)) { CFile::Remove(m_strFileName); } m_pInetSession = <span style="color:blue">new</span> CInternetSession(<span style="color:#a31515">&quot;DownloadFile/1.0&quot;</span>); <span style="color:blue">try</span> { m_pFtpConnection = m_pInetSession-&gt;GetFtpConnection(<span style="color:#a31515">&quot;ftp.microsoft.com&quot;</span>); <span style="color:blue">if</span> (m_pFtpConnection-&gt;GetFile(<span style="color:#a31515">&quot;/developr/adc/index.txt&quot;</span>,m_strFileName)) { AfxMessageBox(<span style="color:#a31515">&quot;Successful&quot;</span>); } <span style="color:blue">else</span> { AfxMessageBox(<span style="color:#a31515">&quot;Failure&quot;</span>); } m_pFtpConnection-&gt;Close(); m_pInetSession-&gt;Close(); } <span style="color:blue">catch</span>(CInternetException *pEx) { TCHAR szError[1024]; <span style="color:blue">if</span>(pEx-&gt;GetErrorMessage(szError,1024)) AfxMessageBox(szError); <span style="color:blue">else</span> AfxMessageBox(<span style="color:#a31515">&quot;There was an exception&quot;</span>); pEx-&gt;Delete(); m_pFtpConnection=NULL; } </pre> </div> <br/>The problem is the local file was created but the process was hanged at GetFile(). However, once the remote file name was changed to a no-existed file name (e.g. /developr/adc/indexxx.txt), message &quot;Failure&quot; will be received.<br/><br/>Could you please tell me what is wrong in the code? Thanks!<br/><br/>Best Regards<br/><br/>MichaelSat, 28 Nov 2009 15:55:41 Z2009-11-28T15:55:41Zhttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/d9694c7d-9ba6-4f01-babf-4adafb61bc5bhttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/d9694c7d-9ba6-4f01-babf-4adafb61bc5bSandeep Patrahttp://social.msdn.microsoft.com/Profile/en-US/?user=Sandeep%20PatraMemory Leak while repeatedly writting to the log fileHi All,<br/>I have written a small code for writting a simple Line to a log file repeatedly.<br/><br/>below is my code<br/><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"> <p><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></p> <pre lang=x-cpp>#include &lt;windows.h&gt; #include &lt;stdio.h&gt; #include &lt;string.h&gt; #include &lt;stdarg.h&gt; #define LOGFILE &quot;C:\\mem_leak.txt&quot; int WriteToLog(const char* str,...) { FILE* log; va_list ap; va_start(ap, str); log = fopen(LOGFILE, &quot;a+&quot;); if (log == NULL) { return -1; } vfprintf(log, str, ap); fclose(log); va_end(ap); return 0; } int main() { static int i =0; while (1) { if (-1 == WriteToLog(&quot;Memory Leak [%d]\n&quot;, ++i)) { return -1; } Sleep(5); } return 0; } </pre> <p><br/><br/>But when run this program and checked the memory usage, its memory usage increases with time.<br/>Is there any memory leak? If then, please help me in this regard.<br/><br/>&gt; If I use printf instead of writting it to the file, memory does not increases with time<br/><br/>&gt; If I open the file out of the while loop (i.e. before while loop) and closes the file after while loop. then also momory does not increases with time.<br/><br/>Is there any issue with the fopen() call? if we use it repeatedly inside a while loop?<br/><br/>Thanks and Regards,<br/>Sandeep Kumar Patra</p> </span></span></span></span>Tue, 24 Nov 2009 11:03:07 Z2009-11-28T14:02:45Zhttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/69257990-bef7-42bc-951b-eeb0ad5f0aa8http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/69257990-bef7-42bc-951b-eeb0ad5f0aa8sat1231http://social.msdn.microsoft.com/Profile/en-US/?user=sat1231Linking error in the c codeHi all,<br/><br/>I wrote code in embedded c i have done all prototype,defination,declaration but still linking error is coming.ie undefined externals its telling. Please help me to sort out this problem<br/>Thank you<br/>SateeshSat, 28 Nov 2009 12:08:30 Z2009-11-28T12:33:27Zhttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/bc768e63-1ef0-48eb-8f3b-8a7fe2bed660http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/bc768e63-1ef0-48eb-8f3b-8a7fe2bed660tarunkrhttp://social.msdn.microsoft.com/Profile/en-US/?user=tarunkrHow to change a specific folder background color in VistaHi,<br/> <br/> I want to change a specific folder background color in vista. In XP, i am using Desktop.ini <br/> <br/> concept to do this job but this concept is not working in Vista.<br/> I don't want to use any software for this job. I want to achieve this either using any <br/> <br/> scripting or COM ( Shell extension) dll concept. I searched for any Shell Interface for <br/> <br/> this but no luck.<br/> Please can anybody guide me in this regard..<br/> <br/> Thanks a lot in advance.<br/> Tarun.Tue, 10 Nov 2009 09:01:09 Z2009-11-28T10:50:36Zhttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/b0271379-3ab1-4e08-af9e-d4f51fe8de79http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/b0271379-3ab1-4e08-af9e-d4f51fe8de79Roman__http://social.msdn.microsoft.com/Profile/en-US/?user=Roman__LNK1201 Error at every buildHello, <br/> I have this problem:<br/> When i open a specific project, i build it first time and it goes ok, after i modify it, build again - and it gives me <br/> <em>LINK : fatal error LNK1201: error writing to program database 'c:\..\***.pdb'; check for insufficient disk space, invalid path, or insufficient privilege</em> <br/> The only solution to avoid this is to close VS, and to re-open the project, in this way i am able to build it one time again (after first build, close again, ect), and it is really annoying.<br/> This problem seems to be not related to a particular project (VS on other machines compile it correctly), nienther to this particular machine (other similar projects don't give this problem), but it happens everytime on this machine with this project.<br/> <br/> I am using VS 2003, launched with Administrator rights.<br/> Any help will be appreciated, <br/> ThanksWed, 23 Sep 2009 13:45:13 Z2009-11-28T10:27:54Zhttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/e58ddab0-0b21-4dbe-96c0-22cb4123fcfehttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/e58ddab0-0b21-4dbe-96c0-22cb4123fcfeShiv1983http://social.msdn.microsoft.com/Profile/en-US/?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-28T10:13:16Zhttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/16089dbc-d994-47ce-94f4-6561b1050999http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/16089dbc-d994-47ce-94f4-6561b1050999胡小林http://social.msdn.microsoft.com/Profile/en-US/?user=%u80e1%u5c0f%u6797yhh gfdgdSat, 28 Nov 2009 06:32:41 Z2009-11-28T06:32:42Zhttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/ee459d39-733f-4e2d-8d52-bbc3e35dac4dhttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/ee459d39-733f-4e2d-8d52-bbc3e35dac4dLilProblemshttp://social.msdn.microsoft.com/Profile/en-US/?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/en-US/vclanguage/thread/239cb18f-5ae4-462e-bad3-ff50cdd3c275http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/239cb18f-5ae4-462e-bad3-ff50cdd3c275Nano HEhttp://social.msdn.microsoft.com/Profile/en-US/?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/en-US/vclanguage/thread/23ef740b-ea9d-4908-b4a4-7d5e5f93e4c2http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/23ef740b-ea9d-4908-b4a4-7d5e5f93e4c2miclushttp://social.msdn.microsoft.com/Profile/en-US/?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/en-US/vclanguage/thread/a6811087-18b8-43a0-830d-7e88970e004ehttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/a6811087-18b8-43a0-830d-7e88970e004emiclushttp://social.msdn.microsoft.com/Profile/en-US/?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/en-US/vclanguage/thread/5ca20291-66d4-41df-927b-81a2cc35b026http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/5ca20291-66d4-41df-927b-81a2cc35b026carl89_Phttp://social.msdn.microsoft.com/Profile/en-US/?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/en-US/vclanguage/thread/7eed3a60-4c6d-4454-bff4-df850beedbd6http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/7eed3a60-4c6d-4454-bff4-df850beedbd6Regnwaldhttp://social.msdn.microsoft.com/Profile/en-US/?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/en-US/vclanguage/thread/c5f94582-c8ff-4d2f-88bc-1d8ee5782174http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/c5f94582-c8ff-4d2f-88bc-1d8ee5782174Augusto Martinshttp://social.msdn.microsoft.com/Profile/en-US/?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/en-US/vclanguage/thread/9334107c-b5b5-40c9-9d1a-a4234d46b08ehttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/9334107c-b5b5-40c9-9d1a-a4234d46b08estra4dhttp://social.msdn.microsoft.com/Profile/en-US/?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/en-US/vclanguage/thread/6770a87c-42e4-4ac2-ab70-d63cdef862fahttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/6770a87c-42e4-4ac2-ab70-d63cdef862fahoneyryderChuckhttp://social.msdn.microsoft.com/Profile/en-US/?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/en-US/vclanguage/thread/74f8daaf-dc00-4fd9-94bf-0f16f05a4e4ahttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/74f8daaf-dc00-4fd9-94bf-0f16f05a4e4aJude_BigJhttp://social.msdn.microsoft.com/Profile/en-US/?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/en-US/vclanguage/thread/86d60a8a-9c02-4a46-90be-14be792a6565http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/86d60a8a-9c02-4a46-90be-14be792a6565Rudreshhttp://social.msdn.microsoft.com/Profile/en-US/?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/en-US/vclanguage/thread/0a360ca6-c89b-4ba0-b4c5-87df1a3d2b7ahttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/0a360ca6-c89b-4ba0-b4c5-87df1a3d2b7aMegaauhttp://social.msdn.microsoft.com/Profile/en-US/?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/en-US/vclanguage/thread/4bb4315a-b7a8-4224-b8e9-903c040b6eefhttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/4bb4315a-b7a8-4224-b8e9-903c040b6eefMegaauhttp://social.msdn.microsoft.com/Profile/en-US/?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/en-US/vclanguage/thread/ed531448-50c4-4aad-842b-8ff086d5c4f7http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/ed531448-50c4-4aad-842b-8ff086d5c4f7Megaauhttp://social.msdn.microsoft.com/Profile/en-US/?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/en-US/vclanguage/thread/7d6d0783-292b-40fd-acc5-aa0c230485d6http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/7d6d0783-292b-40fd-acc5-aa0c230485d6trioumhttp://social.msdn.microsoft.com/Profile/en-US/?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/en-US/vclanguage/thread/cfd39340-9003-4de9-b06c-16a1d39794d3http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/cfd39340-9003-4de9-b06c-16a1d39794d3Lim Bio Lionghttp://social.msdn.microsoft.com/Profile/en-US/?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/en-US/vclanguage/thread/34c7037d-5dc1-4910-a2c2-a788265135dfhttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/34c7037d-5dc1-4910-a2c2-a788265135dfquoiurehttp://social.msdn.microsoft.com/Profile/en-US/?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/en-US/vclanguage/thread/93da18fa-3bee-4488-8f02-ecff47f98de2http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/93da18fa-3bee-4488-8f02-ecff47f98de2Gennady46http://social.msdn.microsoft.com/Profile/en-US/?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/en-US/vclanguage/thread/7cb98833-7ca6-443f-a468-5f4b43f6bb9bhttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/7cb98833-7ca6-443f-a468-5f4b43f6bb9bMegaauhttp://social.msdn.microsoft.com/Profile/en-US/?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/en-US/vclanguage/thread/e6d0b86d-0cec-4b24-b2ac-fb403700f308http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/e6d0b86d-0cec-4b24-b2ac-fb403700f308Admin0389http://social.msdn.microsoft.com/Profile/en-US/?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/en-US/vclanguage/thread/7db643de-74dd-418c-aaf8-43c1ad77257chttp://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/7db643de-74dd-418c-aaf8-43c1ad77257cAli Kaim Khanihttp://social.msdn.microsoft.com/Profile/en-US/?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:52Z