Hello all...
I am trying to parse an XML document in C++. I do not have any form of metadata associated with the document. Since i am a novice with XML's i wanted to understand the best way to parse this xml. I am using libxml2 to achive this.
What i am doing currently is
1) walking the complete tree node by node , using pointers of ...
I am trying to connect two of the same app with winsock, but the connecting side has to use ConnectEx() which requires a bound socket. So the problem is that when I try to loop back using ip 127.0.0.1, I get error 10048(WSAEADDRINUSE).
Is there any way around this problem?
Thanks for any help
...
hey, i got an question about what is going on in the next code:
typedef struct {
double re,im;
} Complex;
Complex ComplexCreate(double r=0.,doublei=0.)
{
Complex c;
c.re=r;
c.im=i;
return c; // problem with this line
// my question is : is c getting duplicated and returning or does it return not...
I have an unfinished MathML rendering library written in C++. I ceased development a few months ago due to lack of time. The library [still] uses the TrueType version (unsupported) of the STIX fonts beta [version 1.0 of the STIX fonts (OpenType Postscript format) has since been released].
Development of this kind of library is a HUGE un...
I have a legacy C++ application using /clr calling a managed dll (written in C#)
The app uses #import to reference ADOX. The dll also references ADOX.
Everything is fine until I add a reference to my dll to the C++ project. Then I get hundreds of errors when compiling STDAFX.CPP related to msadox.tli and msadox.tlh. Some of the errors ...
I have a situation like below in which I have some problem in freeing the memory. Basically I have a vector that holds pointer to objects from classA. I have another classB that store the pointer of classA from the vector. It would make use of the objB. The problem is I need to operate on the vector to erase the pointer.
So how could I...
I've searched for any hints how I can do this, but all I found was how to redirect a SxS DLL to the local application folder.
Here is what I want to accomplish:
The (C++) Application.exe is linked to a DLL, Plugin.DLL (dependant project). This DLL is not placed inside the application directory, but in a subfolder called "plugins". As the...
A static check tool shows a violation on the below code:
class CSplitFrame : public CFrameWnd
...
class CVsApp : public CWinApp
CWnd* CVsApp::GetSheetView(LPCSTR WindowText)
{
CWnd* pWnd = reinterpret_cast<CSplitFrame*>(m_pMainWnd)->m_OutputBar.GetChildWnd(WindowText);
return pWnd;
}
ERROR MSG:
Clas...
Is this legal? If not, will the following code allow this?
class Foo
{
friend class Foo;
}
...
You have a simple struct, say:
typedef struct rect
{
int x;
int y;
int width;
int height;
}
rect;
And you want to multiply each element by a factor. Is there a more concise way of performing this operation, other than multiplying each member by the value?
...
Hi there,
I used VIM whole my life but recently I am a bit tired of it because I am lost in buffers, windows, and tabs when working simultaneously with 20 files or so in a big project (with 500k LOC, and hundreds files).
Whenever i do :make, :grep etc new buffers are jumping out in the current window.
The same happens for the tags. At ...
How do you call operator<<(std::ostream &os, const ClassX &x) from inside gdb ?
In other words, how do you print an object in gdb ?
call std::cout<<x or call operator<<(std::cout, x) don't seems to work for me!
Any ideas?
...
I want to change Menu's Text color, but not MenuItem.
...
I need some synchronous mechanism for thread. I am wondering the implementation below which one is a better way?
classA{
public:
int sharedResourceA;
pthread_mutex_t mutex1;
functionA();
int nonSharedResources;
}
classA::functionA(){
pthread_mutex_lock( &mutex1 );
use sharedResourceA;
pthread_mutex_unlock( &mutex1 )...
I see this in code sometimes:
struct S
{
int count; // length of array in data
int data[1];
};
Where the storage for S is allocated bigger than sizeof(S) so that data can have more space for its array. It is then used like:
S *s;
// allocation
s->data[3] = 1337;
My question is, why is data not a pointer? Why the length-1 ...
Hello, I am debugging a large project in C++. There are a few dereferenced pointers causing random crashes. Could you suggest me please best free tool for pointer validation? (Identification of use of invalid pointers)
(Otherwise it will took me ages to go through it manually)
Also I have used Memory Valuator program to get rid of the ...
Hello :)
I am interposing the memcpy() function in C because the target application uses it to concatenate strings and I want to find out which strings are being created. The code is:
void * my_memcpy ( void * destination, const void * source, size_t num )
{
void *ret = memcpy(destination, source, num);
// printf ("[MEMCPY] = %...
Today I made a 64bit build of my project for the first time. Basically it compiled, linked and ran ok, except for warnings complaining about incompatibility between the new, 64bit size_t type and the simple int type. This mostly occurs in situations like this in my code:
void func(std::vector<Something> &vec)
{
int n = vec.size();
...
hello everyone, can somebody explain me what is the difference between those two terms, found some information here http://javalab.cs.uni-bonn.de/research/darwin/delegation.html but can't understand
thanks in advance
...
Hi..
Let's say we have a class called Complex which represents a complex number.
I want to convert this object to a double object.
The other way around i can do by implementing a copy ctor in Complex:
Complex(const double &d);
However, i can't implement i copy ctor in double which will receive a Complex.
How do i do this? I know ther...