Answer Questions
Nick1435 Forms and Memory usage
hi, i setup a simple Form with nothing on it and compiled it then ran the application, it was in Visual C++ Windows Form Application but when running the application it was using over 15.000k of memory. is this normal for an application of this type just seems a lot of memory for one item that does nothing. thanks Hello Deen, Please follow your previous thread at http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=596224&SiteID=1 . Thanks, Ayman Shoukry VC++ Team Please could a Moderator delete this thread as it is a double post and the answer was solved in another section on this forum. thanks and sorry for the double post thanks, i was looking for that earlier but didnt know where it went. ...Show All
Kshama A strange error
I have been working on a simple pathfinding program using the A* algorithm. I originally started using std::priority_queue and std::list for the open and closed lists respectfully. Then I got this error message during debug. http://adamwlarson.com/pictures/errormessage.JPG So I switched to a LinkedList class and and created a function that orders them in the correct order, but no luck I still get the same error. The next thing I tried was adding a logging class so I could track through the program since all my attempts at debugging didn't work. I found out the path is being found everytime, so the algorithm works. Oh I forgot to mention I have to run the program in Release mode since I get that error above anytime I run the debug ver ...Show All
wadnerk Identification of object id at run time.
Hello Gents, I have developing one win32 application.In this application, I was created 5 no of static control at run time. Then i was selected and track any one object from the group of objects using mouse pointer. Now, how can i identify the object id selected by mouse ( OnLButtonDown function ) Thanks and Regards, K.Vishvanathan. Please see articles such as http://www.codeproject.com/dialog/windowfinder.asp . Also note that this question is not within the scope of this forum, as this covers merely C++ language related questions. In the future, please direct UI and MFC questions to the respective newsgroups at http://msdn.microsoft.com/newsgroups . OTP. ...Show All
Tyler Frugia Error Compiling Generic Function with Constraint
I'm trying to return a nullptr from a generic function in C++/CLI and I am receiving the following error: error C2440: 'return' : cannot convert from 'nullptr' to 'T' 'T' may be a value type at runtime: consider using 'T()' instead I wrote the following C# and C++ classes to test the difference. The code compiled and ran in C# but the code will not compile in C++/CLI. Here’s the C# code: using System; using System.Collections.Generic; using System.Text; namespace TestGenerics { class Program { static void Main( string[] args ) { Something st = new Something(); string s = st.DoSomething<string>(); Console.WriteLine( "s = " ...Show All
Modeller C++/CLI - Type conversion
Hi, I'm working on a project in C++/CLI that uses some .NET classes so I need to use "ref class" instead of native "class", but I have the following problem: // If using native classes, I can write the following: class A { A(int n) { .. } }; void foo(A a) { ... } foo(10) // Automatically converts int to A But when I use "ref class" instead of "class" in this code (when declaring A) it won't compile - I think it is because the automatic conversion of int to A isn't allowed in C++/CLI. Is something similar to this automatic conversion from C++ possible for "ref classes" As a workaround I could define overload of the "foo" function for every type that can be converted to ...Show All
patio87 16 bit windows subsystem error
when trying to install vc++ 6.0 on xp sp2 machine, i get this error: "16 bit windows subsystem c:\windows\system32\autoexec.nt. the system file is not suitable for running ms-dos and ms windows applications. choose close to terminate the application." can anyone help thank you. B. John ...Show All
CJW99 Recommended solution with precompiled headers (e.g. StdAfx.obj) and link warning LNK4221
I'm creating a static library using VC8, which uses a precompiled header through StdAfx.h, which is created through StdAfx.cpp (the one that Visual Studio automagically always creates for you). That is, standard VC stuff. When Debug building the library all is fine but with for Release VC8 outputs: 1>StdAfx.obj : warning LNK4221: no public symbols found; archive member will be inaccessible What is the recommended solution for this The solutions that I've found so far is to either create the procompiled header through some other header/source file or place a dummy public symbol in StdAfx.cpp, which seems entirely silly. What is the "standard way to solve this" This happens when you turn off "precomp ...Show All
maxascent Repost-Same code compiled sucessfully on a desktop but failed on a laptop
Repost due to the display error.--- Below code can buit sucessfully on a DELL desktop but failed on a compaq laptop.The compiler said that snack 's size is unknow. #include<iostream> #include<string> using std::cout; using std::cin; using std::endl; using std::string; struct CindyBar{ string brand; float weight; int calory; }; int main(){ cout<<"Plesae enter the size to determine the array:\n"; int size; (cin>>size).get(); CindyBar *snack=new CindyBar[size]; cout<<"Please enter the items one by one:\n"; for(int i=0;i<size;i++){ cout<<"Please enter the No."<<i+1<<" 's brand:\n"; getline(cin,snack[ i ].brand); ...Show All
FarReachJason _setmode problems
MS documentation says I should be able to suppress the conversion of LF to CRLF when writing to stdout by using _setmode. That doesn't seem to happen. This console program (VS2005) doesn't give the expected output. Each new word printed starts at the beginning of a line. I expect it to look like this: one two three four but I get: one two three four // consoletest.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <stdio.h> #include <fcntl.h> #include <io.h> #include <string.h> int _tmain( int argc, _TCHAR* argv[]) { int result; int len; int ch; int cou ...Show All
DotNetDahlya DLL Project migrated from VC6 to VC8 crashes.
Hi, I am currently maintaining an MFC/ATL COM project that has been compiled till now with Visual C++ 6. I have been assigned the task to maintain the code under the VC8 compiler. The solution has several projects under it. Most of them generate DLLs, and there is also an Application project that uses these generated DLLs. Migrating the code from VC6 to VC8 has meant mainly performing the following minor changes to the code... using the _CRT_SECURE_NO_DEPRECATE macro definition to suppress various warnings (not errors) regarding deprecated function calls etc. removing the @1, @2 ... ordinals from the .def file changing string functions like ltoa() to _ltoa() etc. static_cast<> for conversion errors ...Show All
Malacki Managed code compilation
I know Native C++ makes a more resource efficent program than C#.NET or VB.NET; I also am pretty sure it makes a more efficent code than Managed C++ (correct me if I'm wrong) What I would like to know is if functionally equivalant managed C++ code is more efficent than C# code Thanks in advance. well I know C#, VB, and C++ so I am willing to use whatever combination gets me the best performance lol this thread is becoming a mess, wouldn't calling the dll use extra resources another question: if you wanted to make a GUI in C#, but behind the scences you had some heavy number crunching to do, resource-wise, would it be worth it to make a external native C++ dl ...Show All
EdSF Simple parallel for with nthreads=3 only creates 1 thread???
int main( int argc, char * argv[]) { int i; float x[1000]; #pragma omp parallel for schedule( static ,100) num_threads(3) for (i=0; i<1000; i++) { if ((i%10)==0) printf( "%d %d\n" ,omp_get_thread_num(),i); x =sqrt(( float )i); } scanf( "%d" ,&i); return 0; } //THREAD No. IS ALWYS 0 ; ALSO where is vcompd.dll so I can debug silly VS doesn't propagate settings in one to the other so /openmp was not set. Of course it doesn't. What you call release and debug are two project configurations, made up of a collection of compilation and linkage options. Since it's configuration is independent of the others, it doesn't make any sense for th ...Show All
please help me Restart the timer
I want to restart the timer... If a condition is fullfiled a timer stops, and then pops a msgbox and if user chooses yes than the score resets and the timer starts. The code is something like this: if(bugs_killed==10) { timer1->Stop(); // stop the timer and display a message box // now test if the user choose yes or no if (MessageBox::Show("Play again ", "Project", MessageBoxButtons::YesNo, MessageBoxIcon::Question) == ::DialogResult::Yes) { bugs=0; score=0; timer1->Start(); // start the timer } When timer runs the bugs are moving on the screen.. is a picture box that is mo ...Show All
Bumper SerialPort hell
Hey all, I am communicating with an old HP 8591C Spectrum Analyzer via serial port. If i use hyperterminal, the device responds to commands A LETTER AT A TIME!!! It is so frustrating that it doesn't wait for a carriage return. Into the dotnet world. I've tried a million times to make the serialPort control do this. For example: // This doesn't work serialPort->Write("ST 500MS" + "\r"); // Nor does this serialPort->WriteLine("ST 500MS"); // Nor does this serialPort->Write('S'); serialPort->Write('T'); serialPort->Write(' '); serialPort->Write('5'); ...... Any ideas as to why keystrokes in hyperterm get processed, but my individual writes do not ...Show All
Sean McElroy VS .Net 2005, how to disable intellisense...
Hi I am really frustrated with the performance of VS .Net 2005. This is because I always see at the bottom "updating intellisense..." and it uses 60% to 70% of CPU. How to disable this updating of intellisense... Please this is making Visual studio unusable. Thanks Chandra My guess is that Intellisense performance is killed by some of the following: excessive use of templates in code, #import for large native COM classes (biggie IMO), errors in parsing which cause loops (i.e. it never completes), corruptions in NCB files (deleting usually makes things better for a while), preprocessor code greying, very large precompiled headers, slow update of class view pane. I h ...Show All
