The barebones version of a .cpp file is often not much more than a copy of the related header file with some braces instead of semicolons, ClassName:: inserted in a few places, and removing the virtual keyword. Much of it could be generated with a one-line sed command, but it wouldn't be very robust for all the language features (templat...
I need to write a couple DLLs that will both be accessed from a C# application and a C++ application. Initially, I was thinking that I could save time/effort by writing the DLLs in C# and linking to them from the C# and C++ applications. Is this approach wise, or should the DLLs be written using C++?
...
I am starting work on a new project where the core product is a Software Library. There is existing code we will be wrapping, written in C++ because it is very numerically intensive; we own and compile this core code.
I believe we will have two prominent client types:
1. App written in C++, probably MFC
2. App written in C#.NET.
The Q...
what is the difference between the string and character array.
how can each element of the string be accessed in C++.
...
C++, using Visual Studio 2010. A question about why a user-defined trait of hash_map actually requires total ordering.
I have a simple structure, say FOO, which only has a number of integers. I'd like to use hash_map, which is a hash table whose keys are unordered, to store the structure of FOO. I just need a fast searching of its asso...
I use wchar_t for internal strings and UTF-8 for storage in files. I need to use STL to input/output text to screen and also do it by using full Lithuanian charset.
It's all fine because I'm not forced to do the same for files, so the following example does the job just fine:#include <io.h>
#include <fcntl.h>
#include <iostream>
_set...
Is there an application which allows me to see what is being sent to a DLL from a process?
I have a process and I have a DLL and I would like to monitor the parameters that are being sent to the functions so that I can use the DLL myself.
The EXPORT of the DLL is.
??0CCPCompressor@@AAE@XZ
??0CCPExpandor@@AAE@XZ
??1CCPCompressor@@AAE@X...
I'm quite new to C++ but have some basic C knowledge. In my past C (university) projects, I used Valgrind to check for memleaks.
Now, with C++, is Valgrind a valid tool? Does C++ suffer the same problems concerning memleaks like C? Or are there even better tools to use in conjunction with C++?
...
I have a simple C++ object that I create at the start of function F() to ensure two matched functions (OpDo, OpUndo) are called at the start and return of the F(), by using the object's constructor and destructor. However, I don't want the operation to be undone in case an exception was thrown within the body of F(). Is this possible to ...
Say I get {1,2} from function f(a,b) (it doesnt matter what f is/does), and I want to store it into int s[2]. How would I do it? It seems that I can't just do int s[2] = f(a,b), and I can't separate the output of f, since there is no variable to get the values from. f(a,b)[0] does not work.
...
I'm looking for the best C or C++ code to encode and decode decimal latitude and longitude values from/to double/char. I'd prefer the code convert from double to char[] and vice-versa
rather than c++ strings.
If you have a code snippet that would be great too.
To clarify: I need to convert from a string Degrees/Minutes/Seconds to doub...
Windows XP/Vista/7
System Properties
Advanced tab
Settings... button under Performance
Advanced tab
Change... button
The numbers at the bottom of that window in the "Total paging file size for all drives" section
Anybody know how I would go about getting those three numbers from within a C++ program?
Thanks!
...
The facts:
I have two predominant classes: Manager and Specialist.
There are several different types of Specialists.
Specialists often require the help of other Specialists in order to get their job done.
The Manager knows all of the Specialists, and initially each Specialist knows only their Manager. (This is the problem.)
At runti...
First, a little background: I'm working on building a simple graph class with basic graph algorithms (Dijkstra, Floyd-Warshall, Bellman-Ford, etc) to use as a reference sheet for an upcoming programing competition.
So far I have a functioning version of Floyd-Warshall, but the downside is that so far it's only getting me the shortest di...
I've tried running valgrind (memcheck and massif) on an app I wrote, but all I get back are addresses for the functions that executed.
---------------------------------
Context accounted for 0.6% of measured spacetime
0x805F29A: (within prog_name)
0x8141740: (within prog_name)
Called from:
0.6% : 0x812E077: (within prog_name)
...
Hello. I'm working with gnump and have a function that must return mpz_t. So I have to use raw pointers to return a value. I allocate space with new for pointer and send it as a parameter in my function.
I think it is better to use smart pointers. But I didn't work with them before. I read the manual but still can't understand how to ...
I am updating an old MFC application that used WinHelp so that it now uses HtmlHelp. I've changed the constructor of CWinApp-based class so that it calls EnableHtmlHelp(). Then I've changed the old calls from WinHelp( IDH_CONTENTS, HELP_CONTEXT) to HtmlHelp( IDH_CONTENTS, HH_HELP_CONTEXT). Unfortunately, whenever I try to open the help f...
Hi,
I have a list which contains a number of _MEMORY_BASIC_INFORMATION structs nested within mb structs (defs below). What I am having problems with is getting the info from the nested _MEMORY_BASIC_INFORMATION out. I am using an iterator to traverse the list. From below I know the error is g->mbi; but I don't know how I should refer...
Hi
For my new application I would like to parse another C, C++ or C# project, so that i can later display the graphical representation of all the classes in this project.
So I thought that its a good approach to use a database with the following tables to store the necessary information:
TablePackages:
id | name | parentID
TableClass...