I have an application written in c++ using visual studio 2005. The application has certain performance problems. I would like to explore where. I need to drill down in which classes/methods/lines the application spends most of the time. Can this be done with the WPA? If yes, can you, please give me a pointer to documentation?
...
i would like to execute a batch file from a program (exe file). i usually create the batch file while program (exe file) execution. and will the execl("START","",NULL);
the function is calling the batch file, but unfortunately new command window is showing up as the execl function is process START and parses as “cmd.exe /k "
.
can you ...
hi im working on something that demands me to get access to specific/range of bits. i decided to use bitset because it is easy to get access to specific bits but can i extract a whole range of bits?
...
void printLine(const wchar_t* str, ...)
{
// have to do something to make it work
wchar_t buffer[2048];
_snwprintf(buffer, 2047, ????);
// work with buffer
}
printLine(L"%d", 123);
I tried
va_list vl;
va_start(vl,str);
and things like this but I didn't find a solution.
...
I have created a container for generic, weak-type data which is accessible through the subscript operator.
The std::map container allows both data access and element insertion through the operator, whereas std::vector I think doesn't.
What is the best (C++ style) way to proceed? Should I allow allocation through the subscript operator ...
Hi, I wonder if there exists any add-on for VS that can substitute/tag some lines of code with a descriptive text of my choice ?
Ideally a function like the one below :
bool CreateReportFiles(LPCTSTR fn_neighbours, ULONG nItems, ULONG* items)
{
// Read from file
CFile cf_neighbours;
if (!cf_neighbours.Open(fn_neighbours, CF...
Hi,
my question is about how to use bitwise operators on C++ std::string... through overloading or as function does not matter
Example for an working XOR/^ function for std::string:
std::string XOR(std::string value, std::string key)
{
std::string retval(value);
long unsigned int klen = key.length();
long unsigned int vlen = val...
I'm trying to get a fullscreen 8 bit depth framebuffer but I can't find any visual to work with. I want 8 bit truecolor, where 3 bits are red, 3 bits are green and 2 bits are blue. I'm using XF86 to go fullscreen.
// pass
int found = XMatchVisualInfo(l_display, l_screen, 24, TrueColor, &visual);
// all of these fail
found = XMatchVisu...
Recently, our big project began crashing on unhandled division by zero. No recent code seems to contain any likely elements so it may be new data sets affecting old code. The problem is the code base is pretty big, and running on an embedded device with no comfortable debug access (debug is done by a lot of printf()s over serial console,...
with "basic" is meant: Only the operators "+" (->following..) and "|" (->or) are needed.
Prototype:
preg_match_all(std::string pattern, std::string subject, std::vector<std::string> &matches)
Usage Example:
std::vector<std::string> matches;
std::string pattern, subject;
subject = "Some text with a lots of foo foo and " + char(255) ...
It's important to detect an error when you close a file to which you were writing, because the last part of your data could be flushed during the close, and if it's lost then your last write effectively failed and someone should know about it. The destructor for a file object is a nice place to automatically close it, but people say not...
I have a pretty plain Win32 application that links against a library I wrote that contains resources in an .rc file. The problem is that the .exe doesn't seem to find those resources. But if I move the .rc file from the library project to the .exe project resource loading works.
What step am I missing? I have the impression I have to c...
Hi,
I am writing a program in unix. At the moment, it has a console interface. I am just curious like dll's in windows does a similar concept exist in unix when another program wants to call your program. I have been asked to simply provide a binary with little else in terms of details. I have a feeling that there might be another pr...
I have a class that holds an array of elements, and I want to give it a GetSize member function. But what return type should I give that function?
I'm using the pimpl idiom, and so in the header file it is not known what the implementation will use to store the elements. So I cannot just say std::vector<T>::size_type, for example:
cla...
I know several (all?) STL implementations implement a "small string" optimization where instead of storing the usual 3 pointers for begin, end and capacity a string will store the actual character data in the memory used for the pointers if sizeof(characters) <= sizeof(pointers). I am in a situation where I have lots of small vectors wit...
I have a very large file I need to parse, so reading it into memory all at once is non-ideal. The way the file is structured, it would be much, much easier if I could start at eof and go up to the beginning. Does anyone have a good trick for doing this? I'm using Visual Studio 2008 and C++. Thanks
...
Is there any reason for the implementation class as used in the pimpl idiom to have any private members at all? The only reason I can really think of is to protect yourself from yourself -- i.e. the private members serve to enforce some kind of contract between the class and the user, and in this case the class and the user are rather in...
When I try compiling the following:
#include <iostream>
class Test
{
public:
void* operator new (size_t num);
void operator delete (void* test);
~Test();
private:
Test();
};
Test::Test()
{
std::cout << "Constructing Test" << std::endl;
}
Test::~Test()
{
std::cout << "Destroying Test" << std::endl;
}
void* Tes...
"I got a server telling Flash to load a movie, but I can't
tell the movie how fast to play, or what frame to start on"
Do you have an example of a Flash client loading an swf and accepting server commands; frame rate, start etc?
NEED FLASH CLIENT - data events - control loaded swf
I've seen examples of a flash clients loading exter...
How do you initialize a 3d array in C++
int min[1][1][1] = {100, { 100, {100}}}; //this is not the way
...