c++

what is difference b/w RegAsm.exe and regsvr32 ?? How to generate a tlb file using regsvr32??

Hi Can any body tell me what is diff between regsvr32 and RegAsm and My Dll is C# dll so how can i import the classes to c++. ...

memcpy with startIndex?

I wish to copy content of specific length from one buffer to another from a specific starting point. I checked memcpy() but it takes only the length of content to be copied while I want to specify the starting index too. Is there any function which can do this? Or is there any good approach to do it with existing memcpy function. ...

Modifying Git Diff files.

Will explain the problem that I'm faces, so that you have a better idea about the situation. We have one project, and about 6 months ago it was branched off. Lets call our branch A, and theirs branch B. In that time branch B has had 100,000 more lines of code added or deleted. We on the other hand have added or changed about 50,000 lin...

Mystery HRESULT, 0x889000D

Decimal: 143196173 Hex: 0x889000D Results from a call to IAudioSessionControl2->GetProcessId(). GetLastError = 126* Message = "The specified module could not be found" I'm not really sure how to interpret this error. Additionally, I can't find a description of the HRESULT anywhere. The documented return codes are S_OK, E_POINTER, AU...

Is there a production ready lock-free queue or hash implementation in C++

I ve been googling quite a bit for a lock-free queue in C++. I found some code and some trials - but nothing that i was able to compile. A lock-free hash would also be welcome. SUMMARY: So far i have no positive answer. There is no "production ready" library, and amazingly none of the existent libraries complies to the API of STL contai...

what's wrong in my code related to COM??

*****BLOCK_1**** if( strcmpi(appName.c_str(),MSSQL)==0 ||strcmpi(appName.c_str(),MSSQL2005)==0 ) { if (FAILED(CoCreateInstance (CLSID_SQLDMOServer, NULL, CLSCTX_INPROC_SERVER, IID_ISQLDMOServer, (LPVOID*)&m_pSQLServer))) { DMOAvailable=false; IDiscoverPtr pICalc; HRESULT hRes=CoCreateInstance(Test::CLSID_SqlClass, NU...

Why arrays of references are illegal?

The following code does not compile. int a=1,b=2,c=3; typedef const int intlink arr[] = {a,b,c,8}; What C++ standard says about it? Is this compiler error? P.S. I know I could declare class that contains reference and use it in array, but I really want to know why the code above doesn't compile. Edit: The following code is...

What is a good way to think about C++ references?

I've been programming C, mainly in an embedded environment, for years now and have a perfectly good mental model of pointers - I don't have to explicitly think about how to use them, am 100% comfortable with pointer arithmetic, arrays of pointers, pointers-to-pointers etc. I've written very little C++ and really don't have a good way o...

How to update all C/C++ identifier names in a project

After frequently coming across recommendation not to use leading and double underscores in C/C++ identifiers I decided to fix all our sources once and for all. What I need to do now is convert _Identifier to Identifier_. Should I use a specialized tool for this task of regular expressions will do for this job? In latter case what is the...

Win API C++ Control Edit compulsory

Hi, I'm developing a GUI in C++ using dev-c++. I have an edit control like this: hctrl = CreateWindowEx( 0, "EDIT", /* Nombre de la clase */ "", /* Texto del título, no tiene */ ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER...

change global variables in c++

Hi, Is there a way to define a global variable by user input? Lets say I use #include... #define N 12 double array[N][N]; void main();... But I would like the user to be able to choose what N is. Do I have to have N as a local variable or is there a way around this(without macros)? I've a pretty small program but with a lot of diff...

Linking libcURL in Visual Studio 2008 Express

Hello everybody, my first question here: I am having trouble using libcURL in a c++ project. I don't even get it linked. I am using Windows XP and Visual C++ 2008 Express Edition. So here is what I did: Downloaded libcURL: curl-7.19.5-devel-mingw32.zip Opened new commandline project in VC++ Include folders 'lib' and 'include' to my n...

How to get size of check and gap in check box?

I have a check box that I want to accurately measure so I can position controls on a dialog correctly. I can easily measure the size of the text on the control - but I don't know the "official" way of calculating the size of the check box and the gap before (or after) the text. ...

CppCMS vs. C++ Server Pages vs. Wt

I know Wt is the most stable of them, but it's a bit uncomfortable to use. CppCMS sounds good but how stable is it? How secure is it? I have encountered C++ Server Pages as well but there's nothing about their security in there. Has anyone had some experience with any of those libraries and can enlight me? ...

Queue in An Array

Problem: to understand the solution, when the length of the queue is 5. Exercise: Its solution: Question: Why is the solution not C A B B B, otherwise everything the same in the "Solution"-picture above? Source, (the solution and exercise at "10:02.03-08.03") ...

fstream linking error in g++ with -std=gnu++0x

Hello, I'm have an application built with the -std=gnu++0x parameter in tdm-mingw g++ 4.4.0 on windows. It is using an ofstream object and when I build, it gives the following linking error: c:\opt\Noddler/main_func.cpp:43: undefined reference to `std::basic_ofstream<char, std::char_traits<char> >::basic_ofstream(std::string const&, st...

MFC radio buttons - DDX_Radio and DDX_Control behavior

Hi there, I have an MFC dialog in which there are two radio buttons. I have put them in a nice group, their IDCs are one after each other (RB_LEFT, RB_RIGHT). I want to use DDX_Radio so I can access the buttons using an integer value so in the function DoDataExchange I call : DDX_Radio(pDX, RB_LEFT, mRBLeftRight); where mRBLeftR...

How to get the Windows Power State Message (WM_POWERBROADCAST) when not running a Win32 GUI app?

So basically I have a plugin dll that is loaded by a GUI-Application. In this dll I need to detect when Windows enters the Hibernate state. I cannot modify the GUI-App. GetMessage only works if the calling thread is the same thread as the UI-Thread, which it is not. Any ideas? ...

Force Program / Thread to use 100% of processor(s) resources

I do some c++ programming related to mapping software and mathematical modeling. Some programs take anywhere from one to five hours to perform and output a result; however, they only consume 50% of my core duo. I tried the code on another dual processor based machine with the same result. Is there a way to force a program to use all ava...

c++ standard practice: virtual interface classes vs. templates

I have to make a decision regarding generalization vs polymorphism. Well the scenario is standard: I want to make my monolithic interdependent code to be more modular, clean and extensible. It is still in a stage where the change of design principle is doable, and, as I look at it, highly desirable. Will I introduce purely virtual base...