c++

How to hide MFC splash screen in auto start?

Hi, I have a MFC app without main window. When users start it, it displays the splash screen for 1~2 seconds, then splash screen fades out to system tray. Users start to access the menu by clicking the icon in the tray. The app can also auto start when users login to Windows (adding entry in Start Up folder). The same process describe...

C++ Object Graph to C#

Is there a tool that will take a series of C++ headers and generate a XSD and a class that will serialize the C++ to XML? Or really what we are looking for is the simplest way to migrate data from C++ to C#? We have a library in C++ that we would like to write a GUI for in C#. Using Managed wrapper classes it seems like we will have t...

Is there a gcc 4.2 warning similar to Visual Studio's regarding possible loss of data?

Is there a flag for gcc such that conversions from a long to a short will generate a warning about a possible loss of data? I'm working on a C++ application that is compiled for both Visual Studio (2005) and GCC 4.2 (for Mac OS X). The warnings that Visual Studio prints out follow this pattern: : warning C4244: 'argument' : conversion...

What does it mean to instantiate an object using curly braces in C++?

Let's say I have a struct defined as: typedef struct number{ int areaCode; int prefix; int suffix; } PhoneNumber; When I create an instance of this struct, if I use the following syntax: PhoneNumber homePhone = {858, 555, 1234}; ...which constructor is it calling? The default constructor, or the copy constructor, or non...

Best commercial C++ IDE?

I have tried C++ Builder 2009 and Visual Studio 2008. VCL seems much more friendlier than MFC. Are there alternates which are superior than these two? PS: Please do not suggest freebies or open source IDEs. I really am interested in commercial IDE's only. ...

C++ Segregated Free Lists

I need to use segregated free lists for a homework assignment and I was wondering if the STL or some other library had these already written so I don't have to reinvent the wheel? ...

What is a good way to load textures dynamically in OpenGL?

Currently I am loading an image in to memory on a 2nd thread, and then during the display loop (if there is a texture load required), load the texture. I discovered that I could not load the texture on the 2nd thread because OpenGL didn't like that; perhaps this is possible but I did something wrong - so please correct me if this is act...

Function for manipulating container of Base/Derived objects

consider the following algorithm with arrays: class MyType; { // some stuff } class MySubType:MyType { // some stuff } void foo(MyType** arr, int len) { for (int i = 0;i<len;i++) // do something on arr[i]-> } void bar() { MySubType* arr[10]; // initialize all MySubType*'s in arr foo(&arr, 10); } Noth...

Webcam driver settings?

I'm working on a C++ application that uses OpenCV/ffmpeg to capture video frames from my built-in webcam (Studio XPS 13). This application is really sensitive to those auto light adjustments that the webcam driver does.... is there any way I can change this behavior? Either via some webcam driver settings app, or in code (you may suggest...

MPI Genetic Monte Carlo Algorithm Resources?

I have been working with some friends to convert a Matlab Genetic Algorithm to C++ and it works in a sequential order currently. Matlab is no longer a portion of our current code. We are looking to use it on a cluster, but have been a little dry on resources. We have a cluster available at the University and it is equipped with Rocks ...

Will this be out of scope and not function properly?

I'm declaring a struct inside my code and then trying to insert it into a data structure that I have written. However, I'm concerned that since I declare the struct inside the function, once the function ends, the data structure will be pointing to garbage. Can anyone help with this? Here's the code: void Class::function() { // do ...

Keeping address in C++ hacking game code?

I have this code that edits addresses in a game to get unlimited ammo and what not, and I found out that the addresses are different for every computer, sometimes every time you restart the game, so how would I manage making this work still even though they change. ...

Create an ActiveX control with pure WinAPI? (no MFC/ATL/etc)

Hi all, I'm looking at getting into ActiveX development and hopefully make a couple browser plug-ins by the end of things. I'm a seasoned WinAPI developer who has stayed away from such wrappers as MFC and ATL in the past, so I have virtually no experience in either area. However, in searching for tutorials on creating ActiveX controls in...

Conditionally disable warnings with qmake/gcc?

Hello, I am involved with a software project written in Qt and built with qmake and gcc on Linux. We have to link to a third-party library that is of fairly low quality and spews tons of warnings. I would like to use -W -Wall on our source code, but pass -w to the nasty third-party library to keep the console free of noise and clutter...

From Visual Studio C++ 6.0 to VS 2008?

I work in a company doing C++ development on VC6, and we're considering a move to VS 2008. What are the benefits of upgrading? What are the cons? Any guides/steps on migrating project files, or gotchas I should be aware of? Are people ok with moving to the different development interface? ...

Zeroing out a struct in the constructor

A wide range of structures is used in Win32 programming. Many times only some of their fields are used and all the other fields are set to zero. For example: STARTUPINFO startupInfo; // has more than 10 member variables ZeroMemory( &startupInfo, sizeof( startupInfo ) ); //zero out startupInfo.cb = sizeof( startupInfo ); //setting size i...

Where do you go for C++ news?

I've been getting more and more interested in C++ outside of my work in the past two years. I've read quite a few books about deeper issues in C++, and in most of these books the "C/C++ User's Journal" is often referenced. I was sad to find out it was merged with Dr. Dobb's Journal. When I asked my boss this same question, he, a .NET ...

Manipulating with pointers to derived class objects through pointers to base class objects

I have this code to represent bank: class Bank { friend class InvestmentMethod; std::vector<BaseBankAccount*> accounts; public: //... BaseBankAccount is an abstract class for all accounts in a bank: class BaseBankAccount { public: BaseBankAccount() {} virtual int getInterest() const = 0; virtual int getInve...

How to detect cycles when using shared_ptr

shared_ptr is a reference counting smart pointer in the Boost library. The problem with reference counting is that it cannot dispose of cycles. I am wondering how one would go about solving this in C++. Please no suggestions like: "don't make cycles", or "use a weak_ptr". Edit I don't like suggestions that say to just use a weak_ptr...

include a cpp file in jsp

i am very new to jsp... i am currently doing a project where i have to interface a card reader with my html page. i got the card-reader code in a cpp and .h file. is there any way i can use these file with my jsp.. or do i have to recode it in java and include a .js file. specifically, i have a text input for ID on my page. i need it t...