c++

strange result when calling SHFileOperation to delete file after install MS office2003

I use following code to delete a file. it wroks well. SHFILEOPSTRUCT FileOp; ZeroMemory(&FileOp, sizeof(SHFILEOPSTRUCT)); FileOp.hwnd = m_hAppHandle; FileOp.wFunc = FO_DELETE; //delete FileOp.pFrom = szPath; FileOp.pTo = NULL; FileOp.fFlags = FOF_NOCONFIRMATION | FOF_NOERRORUI; FileOp.fAnyOperationsAborted = FALSE; FileOp.hNameMappin...

C++, read and write to a binary file at the same time

Hi I wanted to know if it's possible to read a byte from a binary file with "fstream" and then change that byte and write it back. I tried this code but it didn't work and nothing happens but I'm sure it reads correctly. file.open(path, ios::in|ios::out|ios::binary|ios::ate); file.seekg(0, ios::end); int size=file.tellg(); file.seekg(0,...

Unresolved external symbol when lib is linked, compiler adds the letter 'A' to the function name

I get this error when trying to link a win32 exe project. I have linked in the lib that contains the code for this method. But still gets an unresolved symbol error. error LNK2001: unresolved external symbol "public: bool __thiscall SharedJobQueue::AddJobA(class boost::shared_ptr<class domain::Job>)" (?AddJobA@SharedJobQueue@@QAE_NV?$sh...

Are there any XSLT to C++ compilers available?

I found only one attempt to create such compiler - http://sourceforge.net/projects/xsltc/. But this project is dead for decade already. Are there any other examples? Opensource or commercial? Are there any fundamental technical difficulties with building such software? With the whole approach of compiling XSLT natively? I suppose there...

What is the tool to check include file that are useless?(c++)

Possible Duplicate: Tools to find included headers which are unused? I would like to check useless header file in c++ files(.h and .cpp) During developing, There are so many relations between files. So it cause compile time more longer. Can you tell me what's the tool that help me. Thank you. ...

How to Store a VARIANT

Hi, I need to store a VARIANT of type bstr in a stl vector. I'm not sure how should I store VARIANT type in vector. vector<VARIANT> vec_MyVec; VARIANT var_Temp; VariantInit(&var_Temp); var_Temp.vt = VT_BSTR var_Temp.bstrVal = SysAllocString("Test"); vec_MyVec.push_back(var_Temp); Is this implementation cause a memor...

overriden virtual function is not getting called

a more exact version of the code is: class SomeParam; class IBase { public: virtual void Func(SomeParam* param = NULL) { cout << "Base func"; } }; class DerivedA : public IBase { public: void Func() { //do some custom stuff cout << "DerivedA func"; IBase::Func(); } }; class Deriv...

Deploying a Custom Program to a Hosting Service

I am a total newbie in servers/hosting etc, although I have some experience in programming in C,Java,etc. So excuse me if the question is 'absurd'. I recently bought service from a hosting site,namely this(hostmds). I have some code I've written in C++ and I want to run it in the hosting site. So my question is: Is this possible, or w...

Best way of organising load/save functions in terms of static/non-static

I have a class which defines a historical extraction on a database: class ExtractionConfiguration { string ExtractionName; time ExtractionStartTime; time ExtractionEndTime; // Should these functions be static/non-static? // The load/save path is a function of ExtractionName void SaveConfigruation(); ...

FileSystemWatcher

Hi, I need to write some code that will copy file from directory when the file will change. I know C/C++ (little bit :]) but I never used .net. Am I thinkig good? First I create new thread with FSW and then when change will occur create next thread that will copy file? ...

Understanding the library functions in c++

If I'd like to know how a function written in like standard C++ library work (not just the MSDN description). I mean how does it allocate, manage, deallocate memory and return you the result. where or what do you need to know to understand that? ...

graceful thread termination with pthread_cond_signal proving problematic.

Hi I need to fire of a bunch of threads and would like to bring them down gracefully. I'm trying to use pthread_cond_signal/pthread_cond_wait to achieve this but am running into a problem. Here's my code. firstly the thread_main static void *thrmain( void * arg ) { // acquire references to the cond var, mutex, finished flag and ...

Is it possible to use HTTPS certificates for licensing?

I am working on an application with multiple clients and a server running various web-services for the clients. To implement licensing I am thinking about using HTTPS as a protocol for the web-services using certificates that are issued by our company. By influencing the expiration date of a certificate for a client we can prevent them f...

Double Quoted Strings in C++

How to converted string with space in double quoted string. For Example: I get string c:\program files\abc.bat I want to convert this string to "c:\program files\abc.bat" but only if there is space in the string. ...

How (i.e. what tool to use) to monitior headers sent by Curl (Cookie problem)

I am using Curl (libcurl) in a C++ aplication, and am unable to send cookies (I think). I have Fiddler, TamperData and LiveHTTP Headers installed, but they are only useful for viewing browser traffic, and are (it would seem) unable of monitoring general network traffic on a machine, so when I run my machine, I cant see the header infor...

Is alloca part of the C++ standard?

The title says it all. ...

Library to parse C/C++ source code

Which library should I use to parse C/C++ source code file? I need to parse source file, calculate how much useful strings inside, how much 'for' blocks, 'if' blocks, how much comments inside. I also may need to insert a comment or small piece of code after each 'for' block. Is there any libraries? May be any library included in Micros...

Some basic questions on constructors (and multiple-inheritance) in C++?

(I’m sorry if this has been asked before; the search feature seems to be broken: the results area is completely blank, even though it says there are a few pages of results… in Chrome, FireFox, and Safari) So, I’m just learning C++… and the book I’m moving through is doing a really bad job of explaining constructors in a way that I can g...

UTF-8, CString and CFile? (C++, MFC)

Hello! I'm currently working on a MFC program that specifically has to work with UTF-8. At some point, I have to write UTF-8 data into a file; to do that, I'm using CFiles and CStrings. When I get to write utf-8 (russian characters, to be more precise) data into a file, the output looks like Ðàñïå÷àòàíî: Ñèñòåìà Ïðîèçâîäñòâî and et...

C++ array initialization

Considering this: typedef struct { int x; int y; } Coordinate; Coordinate places[100]; Is the memory for the 100 Coordinates allocated automatically? Or does it allocate one at a time when you initialize each element of the array? What happens if you adress uninitialized parts of the array? Does this trigger an error? ...