visual-c++

How do I reference a DLL in a VC++ project

Hi I'm an extreme VC++ newbie. I have a C++ driver I'm trying to compile, and it has this line in the code: #import "msado15.dll" no_namespace rename("EOF", "EndOfFile") But when I compile the project, I get the error: Error 1 fatal error C1083: Cannot open type library file: 'msado15.dll': No such file or directory I have the D...

C++ 'GET' request or how do you download files to work with in C++?

Alright I've spent a good three days trying this, here's the scenario: I want to download a '.csv' file from Google and then do stuff with the data from the file. It's for a Win32 Console Application. I have the latter down, I just cannot for the life of me figure out how to download the file. I've heard of libcurl, curlpp, ptypes, roll...

Is this possible use ellipsis in macro? Can it be converted to template?

Having implemented CLogClass to make decent logging I also defined macro, but it works only with one parameter... class CLogClass { public: static void DoLog(LPCTSTR sMessage, ...); }; #define DebugLog(sMessage, x) ClogClass::DoLog(__FILE__, __LINE__, sMessage, x) Well, it fails when called with more than 2 parameters :( ... I...

Get the value from a fixed memory offset : Visual C++ Programming

I would like to write an simple application able to retrieve some certain data from another process(application)'s allocated memory. Say I already know a process' id and I would like to obtain a value in this process' memory always from a fixed offset (like 0x523F1C), is this doable in the user-mode, or it has to be in kernel-mode? Any...

reading an application's manifest file?

Is there an easy way to read an application's already embedded manifest file? I was thinking along the lines of an alternate data stream? ...

What flags do you recommend for release configuration in MSVC project

I am reviewing the flags we have for our MSVC projects, and I can't get enough documentation on the following features: Use Link Time Code Generation (/ltcg) enable function level linking (/Gy) Eliminate Unreferenced Data (/OPT:REF) Remove Redundant COMDATs (/OPT:ICF) optimize for windows98 No (/OPT:NOWIN98) Enable string pooling (/GF)...

How do I set a path in visual studio?

How do I set a path for dll's to be searched in Visual Studio for a particular project alone. Now I am setting it in environment path variable, but I would like better control over this. ...

VC++ compile errors when including gl.h

Compiling a file that uses OpenGL with Visual C++, when I try to include the gl.h header file I get about 150 unhelpful compile errors: error C2144: syntax error : 'void' should be preceded by ';' error C4430: missing type specifier - int assumed. Note: C++ does not support default-int error C2146: syntax error : missing ';' before id...

Error highlighting in Visual C++

When using Eclipse or NetBeans IDE on a Java project I get to see where errors in my code are, before and after compiling. The line causing the issue is shown. I remember that back in the old days, the Visual C++ 98' edition did do underlining of errors in the code. Is there a way to enable this in Visual C++ 2005? Or is there a 3rd part...

Is there a O(1) way in windows api to concatenate 2 files?

Is there a O(1) way in windows API to concatenate 2 files? O(1) with respect to not having to read in the entire second file and write it out to the file you want to append to. So as opposed to O(n) bytes processed. I think this should be possible at the file system driver level, and I don't think there is a user mode API available ...

How to get a user token from Logonuser for a user account with no password?

How can you get a user token from Logonuser for a user account with no password? In particular Logonuser will fail for accounts that do not have passwords. You can validate an account by checking for a blank password + checking for GetLastError() == ERROR_ACCOUNT_RESTRICTION. But I need to actually get a token returned, so I need thi...

C library vs WinApi

Hi, Many of the standard c library (fwrite, memset, malloc) functions have direct equivalents in the windows API (WriteFile, FillMemory/ ZeroMemory, GlobalAlloc). Apart from portability issues, what should be used, the CLIB or windows API functions? Will the C functions call the winapi functions or is it the other way around? thanks...

Anyone knows how to fix compile error: LNK2005? (Source Code inside).

I have the below code in stdafx.h. using namespace std; typedef struct { DWORD address; DWORD size; char file[64]; DWORD line; } ALLOC_INFO; typedef list<ALLOC_INFO*> AllocList; //AllocList *allocList; Without the commented code (last line), it compiles just fine. But when I add the commented code, Im getting the fol...

ilk target directory

If incremental linking is enabled, Visual C++ generates the *.ilk file in $(TargetDir), can I override this behavior and redirect it to another directory? (without using a post-build step) ...

Forcing symbol export with MSVC

I have a application and several plugins in DLL files. The plugins use symbols from the application via a export library. The application links in several static libraries and this is where most of the symbols come from. This works fine as long as the application uses a symbol. If the symbol is not used there, I get linker errors when co...

Data Breakpoints by Variable Name

Is there a simple way to define a breakpoint, in Visual C++ 2005, that will pause the program whenever a certain value changes? I found Data Breakpoints, but those require a memory address, and provide no simple way to tie that to a variable. ...

Where to get/How to build Windows binary of mod_wsgi with python 3.0 support?

I wanted to experiment a little with python 3.0 at home. I got python 3.0 working, I've played around with some scripts, and I thought it would be fun to try to make a small web-project with it. As I was googling, it turned out, that mod_python, for some reasons, will not be able to support python 3.0. The only other alternative I've f...

Debugging a crash after exiting? (After main returned)

This is a fairly involved bug, and I've tried looking around to find other sources of help, but for reasons I don't understand, "Program Crashes in Vista" is not the most helpful query. The issue I'm having is that the program I'm working on - a graphical, multithreaded data visualization software that uses OpenGL and the Windows API - ...

How to make a visual studio add-in that cannot be unloaded?

I'm writing a Visual Studio add-in using C/C++. I am not familiar with the COM architecture. In fact I'm learning Windows programming. I can see an OnDisconnect() call back into my add-in. I tried returning S_FALSE, but that does not seem to stop the add-in from being unloaded. So my questions is, is it possible to make an add-in tha...

How to keep the console window open in visual c++?

I'm starting out in visual c++ and I'd like to know how to keep the console window. For instance this would be a typical hello world application: int _tmain(int argc, _TCHAR* argv[]) { cout << "Hello World"; return 0; } What's the line I'm missing? ...