visual-c++

How to programmatically disable a custom IE toolbar button?

Which message that I should send in order to make my custom made IE7 toolbar button to become 'disable state/gray color/unclickable'. So far, I have tried, TB_HIDEBUTTON.. Im still searching for the exact toolbar messages. Help me. ...

C++: Explicit DLL Loading: First-chance Exception on non "extern C" functions

I am having trouble importing my C++ functions. If I declare them as C functions I can successfully import them. When explicit loading, if any of the functions are missing the extern as C decoration I get a the following exception: First-chance exception at 0x00000000 in cpp.exe: 0xC0000005: Access violation. DLL.h: extern "C" __decl...

Problem with include guard

When I add an include guard to my header file for a Visual C++ project, it gives me the following warning and error: warning C4603: '_MAPTEST_H' : macro is not defined or definition is different after precompiled header use Add macro to precompiled header instead of defining here .\MapTest.cpp(6) : use of precompile...

Link error for user defined class type template parameter

Hi, I implemented a Simple STL map in C++. Factored out the comparison as a type as I was instructed to, then implemented the comparison as shown below: template <typename T> int KeyCompare<T>::operator () (T tKey1, T tKey2) { if(tKey1 < tKey2) return -1; else if(tKey1 > tKey2) return 1; else r...

Need to know how to properly create a new object in another cpp file

I have a class. The problem now is, after a few attempt, I'm still in huge error. My problem is I don't know how to properly declare a new object for this class, inside another cpp file. I wanted to call/trigger the functions from this RebarHandler class from my other cpp file. I keep on getting problems like, 'used without being initial...

Web Proxy Log sample

. hi . i have to log all the field in isa web proxy . where can i find right sample code ? ...

Visual C++ 2010 solution-wide macros with parameters

I'm trying to compile some source code with Visual C++ 2010 Express. The code was written for GCC, and contains attributes like this: struct something { ... } __attribute__((packed)); Since this is not standard C++ syntax, Visual C++ doesn't recognize it. With this macro prior to the struct declaration, it works fine: #define __attri...

skipped when looking for precompiled header

So some reason, my .cpp file is missing it's header file. But I am not including the header file anywhere else. I just started so I checked all the files I made enginuity.h #ifndef _ENGINE_ #define _ENGINE_ class Enginuity { public: void InitWindow(); }; enginuity.cpp #include "Enginuity.h" void Enginuity::InitWindow() { }...

what is a virtual adapter

I hear the term virtual adapter from time to time. But not exactly sure what it is. I can't exactly find a good definition online. Is there an exact definition for a virtual adapter. If so, what is it. Or what does it usually mean ? ...

What is an interface in C (COM) is it the same as a interface in C#

Ok, I know what a interface is, but since I got into C and working with COM objects (Component Object Model), it seems an interface in COM is a little different from the interface I know of. So what I am trying to do is bridge the gaps here cause since I been learning C, alot of things have been sounding very familiar to me but are not ...

using #define one time for multiple source files

is there a way in visual c++ to #define something in a cpp file and have it defined in other cpp files as well? ...

turn on bluetooth in pocket pc VS-c++

I'm attempting to turn on the bluetooth devices on a WinCE5.00 device. I was tracking down alternatives to BthUtil.dll because it doesn't exist on this OS. Does anyone know how I'd replace the functionality presented in this file. http://www.keyongtech.com/3116265-bthutil-dll-missing-in-ce bears not fruit. The suggestions don't have an...

using strcpy_s for TCHAR pointer (Microsoft Specific)

I was wondering which is the correct way? _tcscpy(tchar_pointer, _tcslen(tchar_pointer), _T("Hello World")); or _tcscpy(tchar_pointer, _tcsclen(tchar_pointer), _T("Hello World")); or _tcscpy(tchar_pointer, ???, _T("Hello World")); ...

How to copy files in VC++ ...?

Hi, i want to copy the files present in a flash drive into hard drives and then run them using a VC++ application. I have a VS 2008..? ...

Im getting fatal errors... can anyone help me edit my program!

The errors i am getting are: Error 1 error LNK2019: unresolved external symbol "double __cdecl getDollarAmt(void)" (? getDollarAmt@@YANXZ) referenced in function _main hid.obj Error 2 fatal error LNK1120: 1 unresolved externals this is my program: #include<iostream> #include<cmath> #include<string> using namespace s...

why must you provide the keyword const in operator overloads

Just curious on why a param has to be a const in operation overloading CVector& CVector::operator= (const CVector& param) { x=param.x; y=param.y; return *this; } couldn't you have easily done something like this ?? CVector& CVector::operator= (CVector& param) //no const { x=param.x; y=param.y; return *this; } Isn't when...

the scope of a pointer ???

Ok, so I did find some questions that were almost similar but they actually confused me even more about pointers. http://stackoverflow.com/questions/2715198/c-pointer-objects-vs-non-pointer-objects-closed In the link above, they say that if you declare a pointer it is actually saved on the heap and not on the stack, regardless of wher...

Turning on compiler optimizations in visual studio 2008 pro

How do i change compiler optimizations in visual c++ 2008 pro? I found the instructions for doing it in visual studio 2006 but it seems different than from 2008. ...

Convert CString to string (VC6)

I want to convert CString to string. (Yup. I know what am I doing. I know the returned string will be incorrect, if CString value range is outside ANSI, but That's Is OK!) The following code will work under VC2008. std::string Utils::CString2String(const CString& cString) { // Convert a TCHAR string to a LPCSTR CT2CA pszConver...

How to call a function from another function in c++?

I have this function definition inside my cpp file; LRESULT CRebarHandler::onSetRedraw(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { bHandled=false; if (m_ieVer==6){ if (!m_hWndToolbar) scanForToolbarSlow(); } return S_OK; } My problem is I don't know how to call it from another ...