visual-c++

How to Copying a folder in VC++ ?

hi, How to copy a folder from one drive to other drive in VC++ ...? I have come this far String^ SourcePath = Directory::GetCurrentDirectory(); String^ DestinationPath = "c:\\Test"; CString s(SourcePath) ; CString d(DestinationPath); Directory::CreateDirectory(DestinationPath); SHFILEOPSTRUCT* pFileStruct = new SHFI...

Do I need RpcEpRegister() for well-known endpoints?

Our native Win32 C++ RPC server application doesn't use RpcEpRegister(), instead it calls RpcServerUseProtseqEp(), then RpcServerRegisterIf(), then RpcServerListen() and that stuff works except for minor problems we still can't solve. I've thoroughly read MSDN and still don't get whether using this function is necessary. What exactl...

reading floating-point numbers with 1.#QNAN values in python

Hello, Does anyone know of a python string-to-float parser that can cope with MSVC nan numbers (1.#QNAN)? Currently I'm just using float(str) which at least copes with "nan". I'm using a python script to read the output of a C++ program (runs under linux/mac/win platforms) and the script barfs up when reading these values. (I did alread...

Migrating a big project in MFC from Visual C++ 6.0 to Visual Studio 2005

I am maintaining a big project (~250k loc, not counting code generated from idl) in Visual C++ 6.0, that uses Visibroker (VB for short) 5.2.1 (which is a CORBA implementation from Borland). Recently, the other module that communicates with my project was upgraded to VB 8.0 and I got a bunch of incompatibility issues. Since VB 5.2.1 is no...

Visual C++ Compiler allows dependent-name as a type without "typename"?

Hello, Today one of my friends told me that the following code compiles well on his Visual Studio 2008: #include <vector> struct A { static int const const_iterator = 100; }; int i; template <typename T> void PrintAll(const T & obj) { T::const_iterator *i; } int main() { std::vector<int> v; A a; PrintAll(a); PrintAll(v); ...

4 Colors gradient logic needed

I need to create 4 color gradient logic. One of the posts gave me the pattern to calculate 4 color gradient. However I am having difficutlties to implement it. I am able to calculate color of point E ( middle one) however I do not know how to develop the gradient from it MY code COLORREF NewColor = RGB(255,0,0); COLORREF NewColor2 ...

C++/CLI: Public ref struct generates C2011: 'class' type redefinition

Greetings! I have a header file in a managed DLL project like so: Enums.h: #pragma once ... public ref struct ManagedStruct { Bitmap^ image; } ... This header is referenced both from another class in the DLL and from a separate executable. The managed struct alone is generating error C2011: 'ManagedStruct' : 'class' type redefi...

does VS express conflict with professional ??

I just recently installed VS 2008 Professional on my computer and I already have C++ and C# express on my computer. But for some strange reason I can not find the executable for VS professional 2008. when I go into program files and look under visual studios 2008. All i see is a bunch of tools but no vs 2008 exe ...

Strange "unresolved external symbols" in VC 2005 import library

I have two projects, the dependency library "DEP", and the caller "test.exe". DEP is compiled to DLL with an import library, while "test.exe" links to the "DEP.lib". In DEP, I have classes like: class __declspec(dllexport) C; class A : public C; class B : public C; Later, I make A and B public in the "DEP.dll" using __declspec(dllexpo...

Can I simply call SetRedraw() from onDocumentComplete()?

For a custom made IE toolbar, can I simply call SetRedraw() from onDocumentComplete() ? Does it allowable? or will it work if I put some Sendmessage inside SetRedraw()? ...

Build GTK with Windows SDK

Hello, how can I compile gtk (itself) with Windows SDK ? ...

fesetround with MSVC x64

I'm porting some code to Windows (sigh) and need to use fesetround. MSVC doesn't support C99, so for x86 I copied an implementation from MinGW and hacked it about: //__asm__ volatile ("fnstcw %0;": "=m" (_cw)); __asm { fnstcw _cw } _cw &= ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO); _cw |= mode; //__asm__ volatile ("f...

C++ coverage tool that WORKS?!

Been searching for a good coverage tool for a while now. I'm with VC++ 2008. Tried already: NCover, PureCoverage, PartCover and a few others I can't remember their names. None works! Not even with a very basic console application that does almost nothing. Tried to get an evaluation copy from BullsEye and few more others - not only th...

Storing UTF-8 XML using Word's CustomXMLPart or any other supported way

I am writing a Word add-in which is supposed to store some own XML data per document using Word object model and its CustomXMLPart. The problem I am now facing is the lack of IStream-like functionality for reading/writing XML to/from a CustomXMLPart. It only provides BSTR interface and I am puzzled how to handle UTF-8 XMLs with BSTRs. To...

Serial port data availability problem

Hello Evryone. I am new to this type of programming..i just want some help...regarding what to do when u need to extract the data from the serial port..and how to check that tha data is available in the serial port..so that no data loss is there.... ...

Porting QT application from Linux to Windows?

Greetings all, We are developing a QT application (QT 4.6 LGPL version) in Linux platform.All the libraries we use are cross-platform. Now we want to port it into Windows and continue develop in Windows. My questions are: Which compiler should we use ,Can we use MinGW or Visual C++ compiler? 2.If its Visual C++ compiler, which Visua...

SelfDeleting application in VC++ ?

I want to delete a folder which contains the currently running application. How can i do it..? is there any way of doing it ? i.e the folder which contains the application should delete after the application has finished running ? ...

Is there dependency generation flag for MSVC like gcc's -M

Hello, Is there dependency generation flag for MSVC like gcc's -M flag. Every C++ compiler I have ever used had this kind of flag. How can I create dependencies automatically with MSVC cl compiler. I'm interested for only latest compiler versions i.e. MSVC9 or later but if it works with MSVC8 it is fine as well. If there is built-in ...

How to change button's image in visual c++ at run time?

After trying and error for many times, I decided to ask here. My objective is I wanted to change the feature of my IE toolbar button. The button is firstly setup by IE at IE startup using the function CRebarHandler::onSetRedraw and CRebarHandler::setButtonMenu2(). And then, I create a call from another cpp file, to call CRebarHandler::...

What is window message for a loaded website in Internet Explorer?

I am currently have this message handler line: MESSAGE_HANDLER(`WM_SETREDRAW`, onSetRedraw) I would like to know, is there any window message (eg: WM_???) that is connected/related to 'when a website has finish loading inside IE' ? So I can use it to replace the above WM_SETREDRAW. I want to do something like, when the IE finish load...