visual-c++

error C2065: 'CComQIPtr' : undeclared identifier

I'm still feeling my way around C++, and am a complete ATL newbie, so I apologize if this is a basic question. I'm starting with an existing VC++ executable project that has functionality I'd like to expose as an ActiveX object (while sharing as much of the source as possible between the two projects). I've approached this by adding ...

Programatically rebuild .exd-files when loading VBA

Hi, After updating Microsoft Office 2007 to Office 2010 some custom VBA scripts embedded in our software failed to compile with the following error message: Object library invalid or contains references to object definitions that could not be found. As far as I know, this error is a result of a security update from Microsoft (...

Visual Studio 2008 & Perforce. Where is my .vspscc files?

Hi, I use Visual Studio 2008 and Perforce. When I bind my project to perforce(File -> Source Control -> Change Source Control -> Bind), Visual Studio complain like "~.vspscc File is not under source control". Should I create that file for myself, or is that file created by Visual Studio? If it is created by Visual Studio, why does it com...

Avoiding 'Buffer Overrun' C6386 warning

In my code, I am using an array xyz of 10 objects. When I am trying to access an element of the array using an unsigned int index like this: xyz[level], I get 'Buffer overrun' warning. Logically, I am pretty sure that level won't exceed 10. How to avoid this warning? ...

looking for a good vc++ profiler, already checked previous posts

I'm looking for a good profiler for vs2008 professional edition, free or reasonably priced. I've already checked previous posts and tried about 8 profilers, but most of them are too basic or too detailed. Kindly suggest something, my requirements are as follows: It can be compiled, so that its well integrated with my application. I'm n...

Linking a template class using another template class (error LNK2001)

I implemented the "Strategy" design pattern using an Abstract template class, and two subclasses. Goes like this: template <class T> class Neighbourhood { public: virtual void alter(std::vector<T>& array, int i1, int i2) = 0; }; and template <class T> class Swap : public Neighbourhood<T> { public: virtual void alter(std::vect...

API to change ownership of file vista

I have a file created by installer as Administrator owner. Is there any API that can change the ownership of file on Vista? ...

Giving write permission to Users group in Vista?

IS there any API that can give 'Users' write permission to a file in Vista? ...

How to add a text file as resource in VC++ 2005?

I want to add a text file as resource in VC++ 2005. I am not able to find text as option in resource template. Also once added how can I refer to that file while programming? ...

blogslibv_8.3 linking the libraires in visual c++ 2008

can anyone give me the procedure for building a blogslib library containing code in vc++ 2008 edition? the official documentation gives it for vc++ 2006... thanks... ...

Getting information about where c++ exceptions are thrown inside of catch block?

I've got a c++ app that wraps large parts of code in try blocks. When I catch exceptions I can return the user to a stable state, which is nice. But I'm not longer receiving crash dumps. I'd really like to figure out where in the code the exception is taking place, so I can log it and fix it. Being able to get a dump without haltin...

Pseudo graphics in C++

Hello, i looks for pseudo graphics lib for C++ under Visual Studio, lib like in TurboVision in Borland Turbo C++ or NCurser.. Or can i do it with standart c++ libs ? Thanks. ...

<msbuild/> task fails while <devenv/> succeeds for MFC application in CruiseControl.NET?

The Overview I am working on a Continuous Integration build of a MFC appliction via CruiseControl.net and VS2010. When building my .sln, a "Visual Studio" CCNet task (<devenv/>) works, but a simple MSBuild wrapper script (see below) run via the CCNet <msbuild/> task fails with errors like: error RC1015: cannot open include file 'winr...

How to return an [out] variant with VT = VT_RECORD without creating memory leak in ole32.dll?

Hi, Purify is pointing memory leak in ole32.dll while returning a Variant with VT set to VT_RECORD as OUT parameter. I am using User Marshalling by generating proxy/stub dll from IDL. Can you suggest how to avoid this memory leak? Struct defined in IDL: { BSTR m_sFirst; BSTR m_sSecond; VARIANT m_vChildStruct; //This member encapsulate...

Statically initialize anonymous union in C++

I am trying to statically initialize the following structure in Visual Studio 2010: struct Data { int x; union { const Data* data; struct {int x; int y; }; }; }; The following is fails with error C2440: 'initializing' : cannot convert from 'Data *' to 'char'. static Data d1; static Data d = {1, &d1}; static Da...

On Memory Allocation and C++

And I quote from MSDN http://msdn.microsoft.com/en-us/library/aa366533(VS.85).aspx: The malloc function has the disadvantage of being run-time dependent. The new operator has the disadvantage of being compiler dependent and language dependent. Now the questions folks: a) What do we mean that malloc is run-time dependent? ...

Win32: No Window Appears

I was programming the example code from Frank Luna's book "Introduction to 3D Game Programming with DirectX 10". The code is the first Win32 example in the Appendix A: Windows Programming section. Right now, the program compiles under both VC++ 2008/2010, but no window appears, although the debug session has started and I have to forcef...

Get HTML data to program(C++)

Hi i would like to add some function to my app. How it is possible to get data from web page. For example i login to webchat which is ofc https secure. And now there is some table with user replies. How it is possible to get the table or some other html component, data to my C++ program. Its SSLed, so we dont want to sniff http. What s...

Visual C++ Compiler Option To Dump Class Hierarchy

Is there any compiler option in MS Visual C++ equivalent to GCC's -fdump-class-hierarchy? i.e. showing the virtual function table layout. ...

difference in using virtual and not using virtual

Possible Duplicate: Overriding vs Virtual In C++, whether you choose to use virtual or not, you can still override the base class function. The following compiles just fine... class Enemy { public: void SelectAnimation(); void RunAI(); void Interact() { cout<<"Hi I am a regular Enemy"; } private:...