visual-c++

Painting problem in CListBox

I have derived a class from CListBox. It has 10 items. But its size is of 20 items. To reduce flicker I have Overridden the OnEraseBackground method to return true. I have also Overridden DrawItem. The DrawItem is called only 10 times, once for each item. I want to color the remaining part of the list. Can anyone suggest the most ...

uint8 displays weird characters

Hi, I've declared a uint8 variable and when the value in it is printed, I get smiley faces and white spaces. Shouldn't it display integer values? ...

Coding C and C++ in Visual Studio??

I understand the C++ and C syntax, but im a little unsure how i am supposed to code in the VS2010 environment, when i create a project i am presented with folders such as headers and sources. What c++ code goes into which folder? Also, how would it work for C? ...

c++ win32 set cursor position

i know wat function to use but i can't get it to workd right. i use SetCursorPos() the only problem is that it sets the cursor not to the windows coordinates but to the screen coordinates. i also tried the ScreenToClient() but it didn't work ethier. here is my code pt.x=113; pt.y=280; ScreenToClient(hWnd, &pt); SetCursorPos(pt.x, pt.y);...

How to get CLSID variable name, like MSVC?

When you are debugging a program and you hover over a GUID variable, MSVC retrieves both the variable name (e.g. CLSID_FilterGraph) and the human name (e.g. Filter Graph Object). It does the second by looking at HKCR\CLSID\GUID - but where does it get the variable name from?? It's not in the registry. Any ideas? ...

Convert BSTR to char*

Anyone know how to convert BSTR to char* ? update: I try to do this, but dont know either it is right or wrong.. char *p= _com_util::ConvertBSTRToString(URL->bstrVal); strcpy(testDest,p ); ...

How to compare char/string?

How to declare and compare the strings? // test ="my test string"; char testDest[256]; char *p= _com_util::ConvertBSTRToString(URL->bstrVal); strcpy(testDest, p); How can I compare test with testDest? ...

send WM_PAINT command from own program

How to programmatically send WM_PAINT from my c++ program? ...

Can template definitions of abstract (pure virtual) classes be put in source files c++

Hello According to http://stackoverflow.com/questions/115703/storing-c-template-function-definitions-in-a-cpp-file it is easy to seprate the interface and the implementation of a template class, .h file template<typename T> class foo { public: foo(); ~foo(); void do(const T& t); }; .cpp file template <ty...

Problem with boost library in C++ project

Hi, I'm attempting to use the boost library in my C++ project (Visual Studio 2008). However on including the boost functions for time: #include <boost/date_time/gregorian/gregorian.hpp> I get the following error (along with a number of warnings): fatal error LNK1104: cannot open file 'libboost_date_time-vc90-mt-gd-1_44.lib' ...

Build Visual Studio 6 project with Visual Studio 2010

I am trying to build a project created in VS 6 with VS 2010. When I open .dsw file, VS converts the project asking me this message: "... ProjectName.dsp must be converted to the current Visual C++ project format. After it has been converted, you will not be able to edit this project in previous versions of Visual Studio. Convert and op...

Print char[] to messagebox

I am taking the URL value from DocumentComplete and try to copy it to testDest[256] Here is my code: char *p= _com_util::ConvertBSTRToString(url->bstrVal); for (int i = 0; i <= strlen(p); i++) { testDest[i] = p[i]; } My question is, how can I print the testDest value on a messagebox? ...

c++ having strange problem

I have a function that creates and insert some numbers in a vector. if(Enemy2.dEnemy==true) { pt.y=4; pt.x=90; pt2.y=4; pt2.x=125; for(int i=0; i<6; i++) { Enemy2.vS1Enemy.push_back(pt); Enemy2.vS2Enemy.push_back(pt2); y-=70; pt.y=y; ...

visual studio 2010 don't want open new project (application wizard open in internet browser)

My c++ visual 2010 don't want open new project, every time when I put name of the project and click OK button after that it open my internet browser instead of Win32 Application Wizard. For better demonstration i record my steps here : http://tinypic.com/player.php?v=iqxzk4&amp;s=7 ...

For graphics drawing on WinCE platform, which language is faster: MFC VC++ or C#

Hi, I need to draw extensive realtime graphics on WinCE platform. For that purpose, which language is better between VC++ and C# to get high performance? Moreover, the graphics application that we would be developing should be linked to currently existing c++ modules. If writing intermediate layer involves lot of effort if we choose c#, ...

Any reason to use a run-time assert instead of compile-time assert?

While reviewing Visual C++ codebase I found a following strange thing. A run-time assert (which is check the condition and throw an exception if the condition is violated) was used in a case when the condition could be evaluated at compile time: assert( sizeof( SomeType ) == sizeof( SomeOtherType ) ); clearly the compiler will evaluat...

boost::interprocess shared memory and R bigmemory

Hi, I have a server client system where the server is a vc++ program and the client is in R. Can I use a shared memory between these two? with boost::interprocess at the vc++ end and R bigmemory at the R end? the server and the client are on the same pc ...

Inserting an 'image' datatype value through SQL Query/C++

In the application I develop, the database table having a column of 'image' datatype. Now I want to insert the values into that table directly from my program, which is in VC++ 6.0, using a direct ExecuteQuery() of INSERT(due to performance considerations). The image column is been mapped to the structurre of the following declaration t...

How to find out cl.exe's builtuin macros

Does anyone know how could I find out which are cl.exe's builtin/predefined macros? For example for gcc the following command line will list all the compiler's builtin macros gcc -dM -E - </dev/null EDIT: I'm interested in a way similar to gcc's that is "ask the actual compiler". Thanks ...

fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'

hi, i ve same problem. i ve setup all configuration which is mentions in below points but can't find any solution Configuration points are To choose the x64 platform, click Build > Configuration Manager. Under Active Solution Platform, select In the dialog that comes up, select x64 as the new platform (it may come up by default) and...