c++

Getting the process id of a Carbon C++ application

Is there a way of getting the process id of my C++ application? I am using the Carbon framework, but not Cocoa ...

Maintain the correct version for a COM dll referenced in a .NET project

I want to reference a COM DLL in a .NET project, but I also want to make sure that the interop DLL created will have the correct version (so that patches will know when the DLL must be changed). If I use TlbImp I can specify the required version with the /asmversion flag but when I add it directly from VisualStudio it gets a version tha...

C++ Compiler Error C2371 - Redefinition of WCHAR

I am getting C++ Compiler error C2371 when I include a header file that itself includes odbcss.h. My project is set to MBCS. C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\odbcss.h(430) : error C2371: 'WCHAR' : redefinition; different basic types 1> C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winnt.h(289) : see d...

Tool to track #include dependencies

Any good suggestions? Input will be the name of a header file and output should be a list (preferably a tree) of all files including it directly or indirectly. ...

How do I Convert an IntPtr to a Stream?

class Foo { static bool Bar(Stream^ stream); }; class FooWrapper { bool Bar(LPCWSTR szUnicodeString) { return Foo::Bar(??); } }; MemoryStream will take a byte[] but I'd like to do this without copying the data if possible. ...

How do I call ::CreateProcess in c++ to launch a Windows executable?

Looking for an example that: Launches an EXE Waits for the EXE to finish. Properly closes all the handles when the executable finishes. ...

How do I SCP a File programatically using C

What would be the best way to do an scp or sftp copy in a unix environment using C. I'm interested in knowing the best library to use and an example if at all possible. I'm working on a solaris server with the sun tools installed. ...

Writing/Using C++ Libraries

I am looking for basic examples/tutorials on: How to write/compile libraries in C++ (.so files for Linux, .dll files for Windows) and... How to import and use those libraries in other code. Many thanks in advance! ...

Mixing C/C++ Libraries

Is it possible for gcc to link against a library that was created with Visual C++? If so, are there any conflicts/problems that might arise from doing so? ...

Measuring exception handling overhead in C++

What is the best way to measure exception handling overhead/performance in C++? Please give standalone code samples. I'm targeting Microsoft Visual C++ 2008 and gcc. I need to get results from the following cases: Overhead when there are no try/catch blocks Overhead when there are try/catch blocks but exceptions are not thrown Overh...

What's safe for a C++ plug-in system?

Plug-in systems in C++ are hard because the ABI is not properly defined, and each compiler (or version thereof) follows its own rules. However, COM on Windows shows that it's possible to create a minimal plug-in system that allows programmers with different compilers to create plug-ins for a host application using a simple interface. L...

VS.Net 2005 required on Build box with .Net 2.0 C++ Projects?

We have a build box that uses CruiseControl.Net and has been building VB.Net and C# projects using msbuild. All I have installed on the box as far as .Net is concerned is .Net 2.0 SDK (I'm trying to keep the box as clean as possible). We are now trying to get a C++ app building on this box. The problem we are running into is that the ...

In C++, what alternatives do I have for exposing a collection, from the point of view of performance and data integrity.

My problem is that I want to return an internal list of data to the caller, but I don't want to generate a copy. Thant leaves me with either returning a reference to the list, or a pointer to the list. However, I'm not crazy about letting the caller change the data, I just want to let it read the data. - Do I have to choose between perfo...

Default smart device project can't find dependencies.

When running the default c++ project in Visual Studios for a Windows CE 5.0 device, I get an error complaining about missing resources. Depends says that my executable needs ayghsell.dll (the Windows Mobile shell), and CoreDll.dll. Does this mean that my executable can only be run on Windows Mobile devices, instead of any generic Windo...

C++ and SOAP

I have a C++ app that needs to connect to a JAVA web app, are there any good, open source SOAP packages for this, or would it be easier to just roll my own? ...

Linker order - GCC

Why does the order in which libraries are linked sometimes cause errors? ...

Resources online to learn C++

Are there any quality resources online for me to learn C++? Edit: I wanted to make a note that the extent of my C(++) knowledge now is cout << 'minimal'; ...

How do I get started in embedded programming?

I would like to get started in embedded systems programming but don't know where to start...I have a very solid knowledge of C and C++ and would preferably like to use these languages with the GNU compilers. I have a degree in CS so I have a solid foundation... I have no clue about what hardware and other resources that I will need...I...

How can I overwrite the same portion of the console in a Windows native C++ console app, without using a 3rd Party library?

I have a console app that needs to display the state of items, but rather than having text scroll by like mad I'd rather see the current status keep showing up on the same lines. For the sake of example: Running... nn% complete Buffer size: bbbb bytes should be the output, where 'nn' is the current percentage complete, and 'bbb...

Simplest way to change listview and treeview colours

I'm trying to find a simple way to change the colour of the text and background in listview and treeview controls in WTL or plain Win32 code. I really don't want to have to implement full owner drawing for these controls, simply change the colours used. I want to make sure that the images are still drawn with proper transparency. Any sug...