visual-c++

How to get information from VS_VERSION_INFO inside ActiveX control

HI, Is there a way to extract information from VS_VERSION_INFO (like FILEVERSION fro example) inside the same application? I know, you probably thinking in a path of: 1. GetModuleFileName(...) 2. GetFileVersionInfoSize(...) 3. GetFileVersionInfo(...) 4. VerQueryValue(...) BUT! There is a "twist": I need to make activex contr...

String Compare not working in Visual C++ 2005

Hi There, If get a gring from the registry and it correctly displays when I place it in a message box. ::MessageBoxW(0, (LPCWSTR)achValue, _T("Found"), MB_YESNO); The value is stored in archValue which is a DWORD. What I want to do is compare it to the following string "2.0.7045.0" but strcmp fails to work for me. Any ideas on how to d...

OnQueryHitPoint

Hello All, I have ActiveX control developed using VC++. When user clicks on my control, i dont want to handle it and want to pass it to controls below it. (This will be useful if my control is on top of other controls) To achieve it, i have implemented OnQueryHitPoint() on my control. This works fine when my control is used in VB. But ...

Convert any Form Video into RGB24 Media

how to convert YUY2,YUV, RGB565 and More Video subtype into RGB24 Subtype Video in DirectShow + VC++ can u understand my question? I have a Upstream filter its output is in YUY2 Format but i need to convert it into RGB24 Format. Is there any inbuilt Filters in DirectShow or we have to convert it through my code. i have already added ...

How the VC++ 2005/2008 Debugger visualizers would stop working?

I suddenly found that Debugger visualizers do not work for STL containers such as vector, set. Nothing went corrupt except that the watch windows showed things as if the visualiser were not there. But they are there, autoexp.dat sits right C:\program files\Microsoft Visual Studio 9.0\Common7\Packages\Debugger. And They used to work, I di...

CDC text drawing issue

I'm trying to draw text using CDC::ExtTextOut() to a device context (CDC), but I'm getting garbage outputs. The output text was drawn is weird fonts. The CDC pointer that got passed to me was originated from a unicode build ActiveX control (.ocx). The text drawing code resides in an ANSI build DLL. It seems like there're some kind of ...

How to underline individual items in a CListCtrl

We want some items in a CListView to appear like hypertext links. I can make everything underlined by setting the lfUnderline flag in LOGFONT, and creating a font from this, before calling SetFont - but this applies to the whole CListView. Does anyone know how to make individual items in a CListView to appear underlined? ...

How can I get user time and sys time in Visual C++?

Is there some API that equivalent with that in the time.h in linux systems? ...

Why VC++ Strings are not reference counted?

STL standard do not require from std::string to be refcounted. But in fact most of C++ implementations provide refcounted, copy-on-write strings, allowing you passing string by value as a primitive type. Also these implementations (at least g++) use atomic operations making these string lock-free and thread safe. Easy test shows copy-on...

callback function in VC++ 6.0

What is callback function [CALLBACK EXPORT] ,how it works , is it infinite loop or recursive. I have a piece of code in vc++ 6.0 can any body explain how it works. timer_result=SetTimer(NULL,1,(t*1000),Timerflow); //say t=2,or t=10, === void CALLBACK EXPORT Timerflow(HWND hWnd, UINT nMsg, UINT nIDEvent, DWORD dwTime) { ---- ---- } ...

error c2664 upon using basic_string<wchar_t> abc("hello") in vc++ 9.0

Hi upon compiling this code in Visual studio 2008 i get the following error #include<iostream> #include<string> using namespace std; void main() { basic_string<wchar_t> abc("hello world"); cout<<abc; return; } error C2664: 'std::basic_string<_Elem,_Traits,_Ax>::basic_string(std::basic_string<_Elem,_Traits,_Ax>::_Has_deb...

Open source Visual Studio project distribution nightmare...

Every time Microsoft releases a new version of visual studio, they always require me to convert my solution and project files to 'the latest version.' Even with something as simple as a "Hello World" solution, I need to go through their conversion wizard! And, to make things worse, the new visual studio solution files aren't compatible...

BOOST_FOREACH: What is the error on using this of a STL container?

Does anyone know why the following generates an error on VC9? class Elem; class ElemVec : public vector<Elem> { public: void foo(); }; void ElemVec::foo() { BOOST_FOREACH(Elem& elem, *this) { // Do something with elem } return; } The error I get is: error C2355: 'this' : can only be referenced ins...

visual studio 2008 (c++) additional directories for debugging?

In prior versions of visual studio one could specify paths for DLLs when debugging an application. I do not see a way to do this is version (2008). Is this due to the move toward deployment of apps with all DLLs, etc in the application's directory(ies)? Am I missing something, or is there no way to do this? EDIT: It was in VC6 I thi...

How to run multiple projects within VS 2005 as an instance ?

I want to run multiple VS 2005 instance at the same time. Each instance has the different projects. But hardware restrictions limits me. Is there any way doing this? I am trying to run from debug\program.exe. But it does not work. Thanks in advance ...

Can I use a Visual Studio 6 compiled C++ static library in Visual Studio 2008?

Is it possible to use a C++ static library (.lib) compiled using Visual Studio 6 in Visual Studio 2008? ...

Problem with glui

hi all, i was trying out a free code i downloaded from the internet, when i compiled it says.. "Error 2 fatal error LNK1104: cannot open file 'glui32d.lib' MarchingCubesGLUI MarchingCubesGLUI" i cant seems to find much reference online about GLui, i know i dont have glui.h .dll and .lib files etc etc. so what should/can i do? FYI: i...

MSVC++ compiler error C2143

The following code excerpt is responsible for a cryptic MSVC++ compiler error: template<class T> class Vec : public vector<T>{ public: Vec() : vector<T>(){} Vec(int s) : vector<T>(s){} T& operator[](int i){return at(i); } const T& operator[](int i)const{ return at(i);} }; ... The error: test.cpp(5) : error C2143:...

How can you make buttons on a MSVS C++ CToolBar larger along with their images?

We have a touch screen, and the toolbar is too small to hit with my meaty fingers. Is there an easy way I can have an option to make the toolbar buttons bigger and easier to hit? So far I've attempted a few things: m_toolbar.SetSizes( CSize(64,64), CSize(50,50) ); m_toolbar.SetSizes( CSize(64,64), CSize(50,50) ); m_toolbar.GetToolBarC...

How do I sleep in my MSVC++ console application?

The title says it all. I want to call Sleep(x), where x is milliseconds to sleep. I know this is the function, but it doesn't work for me. What do I need to include? ---SOLVED--- I was using the compiler option /Za, which disabled the native Windows extensions used in Sleep()'s implementation. ...