visual-c++

When is registering a Type Library necessary?

For example, if writing a shell extension, is it necessary to register the typelib with CComModule::RegisterServer (i.e., I'm wondering if calling it with FALSE will cause some issues). ...

Defining your own VS C++ Build Macros

We came across a bunch of pre-defined Build Macros for instance $(SolutionDir), but can you define your own build macros in Visual C++ 2005? ...

Why would Windows Search query my IFilter for a bunch of weird interfaces?

I've implemented an IFilter as a native VC++ ATL in-proc COM server. Windows Search wouldn't use it - it creates an instance of my IFilter and then executes a bunch of QueryInterface() calls, specifically: IMarshal IStdMarshalInfo something with {4C1E39E1-E3E3-4296-AA86-EC938D896E92} interface id and a couple of others. Since my IFil...

Visual C++ Remote Debugging - Breakpoints Become Disabled

Here's the setup I have: On my local PC I build an un-managed C++ app in release mode, with debug information On my local PC the .exe and .pdb file are in the same dir On my local PC this works, I can debug as expected On the remote PC I copy both of these files into a \bin folder In my remote debugging settings I tell it to run in the...

event log of an application

how to access the event log of an application using visual c++ API . ...

Which sorting algorithm is used by Microsoft's STL::list::sort()?

Note: I accidentally posted this question without specifying which STL implementation I was using, and I felt it can't really be updated since it would render most of its answers obsolete. So, the correct question goes - which sorting algorithm is used in the below code, assuming I'm using the STL library of Microsoft Visual C++?: list...

How do I get text into Visual Studio Output Window using STL IO?

I always thought the output window for a MSVC++ app running in the debugger was mapped to one of the standard output streams. But When I run this code in a Windows MFC app, nothing is seen: std::cerr << "cerr"<<std::endl; std::cout << "cout"<<std::endl; std::clog << "clog"<<std::endl; Is this a Windows thing or a VC++ thing? How are f...

How to convert tchar pointer to char pointer

I want to conver a tchar* to char * is this possible . if yes how to do it. I use unicode setting ...

How to get all filename in a given directory

I want to get the file name in a given path is there any apis available . My programming environment is vc++ mfc ...

how to create a round/circular button in win32 API using visual c++

I have a Window (win32 API) Application in visual c++. I am not using MFC. I have to create a round/circular button with bitmap image. My application have a skined view. Can any one help me out in achieving this task. Thanks in advance. ...

How to run an Application on windows start up in win32 API using visual c++

I have a Window (win32 API) Application in visual c++. I am not using MFC. I have to run my application on windows start up. I am using windows 7 and visual studio 2008. Can any one help me out in achieving the above task? Thanks in advance. ...

Accessing MDIchild's function from another child (Visual C++)

Hi, I started recently programming in Visual C++ 2008. I have a problem with getting info from private textbox in one mdichild from another mdichild. I created public non-static function to do it however I don't know if I placed it in a proper place and how to call it from that other child. public ref class Form2 : public System::Window...

Using Intellisense in Visual C++ 2008 Express. Intellisense for one project not available when editing file in another project.

I have a multiple vcproj solution going and it seems that no other project's intellisense information is available when editing a file in another project. However when I'm within a file in a project, all intellisense information is available for that project. Any idea why? ...

visual studio intellisense error

template <typename T> class Test { friend Test<T> & operator * (T lhs, const Test<T> & rhs) { Test<T> r(rhs); // return r *= lhs; } } 4 IntelliSense: identifier "T" is undefined why is T defined on line 3 but not line 4? i mean i guess its not a real error just an intellisense error... it works anyway but is t...

Is there a way to customize the tool tip of a custom object in the VS Debugger?

http://stackoverflow.com/questions/369192/is-there-a-way-to-customize-the-tool-tip-of-a-custom-object-in-the-vs-debugger/1725025#1725025 anyway to do same for unmanaged c++? thanks ...

c++ error: operator []: 2 overloads have similar conversions

template <typename T> class v3 { private: T _a[3]; public: T & operator [] (unsigned int i) { return _a[i]; } const T & operator [] (unsigned int i) const { return _a[i]; } operator T * () { return _a; } operator const T * () const { return _a; } v3() { _a[0] = 0; // works _a[1] = 0; _a[2] = 0; ...

How to declare IEEE mathematical functions like 'ilogbf' in MSVC++6?

Hi, Could someone please help and tell me how to include IEEE mathematical functions in MSVC++6? I tried both and , but I still get these errors: - error C2065: 'ilogbf' : undeclared identifier - error C2065: 'scalbnf' : undeclared identifier thanks in advance for your help, mk ...

Why does BEGIN_COM_MAP contain a DEBUG_QI_ENTRY?

In ATL there's a BEGIN_COM_MAP macro for declaring a table that controls how the QueryInterface() behaves when called on the corresponding class object. Inside it has the following line: static const _ATL_INTMAP_ENTRY _entries[] = { DEBUG_QI_ENTRY(x) which means that the first table entry will be DEBUG_QI_ENTRY which expands as f...

Problem in Debugging and installing Window NT Service created in VC++

Hi, I have a legacy service which was developed in VC++ 6.0 and right now maintained using Visual Studio 2008. It handles database operations and provides records to its JAVA client in a predefined (XML) format. When we install JAVA application the service automatically gets installed (through JAVA application's installer). To debug t...

What's the purpose of IUnknown member functions in END_COM_MAP?

ATL END_COM_MAP macro is defined as follows: #define END_COM_MAP() \ __if_exists(_GetAttrEntries) {{NULL, (DWORD_PTR)_GetAttrEntries, _ChainAttr }, }\ {NULL, 0, 0}}; return _entries;} \ virtual ULONG STDMETHODCALLTYPE AddRef( void) throw() = 0; \ virtual ULONG STDMETHODCALLTYPE Release( void) throw() = 0; \ STDMETHOD...