visual-c++

Opening an OpenDialog from Vis C++ console app?

I know this is a darn simple question, but I'm very used to using Borland and wrappers, so this is a bit of a new approach for me. Can someone simply tell me how I Can open an OpenDialog that only gets .obj files from a visual studio c++ console app? It's very much appreciated! ...

why bind() returns SOCKET_ERROR

Without: MFC ATL Using pure C++, WSAGetLastError() returns 10014 - Bad address What I'm I missing/doing wrong? Code illustration: sockaddr_in sin; SOCKET server; if ((server = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == SOCKET_ERROR) { cerr << "Error: socket() return value == SOCKET_ERROR" << endl; WSACleanup(); exit (EXI...

[Visual C++ 6 - MFC] How can I get and set the 'read-only' property of an edit box?

How can I get and set the 'read-only' property of an edit box? ...

Port Mingw32 based code to msvc2008

We recently had a new requirement to use the phonon component of Qt, which on windows requires Visual Studio. I installed VS2008 and ran a compile. There are a stack of problems due to make not working anything like nmake. Since I need to maintain cross-platform I want to test which compiler is being used so that I can make changes as...

(C++) Need to figure out all points within a radius using reg. 2D windows coord. system

Sorry in advance, I'm struggling a bit with how to explain this... :) Essentially, I've got a typical windows coordinate system (the Top, Left is 0,0). If anybody's familiar with the haversine query, like in SQL, it can get all points in a radius based on latitude and longitude coordinates. I need something much simpler, but my math s...

IConnectionPoint::Advise call returned E_NOTIMPL

Note: No MFC No ATL Using Visual C++ While attempting a connection between the connection point and the caller's sink, an E_NOTIMPL (0x80004001) was returned. Illustrated below: hresult = pConnection->Advise( pSinkUnk, &dwAdvise); Question: How did this occur? Regards ...

Explaining Debugging Symbols in MSVC++6

How would you explain "symbols" in a way that a novice programmer like myself would understand? What are they? Are they some sort of mapping to functions? I would like to learn more advanced debugging techniques and this term has been a roadblock for me. ...

Compilation & linking of linked LIST ADT

Hellos. Am having a problem with linking my implementation file in Microsoft Visual C++, and getting this error: Compiling... Skipping... (no relevant changes detected) slList.cpp Linking... LINK : fatal error LNK1104: cannot open file ".\Debug\slList.obj" Error executing link.exe. Can somebody please assist? ...

Problem Linking Boost Filesystem Library in Microsoft Visual C++

Hello. I am having trouble getting my project to link to the Boost (version 1.37.0) Filesystem lib file in Microsoft Visual C++ 2008 Express Edition. The Filesystem library is not a header-only library. I have been following the Getting Started on Windows guide posted on the official boost web page. Here are the steps I have taken: ...

user warnings on msvc AND gcc?

In MSVC I have this in a header: #define STR(x) #x #define STR2(x) STR(x) #define NOTE(text) message (__FILE__ "(" STR2(__LINE__) ") : -NOTE- " #text) #define noteMacro(text) message (__FILE__ "(" STR2(__LINE__) ") : " STR2(text)) and I do #pragma NOTE(my warning here) GCC has: #warning(my warning here) How...

Visual C++ express 2008: Why does it places megs of null bytes at the end of the release executable?

Recently I have discovered that my release executable (made with msvc++ express 2008) becomes very large. As I examine the executable with a hex viewer I saw that only the first 300k bytes contains useful data the remaining bytes are only zeros - 6 megs of zero bytes. The debug built exe has 1MB size, but the release is 6.5MB. Why doe...

Visual C++ 2008 Express Edition error creating a new project.

I have installed Visual C++ 2008 Express Edition on Vista Home Premium and whenever i try to create a new project, no mater which type(CLR, Console, Win32, Empty project) i get "Creating project 'project name' ... project creation failed." However i can open an existing solution. So basically my Visual C++ is useless. Any idea what c...

Searching fast through a sorted list of strings in C++

I have a list of about a hundreds unique strings in C++, I need to check if a value exists in this list, but preferrably lightning fast. I am currenly using a hash_set with std::strings (since I could not get it to work with const char*) like so: stdext::hash_set<const std::string> _items; _items.insert("LONG_NAME_A_WITH_SOMETHING"); _...

How can I get the value (string) of the current selection in a combobox?

How can I get the value (string) of the current selection in a combobox? (Not the integer index) ...

Equivalent of "pthread_rwlock_timedrdlock()" and "pthread_rwlock_timedwrlock()" in MSVC/Windows

What is the equivalent of following POSIX timed Reader/Writer locks in windows(MSVC)? pthread_rwlock_timedrdlock() pthread_rwlock_timedwrlock() ...

How does one convert from CString to unsigned char* with Unicode?

Hello everyone, I'm trying to do something simple here. When I execute the following code in Visual Studio 2008 using the unicode character set, xmlString is correct. Unfortunately I need to convert the CString to a unsigned char*. Using the code below, ucStr becomes "<" (i.e. the first character of xmlString). How should I convert th...

Inline ostringstream macro reloaded

Referring to http://stackoverflow.com/questions/303562/c-format-macro-inline-ostringstream The question there was for a macro that allows inline concatenation of objects to create a string, iostream-style. The answer was: #define SSTR( x ) dynamic_cast< std::ostringstream & >( \ ( std::ostringstream().seekp( 0, std::ios_base::...

How can I use TRACE macro in non mfc projects

I want to use the TRACE() macro to get output in the debug window in VS2005 in a non mfc c++ project. But I don't know which additional header or lib is needed. I want to know are there any ways of putting messages in the debug output window and how can i do that, thx a lot ...

How do I get past this variable initialization problem?

How do I get past this variable initialization problem? If I only could figure out how to only initialize them only once... * Main.cpp : main project file. /************************** Begin Header **************************/ #include "stdafx.h" //Required by Visual C ++ #include <string> //Required to use strings #include <iostr...

Most efficient replacement for IsBadReadPtr?

I have some Visual C++ code that receives a pointer to a buffer with data that needs to be processed by my code and the length of that buffer. Due to a bug outside my control, sometimes this pointer comes into my code uninitialized or otherwise unsuitable for reading (i.e. it causes a crash when I try to access the data in the buffer.) ...