visual-c++

Overwriting Data in a C++ File using fstream

Hi i want to overwrite the content(object) in a specific file i have set the position but it always add to the end of the file Code int InputIO::editPatient(int location,Obj P){ int positon=location*sizeof(P); f.open("File.dat",ios::in|ios::out|ios::app|ios::binary|ios::ate); f.seekp(0,ios::beg); f.see...

C++ fstream Erase the file contents from a selected Point

I need to Erase the file contents from a selected Point (C++ fstream) which function should i use ? i have written objects , i need to delete these objects in middle of the file ...

MFC: Convert CStringArray to float, converting just part of the value

I want to convert val.ElementAt(i) to float value : float *d = new float[NMAX]; char *buffer = new char[128]; CStringArray val; //adding some values to val buffer = (LPSTR)(LPCSTR)val.ElementAt(i).GetBuffer(); d[i] = atof(buffer); as the result in d[i] I have just part of the value(if it was 55 in d is - 5, 666 - 6 ...), help ...

Problem in accepting connection from client (socket programming) in Visual C++

I have written a simple single threaded client server application in Visual C++. When I run my server I wait for some time that it accepts some request from the client. When I connect the client to the server. The log message on the client reports 14 bytes are send and there is no message on the server. I have written a print statement ...

EXE and DLL dependency - When to recompile the EXE?

Hi All, I've the following class definitions in exe and dll. // A.exe: Class A { void fun() { B* b = new B(); b.funx(); } // B.dll: Class B { void funx (void) { C* y = new C(); y.funy(); } Class C { void funy() { } } Lets say I change the size of class B, should i recompile A.exe? And should I recompile A.exe even if I change size...

C++ 'strcpy' gives a Warning (C4996)

I am getting this his warning but all functions working properly . what does this really means? 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. ...

How to create binary tree using STL Set C++

Can anyone tell me how to implement Binary tree using C++ STL set. I have implemented binary tree using structures in C and class in C++ struct binary { int node; struct binary *left; struct binary *right; }; I am not sure about how to implement it using STL set. Actually I don't know how to to represent left and right in...

run threads in visual c++ 2010

i am using visual c++ 2010 can i run this code? what should i add to visual studio? ...

Adding HTTP header to all outgoing packets on Windows?

I am developing a Windows application that will live in the system tray. The application can be enabled/disabled by the user. Whenever the user enables it, it needs to listen/sniff HTTP traffic and add a specific HTTP header on all outgoing packets. I think it can be done by changing the system or browser settings to be localhost:my_po...

What's a reasonable size for a Visual C++ PDB file?

I am working to reduce the build time of a large Visual C++ 2008 application. One of the worst bottlenecks appears to be the generation of the PDB file: during the linking stage, mspdbsrv.exe quickly consumes available RAM, and the build machine begins to page constantly. My current theory is that our PDB files are simply too large. How...

Passing data between subforms of type CDialog

I have a MS Visual C++ 2005 project where I am trying to have a main dialog box with a section devoted to displaying selectable subform dialogs boxes. Each subform will be of the same size but have a different layout. The selection is performed using a combo-box control. I searched on the best way to implement this functionality and I...

OpenCV Visual Studio 2010 - RC6034 Error (DLL Hell?)

[ Add HTTP:// to the beginning of picture links to make them work for you. ] [ All Steps here were done with both Release and Debug versions. The pictures shown only display debug-related information. ] OpenCV 2.1.0 does not work properly with Visual Studio 2010 on my computer when it begins to load _Video files with the opencv_ffmpeg D...

Shared Object Files

I have two projects within one solution. Both projects contain some files that are the same. For instance, Project1 contains shared.cpp and so does Project2. However, when I edit shared.cpp and build both projects, is there any way I can make VC++ compile the source file once, then use the single object file in the linking of the two pro...

How to Marshall C++ Native Objects to Managed C++ CLI

Hello, I have bunch of native C++ objects and classes contains DTL maps, maps of maps and lists and vectors. I need to call managed C++ functions from C++ native code and need to pass these native objects and STL containers(lists,maps , maps of maps) to C++/CLI. It needs to marshal or some how serialize these objects. How can I do that...

SDL/MSVC++ Linker Problem

I get this error: ...\visual studio 2010\Projects\SDLT\Debug\SDLT.exe not found or not built by the last incremental link; performing full link I have include, library, and additional file dependencies setup but I keep getting the link error. For include: C:\SDL-1.2.14\include;C:\SDL-1.2.14\SDL_image-1.2.10\include; For libraries: C:...

Displaying intellisense automatically (Visual C++ 2010 Express)

One thing that has always annoyed me in Visual C++ is the fact that, unlike Visual C#, intellisense does not automatically display when a new line (or equals sign, etc) is entered, so I must press Ctrl+Space every time. Is there any way to change this? It has gotten to the point where I have even considered using something like AutoIt t...

The best C++ book

Possible Duplicate: The Definitive C++ Book Guide and List I want to learn to program in c++, currently i find difficult to make programs and design a structured one. I want to learn how to develop good logic for the programs , as well as i want to learn all the nuances of c++ language.Please tell me as to what i should do to ...

DoModal() not bringing up dlg box as modal

I have a window with the following properties set int he .rc file: STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU It has an associated class (derived from CDialog) and when I instantiate it, then call that object's DoModal() on it it is not really modal - I can click on the "parent" window. CMyDl...

What is the Equivalent of "object of C# " in VC++?

In C# we have a datatype object which can hold any type of data. Same thing I want to achieve in VC++. Can anyone kindly let me know VC++ equivalent of "Object of C#". IN C#, in the calling appl program (say call.cs) object ob=null; ob=(object)str; funct(ref ob); Here str is empty string. This thing I want to achieve in VC++. ...

how to add checkbox to a custom grid?

I am having a custom grid control, where each cell is entered with values., I need to add a control (checkbox) to the cells of the grid which i wish., Whats the best method to do that? From the custom grid i could get the cell location etc. ...