C++ need for Assembly in embedded systems
I hear of a need to call assembly functions/calls when programming embedded systems in C. Is this necessary in C++ or not? ...
I hear of a need to call assembly functions/calls when programming embedded systems in C. Is this necessary in C++ or not? ...
Hello, is there any way I can install a system-wide ShellExecute hook using C++ without having to inject a hooking module into every active process. I am using Windows 7. My purpose for this is because, I want to be able to select which browser a link is opened in when a link is opened with the default browser using ShellExecute, like th...
Ok, im used to see some more syntax highlighting, and the default syntax highlighting is really limited in VS 2008, so i was thinking, is there such highlighting somewhere: defined variables would have own color. defined functions would have own color. predefined functions would have own color (from libs etc, would have own list for th...
I have an idea of how I want to approach this but i'm not sure if it is ideal. By event I mean for example, if the player wins, a bunch of sparks fly for 1 second. I was thinking of creating my game engine class, then creating a game event base class that has 3 void functions, update, draw, render. There could be for example fireforks fo...
I'm looking for a smart way to copy a multidimensional char array to a new destination. I want to duplicate the char array because I want to edit the content without changing the source array. I could build nested loops to copy every char by hand but I hope there is a better way. Update: I don't have the size of the 2. level dimension...
I want to output my floats without the ending zeros. Example: float 3.570000 should be outputted as 3.57 and float 3.00000 should be outputted as 3.0 (so here would be the exception!) ...
Suppose I have a diamond inheritance situation as follows: class A{ public: virtual void foo(){}; }; class B: public virtual A{ public: virtual void foo(){}; }; class C: public virtual A{ public: virtual void foo(){}; }; class D: B, C{}; The last line yields a compilation error citing ambiguity. As I understand it, the pr...
Hi, i'm writing a double value to a file. The numeric value is written with a point as a decimal separator. I would like to use a comma. How i can do that? ...
Say I have something like -- this is just an example mind you. class Car { void accelerate(); void stop(); } class Person { void drive(Car car); } class Toyota : public Car { void accelerateUncontrollably(); } class ToyotaDriver : public Person { void drive(Car car) { // How to accelerateUncontrollably without...
I'm working on a simple class to manage the lifetime of a HKEY. class Key { HKEY hWin32; public: Key(HKEY root, const std::wstring& subKey, REGSAM samDesired); Key(const Key& other); ~Key(); Key& operator=(const Key& other); Key& swap(Key& other); HKEY getRawHandle() { return hWin32; }; }; //Other Methods.....
Hey, if you can get a more descriptive tittle please edit it. I'm writing a little algorithm that involves checking values in a matrix. Let's say: char matrix[100][100]; char *ptr = &matrix[0][0]; imagine i populate the matrix with a couple of values (5 or 6) of 1, like: matrix[20][35]=1; matrix[67][34]=1; How can I know if the bi...
I've been creating a class that takes a bunch of images and overlays them onto one BMP. For some reason upon running the code I'm getting a segfault and I've tracked it down to this method. Essentially the if statement checks to see if there is a valid index in the array of images to place this new image in. If it is valid then it del...
I realize this may be subjective, so will ask a concrete question, but first, background: I have always been an embedded software engineer, but usually at Layer 3 or 2 of the OSI stack. I am not really a hardware guy. I have generally always done telecoms products, usually hand/cell-phones, which generally means something like an ARM ...
I have always been an embedded software engineer, but usually at Layer 3 or 2 of the OSI stack. I am not really a hardware guy. I have generally always done telecoms products, usually hand/cell-phones, which generally means something like an ARM 7 processor. Now I find myself in a more generic embedded world, in a small start-up, where ...
I want to be able to create an array of calculated values (let's say for simplicity's sake that I want each value to be the square of it's index) at compile time using template metaprogramming. Is this possible? How does each location in the array get initialized? (Yes, there are easier ways to do this without resorting to template m...
Encountered this problem before but forgot how I solved it. I want to use the STL string class but the complier is complaining about not finding it. Here is the complete .h file. #ifndef MODEL_H #define MODEL_H #include "../shared/gltools.h" // OpenGL toolkit #include <math.h> #include <stdio.h> #include <string> #include <iostream> ...
I've used them in java and didn't seem to have too many issues, but I'm not grasping them very well in C++. The assignment is: Write a class named Car that has the following member variables: year. An int that holds the car's model year. make. A string that holds the make of the car. speed. An int that holds the car's curr...
I'm attempting to create C#-like multicast delegates and events using features from TR1. Or Boost, since boost::function is (mostly) the same as std::tr1::function. As a proof of concept I tried this: template<typename T1> class Event { private: typedef std::tr1::function<void (T1)> action; std::list<action> callbacks; public: inli...
Risk Factors for File Fragmentation include mostly full Disks and repeated file appends. What are other risk factors for file fragmentation? How would one make a program using common languages like C++/C#/VB/VB.NET to work with files & make new files with the goal of increasing file fragmentation? WinXP / NTFS is the target Edit: Wou...
Is there a way to know when a process is hung? is there a win32 call for this? ...