I have a class that uses libxml2. It has static members which are used to hold context for a schema file and its parser. I'm using valgrind, and it's complaining that memory is not deallocated in connection with the schema context. This is because you need to free that memory yourself. However, since these context variables are stati...
Hopefully someone can help me out here.
I'm using Visual Studio 2005 and creating a static library that links in wxWidgets statically.
I have:
compiled wxWidgets statically according to their guide
included the lib directory in my "Additional Library Directories" property
added all of the wxWidget libs in my "Additional Dependencies" p...
I currently have a function template, taking a reference, that does something in essence equivalent to:
template <typename T>
void f(T& t)
{
t = T();
}
Now, I can call:
int a;
f(a);
To initialize my variable a.
I can even do:
std::vector<int> a(10);
f(a[5]);
However, this will fail:
std::vector<bool> a(10);
f(a[5]);
The re...
Hello,
I have an unmanaged C++ MFC dll that was developed in VS 6.0. I would like to use it in my C# app. I'm trying to use PInvoke.
Here is the C++ code:
// testDll.cpp : Defines the entry point for the DLL application.
//
#include "stdafx.h"
extern "C" {
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_rea...
NOTE: THIS IS NOT HOMEWORK IT IS FROM A PRACTICE EXAM GIVEN TO US BY OUR PROFESSORS TO HELP US PREPARE FOR OUR EXAM
I'm currently studying for a programming exam. On one of the sample tests they gave us we have the following question:
Suppose you have been given a templated Container that holds an unordered collection of objects.
temp...
Possible Duplicates:
Why is there a special new and delete for arrays?
( POD )freeing memory : is delete[] equal to delete ?
What's the result if I use delete p instead of delete [] p for an array?
I met two answers for this problem.
1 only the first element will be freed.
2 there comes to a catastrophic end.
My question is...
The answer to this may be a simple no, but here goes...
I'm currently using the boost function regex_match to evaluate a string against a regex value.
Instead of just returning T/F, is there a way to find out which element of multiple joined statements evaluated to true?
For example:
^a$|^z$|^p$
a --> 0
z --> 1
f --> -1
...
I'm creating an S60 application that will have a main dialog with a listbox of 5 or so items.
but i keep receiving a message : "application app1 closed" when trying to run the application on the emulator.
This is my resource file (app1.rss)content :
RESOURCE DIALOG r_dialog
{
flags=EAknDialogSelectionList;
buttons=R_AVKON...
I just saw this block of code on the Wikipedia article on conditional operators:
Vehicle new_vehicle = arg == 'B' ? bus :
arg == 'A' ? airplane :
arg == 'T' ? train :
arg == 'C' ? car :
arg == 'H' ? horse :
feet;...
I'm using the Windows HTTP API to process web service requests in C++ (not .NET) and everything works just fine for HTTP requests. When I change the URLs I'm expecting with HttpAddUrl to https://example.com:443/foo/bar my tests from Internet Explorer no longer connect. My code does not get called at all and the calls to HttpReceiveHttpRe...
I'm developing a small haskell program that uses an external static library I've developed in C++. It accesses the lib through ghc's FFI (foreign function interface). Inside this library I would like to do some output to the console. However, it looks to me like the c++ side of things does not have a correct handle to stdout because outp...
I have a very large, complex (million+ LOC) Windows application written in C++. We receive a handful of reports every day that the application has locked up, and must be forcefully shut down.
While we have extensive reporting about crashes in place, I would like to expand this to include these hang scenarios -- even with heavy logging...
Hello stack overflowers,
Here is the problem i am facing, does anyone have solution?
Class A: public class B
{
// I want to pass a reference of B to Function
}
void ClassC::Function(class& B)
{
//do stuff
}
...
We have a c++ legacy application and have been extending it with c# applets that are invoked using COM from the parent c++ app. They bring up windows that are not modal. Moreover, I think these .NET windows are not proper children of the c++ application, since EnumChildWindows misses them, and EnumWindows finds them. One child-like beh...
How to open and read the pixels of an image in c++? Read them in the form of X, Y and to know the color.
...
I am trying to do a comparison of CString from ATL/MFC to a custom CString implementation and I want to make sure that all the functionality in the custom implementation matches that of the ATL/MFC implementation.
The reason we have a custom CString implementation is so that we can use it on *nix and Windows platforms. The interface is ...
So I have a couple of structs...
struct myBaseStruct
{
};
struct myDerivedStruct : public myBaseStruct
{
int a, b, c, d;
unsigned char* ident;
};
myDerivedStruct* pNewStruct;
...and I want to dynamically allocate enough space so that I can 'memcpy' in some data, including a zero-terminated string. The size of the base struct...
I have a rounded rectangle that I make like so
dc.RoundRect(textBorder, CPoint(20, 20));
Later on I draw a line through it about 1/3 of the way down.
dc.LineTo(textBorder.right, textBorder.top + 15);
Now I would like to fill just the part above the line with a solid color. In other words I need to fill a partially rounded rectan...
Error 1 fatal error LNK1000: Internal
error during
IncrBuildImage MFC_Test MFC_Test
Why do I get this weird error every 2nd time I compile?
...
Hi,
I found the following code in the book "Accelerated C++" (Chapter 6.1.1), but I can't compile it. The problem is with the find_if lines. I have the necessary includes (vector, string, algorithm, cctype). Any idea?
Thanks, Jabba
bool space(char c) {
return isspace(c);
}
bool not_space(char c) {
return !isspace(c);
}
vector<s...