Hey guys, I'm creating a DLL in C++ and I want it to be usable from .NET apps (both C# and VB.NET). I've been scouring the internet for tips and what I've found so far suggests:
Declaring my C++ functions as extern C and using __stdcall
Using basic C types for parameters and return types instead of STL containers (e.g. char* instead of...
And what's your suggestion to move to the next level of C++ programming for someone who may be called, well, an intermediate C++ programmer?
Intermediate Programmer: Understands ISO C++ reasonably well, can read and modify other's code with some luck, good with data structures and algorithms but not great
Learn C++0x
Learn what kind ...
Hello,
I have a custom XML format that needs to be serialized to objects.
I only need to serialize certain tags and ignore the rest.
I have the impression that I need to write my own archive class but there is no documentation that explains how can it be done.
I do not need to save anything, just load the initial state of the object.
Any...
Weka is probably the most popular general purpose machine learning library. But it can be quite slow in my experience.
I have been looking at Shark, Waffles, dlib, Plearn, and MLC++ as alternatives. Of these, Shark and dlib look the most promising.
Does anyone have any experience when it comes to performance testing of these librarie...
This has probably been asked before on SO, but I were unable to find a similar question.
Consider the following class hierarchy:
class BritneySpears
{
public:
virtual ~BritneySpears();
};
class Daughter1 : public BritneySpears
{
public:
virtual ~Daughter1(); // Virtual specifier
};
class Daughter2 : public BritneySpears...
In the below code, I have a corrupt "hello.bz2" which has stray characters beyond the EOF.
Is there a way to make the boost::iostreams::copy() call to throw ?
#include <fstream>
#include <iostream>
#include <boost/iostreams/filtering_streambuf.hpp>
#include <boost/iostreams/copy.hpp>
#include <boost/iostreams/filter/bzip2.hpp>
int mai...
Possible Duplicate:
Where does the -DNDEBUG normally come from?
I am using assertions in my code, but I don't know if they will trigger, because I don't know if NDEBUG is defined or not. Am I supposed to to specify the -DNDEBUG explicitly during compilation?
...
I made a function to create cows variable, then later I made another function to butcher them. The two functions are methods in a class. When I use the create cow function it works, and I get the value of cows. However when I access the butcher function the value of cows is zero.
It's like there are two different variables; I didn't thi...
Hi,
I have a class Param.cpp which is a set of parameters for the main class Model.cpp. I create an instance of Param.cpp in a C# file using a graphic interface. It works great, I can see in debug that the param has a PropList containing one element - in my example.
My Model class has a function BuildModel(Param param) which set the m...
Hi all,
In one RTOS, i'm debugging one issue which is, program is crashing one point always when it send a 8-bit value (Lets call it 'Int8 rogue_int')to a function (lets call it 'Infected( Int16 )' ) whose definition is taking that variable as 16-bit variable. Before entering to that last function Infected(..), value for 'rogue_int' is ...
How does adding and removing elements "rescale" the data? How is the size of the vector calculated (I believe it is kept track of)? Any other additional resources to learn about vectors would be appreciated.
...
Hi,
I always thought that to be a "real" software developer or to work for serious companies on serious software projects, C/C++ knowledge is a requirement. A mandatory one.
I also thought that building software with C# is just as building a website with ASP.NET controls: it is still possible to do for some small products, but trying t...
I am trying the strtok in visual c++, but it seems not working. This not my first time using strtok, but i just counldnt figure out what is wrong with it. the code is quite simple.
in main
cout<<getLevels("/'Group'/'Channel1'")<<endl;
in getLevels()
int getLevels(char * fullPath){
int level=0;
char *nextToken;
char * pch=strtok_...
In C++, what is the best way to return a collection to client code without using iterators.
Let's say iterators are ruled out because eg the collection is remote. I'd like a signature for a function that returns the collection in the most useful form possible.
By 'best', I mean the best trade-off between clarity and genericity.
My in...
I have a function address_of, which returns a Pointer (encapsulating a shared_ptr) to its argument. address_of needs to work on both lvalues and rvalues, so there are two versions of address_of: one accepting a reference and the other accepting an rvalue reference. Since taking the address of a temporary is a Bad Thing, the rvalue versio...
I'm getting the following error when trying to output a stack trace through GDB:
global symbol 'object' found in a.cpp
psymtab but not in symtab
What does this error mean exactly, and is it caused by my code or is it a GDB issue?
...
We are currently building an API for a certain library.
Part of the interface requires the library to get and return to the user classes such as vector and string.
When trying to simulate use of the library in a simple scenario, in debug mode the system crush when delivering a string as an input.
I believe there is a different represen...
i got this thread.h file;
#ifndef THREAD_H
#define THREAD_H
#include <QtGui>
#include <QString>
#include <tray.h>
class svThread : public QThread {
public:
bool getIsPaused();
void checkSettings();
virtual void run();
void setPause(bool);
signals:
void mySignal(bool);
};
#endif // THREAD_H...
I am trying to declare a global function as a "friend" of a class:
namespace first
{
namespace second
{
namespace first
{
class Second
{
template <typename T> friend T ::first::FirstMethod();
};
}
}
}
When I compile this code under Visual C++ 2008 ...
I'd like to add a custom button to my Window's titlebar. This doesn't need to work on XP - just Vista and later. Searching on the net yields lots of results for doing it the WM_NCPAINT way (eg. http://www.catch22.net/tuts/custom-titlebar). Is there a way to do this using Vista/Windows7 with Aero is enabled?
Thanks for any help,
Dan.
...