visual-c++

How to change *.ico for button in running mode?

I am currently doing visual c++ for an Internet Explorer toolbar button. I have a registration script file (*.rgs) that defines or maybe register the features of my button inside the Windows registry. My objective is, I want my button to change its *.ico image, based on certain conditions process from my *.cpp file. My problem is, I don'...

Prevent property page size change at dynamically (runtime)

I developed (ATL)ActiveX control which used to launched by 3rd party applications. My control has CProperySheet as a child, and which has few property pages. Once control created, i creating instance of CProperySheet, adding property pages to sheet and setting sheet window size to fit control size. In the propery sheet i have three butt...

How could get scsi HDD serial number?

I wanna get the serial number of a scsi harddisk, but it makes an error! I work with VC++ on Microsoft Windows XP. What must i do for that? ...

Load a 6 MB binary file in a SQL Server 2005 VARBINARY(MAX) column using ADO/VC++?

How to load a binary file(.bin) of size 6 MB in a varbinary(MAX) column of SQL Server 2005 database using ADO in a VC++ application. This is the code I am using to load the file which I used to load a .bmp file: BOOL CSaveView::PutECGInDB(CString strFilePath, FieldPtr pFileData) { //Open File CFile fileImage; CFileStatus fil...

Creating a real standalone application for Windows XP with MSVC 2010?

I have a C++ application only taking use of the basic Win32 API (I can remove that too if neccessary) and the C++ STL. I'm using MSVC and want it to be really standalone. I have already tried several options (including using the "Multithreaded" option instead of "Multithreaded DLL"). Yet: It misses several MSVC runtime DLLs on many comp...

Source Directory MSVC

argh, this should be an easy one. How can I set the directory that a MSVC project uses to store source files? I wish to use a directory outside the project dir, As this is a multiplatform project which will also have an xcode directory. Thanks Phil ...

Add button to Internet Explorer toolbar during run time

I am currently create a simple additional button to my Internet Explorer 7, toolbar. The button works. I am using Visual C++. But now, I would like to create a to create a button during my Internet Explorer is running. Means, on certain condition, my program (a dll registered with regsvr32) will add a button to the toolbar. and after ce...

VC2010 Intellisense - auto-complete /full/ function declaration?

Every so often, in MSVC 2005/8, the erratic Intellisense would randomly decide to kick in and do something wondrous: auto-complete the ENTIRE declaration at once, while having laboriously been re-typing/selecting the function definition for the 1000th time. No, I wasn't drunk at the time. But I did see it happen occasionally--maybe 10 to...

Including MSVRC100.dll in C++ exe

I created a simple C executable in Visual C++ 2010, but when others tried it they got a missing MSVCR100.dll error. Apparently, the user needs to install the Visual C++ Redistributable Package in order to run the exe. Is there any way I can instead include MSVCR100.dll inside the exe (so it's just one file, not sitting in the same folder...

Limitation of Attachment size when using SMTP

Hi, I wrote a C++ program to send a mail using SMTP. But when I attach any files I notices that a single file's size always is limited to 808 bytes. As an example if I send a text file with 10 KBs, when I download the attachment it has only text worth 808 bytes. If the large file is a zip file, it gets corrupted in unzipping obviously d...

Load a .bin file in SQL server 2005 Express database in vc++ application

I would like to put a binary file in varbinary(MAX) column using _RecordsetPtr in a vc++ application.I am sure that lot of people have done this before. But I am new to database programming. Help is urgently needed ...Thanks in advance. ...

Programmatically modify my Internet Explorer toolbar

How to programmatically modify my Internet Explorer toolbar button? I am currently using visual c++. ...

template expressions and visual studio 2005 c++

I'd like to build the olb3d library with my visual studio 2005 compiler but this failes due to template errors. To be more specific, the following expression seem to be a problem: void function(T u[Lattice<T>::d]) On the website of the project is stated that prpably my compiler is not capable of such complicated template expressions ...

Is there any reason against directly calling AddRef() inside QueryInterface() implementation?

When implementing IUnknown::QueryInterface() in C++ there're several caveats with pointers manipulation. For example, when the class implements several interfaces (multiple inheritance) explicit upcasts are necessary: class CMyClass : public IInterface1, public IInterface2 { }; //inside CMyClass::QueryInterface(): if( iid == __uuidof...

Bluetooth external modem pairing problem - WM6.1

Hi folks, I'm working on an application using embedded visual c++ 4.0 and MFC (yes, it's a legacy system) which runs on windows mobile 6.1 and needs to pair with an external 56k modem via bluetooth. The app uses BthPairRequest (http://msdn.microsoft.com/en-us/library/ms887871.aspx) to do the pairing and WSASetService(http://msdn.microso...

Visual C++ 2008 doesn't recognize Windows declared types

I have a program that doesn't seem to recognize declared types in the latest U3D software. There's a line typedef BOOL (WINAPI* GMI)(HMON, LPMONITORINFOEX); which gets the error: Error 1 error C2061: syntax error : identifier 'LPMONITORINFOEX' c:\Projects\U3D\Source\RTL\Platform\Common\Win32\IFXOSRender.cpp 28 and a line ...

assignment not working in a dll exported C++ class

Using VS 2008 Have a C++ class in which I'm calling functions from a 3rd party dll. The definition in the header file is as follows: namespace OITImageExport { class ImageExport { private: SCCERR seResult; /* Error code returned. */ VTHDOC hDoc; /* Input doc handle returned by DAOpenDocument(). */ ...

print TCHAR[] on console

Hi I'm quite sure that it is a stupid issue but it drives me crazy.. how could i print on the console a TCHAR array? DWORD error = WSAGetLastError(); TCHAR errmsg[512]; int ret = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0, error, 0, errmsg, 511, NULL); i need to print errmsg... ...

Compile Assembly Output generated by VC++?

I have a simple hello world C program and compile it with /FA. As a consequence, the compiler also generates the corresponding assembly listing. Now I want to use masm/link to assemble an executable from the generated .asm listing. The following command line yields 3 linker errors: \masm32\bin\ml /I"C:\Program Files (x86)\Microsoft Vis...

libmcrypt and MS Visual C++

Has anyone tried using libmcrypt and visual c++? I was trying to use Crypto++ but it seems not fully compatible - and I need to decrypt data encrypted in PHP using linux libmcrypt. I found only cygwin version of libmcrypt but no .lib files or header. I'm using RIJNDAEL_128 - maybe there is easier way to decrypt it in Visual C++? Thank...