Answer Questions
Nick Darnell Error on delete [] v
Hi, I have a problem with a class. The declator is class Configuration { public : struct conf_table { char name[40]; char value[10]; }; struct conf_table *conftable; int size; //rows on conftable int max_size; //maximum rows on conftable public : Configuration( void ); //Constructor ~Configuration( void ); //Destructor }; And the code is Configuration::Configuration( void ) //Constructor { size=0; max_size=256; conftable = new conf_table[max_size]; //initialize conftable } Configuration::~Configuration( void ) //Destructor { delete [] conftable; } The problem is that i get an error message (Heap Corruption) after ...Show All
h1 Find And Replace Regular Expressions
Hi ! I'm trying to use the "Find And Replace" to add the _T macro to all my strings (except the ones already have this macro) The regex i used to find the relevant strings is: ~(_T\(){"[^"]*"} From some resone it doesn't work, my first try was ~(\#include |_T\(){"[^"]*"} that also exclude all the include statements but i won't be so greedy :) Hope someone can help me because i have many many files to edit... ...Show All
LiamD 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
dt VS2K5 SP1 Beta
After installing the SP Beta I now have code that does not build and I get errors in MS files: Error 21 error C2446: '<' : no conversion from 'MSXML2::IXMLDOMElementPtr *' to 'MSXML2::IXMLDOMElement **' c:\program files (x86)\microsoft visual studio 8\vc\atlmfc\include\afxtempl.h 553 Hi, Bozalina, Did you reinstalled VS2005 or VS2005SP1Beta to fix the problem I have the problem only with VS2005SP1Beta. Thanks, Yawei. This is a known problem (serious regression) in afxtempl.h. See https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx FeedbackID=214250 for explanation and workaround (in community discussion/workaround ...Show All
John Sobernheim MFC Question
(I cannot find a MFC forum here so I thought this would be the best place to post) I'm writing a program in C++ using VS.NET 2005 with the DOC/VIEW approach. I ran the wizard to generate the MFC project and I have the following .h files: MainFrm.h Resource.h Sketch.h SketchDoc.h SketchView.h stdafx.h I have the following .cpp files: MainFrm.cpp Sketch.cpp SketchDoc.cpp SketchView.cpp stdafx.cpp I have a very simple question - how I do I change the name of the window that appears I thought you go into the initInstance in Sketch.cpp and right before it shows the window, you invoke the SetWindowTitle method, but that doesn't exist on the m_pMainWnd variable, which appears to be CWnd. I hav ...Show All
Ji Zhang &#91;MSFT&#93; Option Explicit & Option Strict
I have read a few topics about Option Explicit & Strict. I'm curious if either of these are available for C++. And if they are, would it notify me if I have not returned a pointer to memory. i.e.: delete pHeap; Thanks! - np Option Explicit and Option Strict are a VB/VB.NET thing only. You can consider them to be both On for C++ and there is no way to turn them off in C++. Also I'm not sure what this has to do with pointers and freeing memory. VB does not have pointers and it also does not need something like delete because it uses a garbage collector. I guess the reason I was asking is because, I was hoping there was a way to catch wether or ...Show All
roadresident A compiing error about template
Dear Expert: I use visual studio 2005 to compile NeuroLib ( http://www.ia.unc.edu/dev/ ), and there are a lot of error like the following: ---------- e:\unc_proj\lib\neurolib\libraries\datatypes\Vector2D.txx(33) : error C2244: 'Vector2D<T>::{ctor}' : unable to match function definition to an existing declaration 3> definition 3> 'Vector2D<T>::Vector2D(const Vector2D<U> &)' 3> existing declarations 3> 'Vector2D<T>::Vector2D(const Vector2D<U> &)' 3> 'Vector2D<T>::Vector2D(const T &,const T &)' 3> 'Vector2D<T>::Vector2D(void) ------------------------------------- this is implementation of the .txx function: inline Vector2D<T ...Show All
bryndabella how can i turn off the "/gs" flag ?
i hope im in the right forum.. im using MSVC++6 and i want to turn off the /GS flag, how can i do this thanks ! im so sure that VC6 is not support this option.. where did i need to write it in my program i mean after the "include..." and before the "int main()" or where and what is the syntax thanks ! Umh, I'm certain you know that already, but obviously /GS or /GS- are command line options that are passed to the compiler driver (cl.exe) on the command line. You can always look these up in the index of MSDN Library to find the corresponding setting in the IDE. So, it is nothing you would do in the source code. Are you sure you mean /GS (and not /Gs) There's probably a corresponding pr ...Show All
Shortty sprintf for output as binary
Am I able to use the sprintf function to output text as binary For example, how would you convert text in textBox1 "hello world" to binary I have the code: private : System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { txtBx3->Clear(); String^ myString = gcnew String( txtBx1->Text ); txtBx3->AppendText( myString ); } But I want to make the code in txtBx3 appear as the binary version of the text in txtBx1. Can I use the sprintf function, what is the easiest way of doing this. ********************************************** I AM USING C++ in VS2005*************************************************** Yeab, but, hex is not binary ...Show All
nick5454 Syntax for Overriding IListSource -Managed C++
I am having trouble with the syntax for overriding IList source in managed c++. Especially, how do you override the public ref class StopListSource : Component, IListSource { private: static BindingList<String^>^ blah = gcnew BindingList<String^>(); public: StopListSource() {} StopListSource(IContainer^ container) { container->Add(this); } //***The Following generates: a member using-declaration or access declaration is illegal within a managed type IListSource::ContainsListCollection { get { return false; } } //Not sure about the following, but it doesn't throw any errors //in C# this is: System.Collections.IList IListSource.GetList() , but in C++ this is old syntax ...Show All
JohnnyR c2228 and another question
hi, i have a bunch of c2228 errors in my code now that states left of '.RXbyte' must have class/struct/union the part of code it points to is as follows: m_bSendECG = false ; m_cRS232.TXbyte(0x00); m_cRS232.RXbyte(&Byte); m_cRS232.TXbyte(0x12); m_cRS232.RXbyte(&Byte); m_cRS232.Clear(); m_iBufferPos = 0; im not sure how to fix it. im sure its obvious by now that i didnt write most of this code. im a noob and most of this code is way over my head. im trying to understand it as i correct it. its part of a big project with many files inter-linked with one another. i apologize if my questions are very basic and i hope you will bear with me. thanks in advance. ...Show All
lufa Question about VSC++2003 to VSC++2005 conversion.
I'm just starting with Visual Studio 2005. I have some tutorials that are written for VS2003. Most of the programming differences I've figured out but I am having trouble with this one: VS2003 String *myContainer = 0; Ive tried String ^myContainer = 0; but I get a compiler error error C2440: 'initializing' : cannot convert from 'int' to 'System::String ^'. The 0 pointer conversion would be ambigious with automatic boxing for handles. Hence, VC reuses the nullptr proposal. The nullptr keyword converts to null pointer or null handles. I.e. use String^ myContainer = nullptr; -hg Thank you very much. That did it. ...Show All
Markus Fritz Problem loading dll created by VisC 2005
Hi, I converted a C++ project from VS .NET 7.1 to VS .NET 8. The project uses old fopen methods and similar. Under 7.1 the project compiles and runs, but under 8, I am unable to run. First, when running the application, it complains about missing msvcr80.dll. Then, when I locate it (somewhere) on the computer, I get the error that the application tried to load the dll in an illegal manner. When searching for info on this, I stumble into manifests, and I see that the manifest should contain some lines about the msvcr80.dll, version etc. But my manifest file is empty. It only contains this information: < xml version="1.0" encoding="UTF-8" standalone="yes" > <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manif ...Show All
mmmmBeeeer Why is base class destructor unresolved in Release mode (VS2005)
Abstract base class, Foo, exists in library F Derived class (from Foo), Bar, exists in library B Module M uses Bar (but never Foo directly). Linking M to B satisfies all external references in Debug mode. In Release mode, however, linking of M complains that the reference to Foo’s destructor is unresolved. This seems inconvenient. It is caused by optimization because if you disable the optimization on M, there is no link problem. Can this behavior be justified Does anyone understand what sort of optimization is happening that causes this behavior Is there a way around this other than either disabling optimization or linking M to F (also setting M’s C++ Properties/Optimization/Whole Program Optimizat ...Show All
Greenstrike CDHtmlDialog and Drag and Drop
I am using a HTML dialog based application. Everything works perfectly but when anyone drops a file on it or even html page or shortcuts it works as browser. I have put in OnInitDialog the following CDHtmlDialog::m_pBrowserApp->put_RegisterAsBrowser(FALSE); CDHtmlDialog::SetHostFlags(DOCHOSTUIFLAG_DIALOG | DOCHOSTUIFLAG_SCROLL_NO | DOCHOSTUIFLAG_NO3DBORDER ); CDHtmlDialog::m_pBrowserApp->put_RegisterAsDropTarget(FALSE); but it does not help. Any possible idea's how to disable drag and drop... Hello Re: CDHtmlDialog and Drag and Drop The more appropriate place for your question is probably the MFC newsgroup: http://msdn.microsoft.com/newsgroups/default.aspx dg=microso ...Show All
