visual-c++

Taking advantage of SSE and other CPU extensions.

Theres are couple of places in my code base where the same operation is repeated a very large number of times for a large data set. In some cases it's taking a considerable time to process these. I believe that using SSE to implement these loops should improve their performance significantly, especially where many operations are carried...

GD Visual C++ 2008

Is there some step by step guide to link GD library ( www.libgd.org ) to the project in MSVS? Because I'm getting linker-errors when trying to compile my project: error LNK2019: unresolved external symbol _gdImageCreateFromJpeg referenced in function _main ...

C++ two dimensional arrays with pointers

Hi there, I have a problem with two dimensional arrays :( I feel very stupid and Visual C does not help me :( and I also think that my mistake is very stupid but still I can't find it :( I have this code: double matrix[100][100]; //which is full with a matrix 3x4 double nVector[10000]; // for negative doubles //I wanted to see if there...

What is the problem with linking of Pthreads libraries to .c file in MSVC++6?

Hi Could someone please help me to compile my .c file with MSVC++6 in windows xp? From this morning, I am trying to compile it but it give me the following errors: --------------------Configuration: server_th - Win32 Debug-------------------- Linking... server_thread.obj : error LNK2001: unresolved external symbol _ThreadMain Debug/se...

long long int compilation error in vc++ 6.0

I'm encountering this error while compiling some old VC++ 6.0 source code. error C2632: 'long' followed by 'long' is illegal There's a part of the code that declares a long long int variable which caused the error. Does anybody know how I can fix this error compiling it in VC++ 6.0? I've searched around and I've read that this data ty...

Variable arguments in a Macro

I have a function which takes variable arguments, something like the following int log_data (LOG_TYPE eType, ...) { /** some logging related stuff here **/ } In the header file, I use something like #ifdef LOGGING_ENABLED int log_data (int nType, ...); #else #define log_data(_x_, ...) #endif Basically, the idea is to SWITCH deb...

Is there a better way to bring names into class scope other than to typedef them?!

I keep running into this issue: class CCreateShortcutTask : public CTask { public: CCreateShortcutTask( CFilename filename, // shortcut to create (or overwrite) Toolbox::Windows::CShellLinkInfo definition // shortcut definition ) ... Having to spell out Toolbox::Windows::CShellLinkInfo...

MSVC - Any way to check if function is actually inlined?

Hi, I have to check whether a function is being inlined by the compiler. Is there any way to do this without looking at assembly (which I don't read). I have no choice in figuring this out, so I would prefer if we could not discuss the wisdom of doing this. Thanks! ...

How to get List of free port number in VC++?

How to get List of free port number in VC++? Aslo i want to check wether user define port number is free or not ? ...

How to find project appartenance of a given file (Visual C++)

I am messing with a very big solution in Visual C++ 2008 (150+ projects), and by browsing the code with the useful "Go to Definition/Declaration" feature, I end up in C files, but I don't know in which project they belong ... So here's my question : Is there a way to know the projects referencing a given file in a visual C++ solution ? ...

C++: #include file search?

This MSDN document quotes: look for include files in the same directory of the file that contains the #include statement, and then in the directories of any files that include (#include) that file Wait, what? What does that actually mean (the bold stuff)? ...

Which STL containers require the use of CAdapt?

The CAdapt class is provided by Microsoft in order to enable using classes that override the address of operator (operator&) in STL containers. MSDN has this to say about the use of CAdapt: Typically, you will use CAdapt when you want to store CComBSTR, CComPtr, CComQIPtr, or _com_ptr_t objects in an STL container such as a list. O...

VisualStudio C++ how to make debuginfo reliable in releasemode

Hi! I've got a little problem. my application runs without problems in Debug mode, but crashes in release mode. I can't track down the problem, because in release mode all the Debuginfo appears to be nonsense. However - sometimes in other projects the Debug output is also valid in release mode. What projectsettings do I have to change s...

What is going on at the top of this function

I'm currently looking at a function example that I can't seem to figure out using MFC in Visual C++. The function is as follows CMFC_OSG_MDIView::CMFC_OSG_MDIView() :mOSG(0L) { } I understand everything here except the mOSG(0L) snippet. mOSG was declared in the MFC_OSG _MDIView class as follows: cOSG* mOSG; Any help is greatly appr...

MFC's GetClientRect and MoveWindow don't preserve size?

I'm using MFC for Visual Studio 2003. I have an Edit Control with ID IDC_COMMENT_EDIT. In the following code, after my first call to GetClientRect, I don't expect the value of rc to change. CWnd* pWnd = GetDlgItem(IDC_COMMENT_EDIT); if (pWnd != NULL) { RECT rc; pWnd->GetClientRect(&rc); pWnd->MoveWindow(&rc, TRUE); pWnd->GetClie...

What does the '0' in line 41 mean?

#include <iostream> #include <cctype> // isdigit using namespace std; // Global buffer const int LINE_LENGTH = 128; char line[LINE_LENGTH]; int lineIndex; void getLine () { // Get a line of characters. // Install a newline character as sentinel. cin.getline (line, LINE_LENGTH); line[cin.gcount () - 1] = '\n'; lineIndex = 0; } ...

Creating a UAC like environment

I want to create an environment like UAC. i.e. my dialog should appear to the user and unless he responds to it, i want to disable the background. User should not be able to carry out any activity. For this purpose I created a new desktop and display my dialog on the new desktop. But i want something like UAC where the background seems...

How do I disable the generation of an import library?

I'm creating a COM DLL in Visual Studio. The linker generates an import library for the DLL. I don't need the import library. Is there any way to tell the linker not to generate it? ...

Static library links in wxWidgets statically, but apps using my lib still require wxwidgets

Hopefully someone can help me out here. I'm using Visual Studio 2005 and creating a static library that links in wxWidgets statically. I have: compiled wxWidgets statically according to their guide included the lib directory in my "Additional Library Directories" property added all of the wxWidget libs in my "Additional Dependencies" p...

Good Non-Commerical (free) Refactoring Tool for Visual Studio 2005/Visual C++ 8.0?

We have a rather large codebase in C++ here that needs some refactoring; since it's generally bad to start from scratch, I was wondering if there were any good free code refactoring tools for Visual Studio 2005/Visual C++ 8.0? ...