visual-c++

Visual Studio Solution: static or shared projects?

When a whole project (solution) consists of multiple subprojects (.vcproj), what is a preferable way to tie them: as static libraries or as shared libraries? Assuming that those subprojects are not used elsewhere, the shared libraries approach shouldn't decrease memory usage or load time. ...

Visual studio c++ documentation generator

Hi Is there a way to get documentation(like javadoc) in a visual-c++ project? I'm using visual studio 2010. thanks! ...

sin v/s sinf fucntion in C

Hi Guys, I am trying to use sinf function in my C Program and it does give me undefined reference under MSVC 6.0 but sin works fine. This make me curious to find the difference between sin and sinf. What is the logical difference between sin and sinf(). How can I implement my own sinf functionality? ...

[MSVC++ 2008] Using preprocessor directives to define command line options

If I wanted to add, let's say, a new .lib to the build only if a particular #define was set, how would I do that? In the MSVC++ 2008 "Property Pages", you would simply add: Config Properties -> Linker -> Input -> Additional Dependencies, but I would like it if something like #define COMPILE_WITH_DETOURS was set, then the particular libr...

[MSVC++ 2008] Using preprocessor directives to define the output path

Using the following pseudo-code: #define BUILD_PATH "C:/MyBuild/" #define BUILD_NAME "mydll.dll" // Set build path here representing how I would like to build the current project (a dll) into C:/MyBuild/mydll.dll, how would I accomplish this by only using preprocessor directives? Thanks a bunch! ...

Pass arguments to a parameter class object

This is undoubtedly a simple question. I used to do this before, but it's been around 10 years since I worked in C++ so I can't remember properly and I can't get a simple constructor call working. The idea is that instead of parsing the args in main, main would create an object specifically designed to parse the arguments and return th...

Screen Resolution Question VS2008 - C++ CLI

Hi, I have a program that has a SIZE of 800x600. I want to make this program expand if it is maximized, so that all the elements(buttons, picturebox's) change size to fit the new ratio depending on the users windows screen resolution. The way I am thinking to approach this is to take the users screen resolution and manual change the s...

saving xml file to disc using vc++

Can anyone please tell how to save an xml file from the web to the disc automatically when i give the url using vc++ ...

Compare _TCHAR* argv[] entries from command line to _T("paramString")

I know how to get the parameters from the command line. I also know how to print them out. The problem I'm having is how to compare the parameters from the argv[] array to a string. The progam runs but never returns a result where the parameter string is equal to the one I'm looking for. Thanks in advance. // Testing.cpp : Defines t...

Visual Studio 2008 compiler macro reference or tutorial?

Does anyone know the location of a good list or tutorial showing all the compiler macros (_T etc) in use in Visual Studio 2008? Thanks in advance ...

Visual C++ CreateThread Parameter Problem

I have a class that contains a function that calls create thread, and needs to pass itself (this) as a parameter: DWORD threadId; HANDLE h = CreateThread( NULL, 0, runThread, this, 0, &threadId); My runThread definition is as follows: DWORD WINAPI runThread(LPVOID args) { Obj *t = (Obj*)args; t->funct(); return 0; } Unf...

Flexible string handling in Visual Studio 2008 C++

I'm slowly starting to get the hang of the _T stuff in Visual Studio 2008 c++, but a few things still elude me. I can see the benefit of the flexibility, but if I can't get the basics soon, I think I'll go back to the standard way of doing this - much less confusing. The idea with the code below is that it scans the parameters for -d a...

Include QT file problem in Visual Studio 2008

When I type #include <QObject> it complains that it couldn't find file. but if I type #include <QtCore\QObject> It works properly. I moved VS2005 to VS2008, this was not the case in VS2005, and it started with VS2008. Why am I getting this error? ...

How to read verbose VC++ linker output

Trying to debug some linker errors, I turned on /VERBOSE and I'm trying to make sense of the output. It occurs to me that I really don't know how to read it. For example: 1>Compiling version info 1>Linking... 1>Starting pass 1 1>Processed /DEFAULTLIB:mfc80.lib 1>Processed /DEFAULTLIB:mfcs80.lib 1>Processed /DEFAULTLIB:msvcrt.lib 1>Proc...

C preprocessor problem in Microsoft Visual Studio 2010

I've encountered a problem with the new Visual C++ in VS 2010. I've got a header with the following defines: #define STC(y) #y #define STR(y) STC(\y) #define NNN(y) 0##y #define NUM(y) NNN(y) The intent is that you can have some constant around like #define TOKEN x5A and then you can have the token as a number or as a string: NUM...

Creating a new object destroys an older object with different name in C++

First question here! So, I am having some problems with pointers in Visual C++ 2008. I'm writing a program which will control six cameras and do some processing on them so to clean things up I have created a Camera Manager class. This class handles all operations which will be carried out on all the cameras. Below this is a Camera clas...

C++ program runs slow in VS2008

I have a program written in C++, that opens a binary file(test.bin), reads it object by object, and puts each object into a new file (it opens the new file, writes into it(append), and closes it). I use fopen/fclose, fread and fwrite. test.bin contains 20,000 objects. This program runs under linux with g++ in 1 sec but in VS2008 in debu...

How to set IDD_FORMVIEW dialog as main "form" in visual studio 6 c++?

I just started playing with cpp for the first time (using VS6 C++), I created an empty win32 application, added a IDD_FORMVIEW dialog, and now I don't know how to set that dialog as the main "form" for the application. I mean I want the dialog to be the first and main window opened when executing the compiled exe. ...

How to access webbrowser object on this code? C++

I found this example http://www.mvps.org/user32/webhost.cab that host an Internet Explorer WebBrowser object, and it uses this code to access the object void webhostwnd::CreateEmbeddedWebControl(void) { OleCreate(CLSID_WebBrowser,IID_IOleObject,OLERENDER_DRAW,0,&site,&storage,(void**)&mpWebObject); mpWebObject->SetHostNames(L"Web ...

Clean/Rebuild Run

As I'm making my application, I've been able to just run my project and it runs with the changes all made. As my project is getting larger, I have to go Clean Solution, Rebuild Solution and Run...Recently I also upgraded "Team System" edition my dad has, because of its testing tools Why is this happening? is it because of something I've...