I am working on refactoring some old code and have found few structs containing zero length arrays (below). Warnings depressed by pragma, of course, but I've failed to create by "new" structures containing such structures (error 2233). Array 'byData' used as pointer, but why not to use pointer instead? or array of length 1? And of course...
I am a COM object written in ATL that is used from a C++ application, and I want to pass an array of BYTEs between the two. My experience of COM/IDL so far is limited to passing simple types (BSTRs, LONGs, etc.).
Is there a relatively easy way to have the COM object pass an array to the caller? For example, I want to pass a raw image ...
Hi.
I have a method in an interface that I want to deprecate with portable C++.
When I Googled for this all I got was a Microsoft specific solution. (http://msdn.microsoft.com/en-us/library/c8xdzzhh(VS.80).aspx and http://msdn.microsoft.com/en-us/library/044swk7y(VS.80).aspx)
A second prize solution would be to ifdef a MSVC and a GCC so...
A program written in Visual C/C++ 2005/2008 might not compile with another compiler such as GNU C/C++ or vice-versa. For example when trying to reuse code, which uses windows.h, written for a particular compiler with another, what are the differences to be aware of?
Is there any information about how to produce code which is compatible ...
I'm talking about this:
If we have the letter 'A' which is 77 in decimal and 4D in Hex.
I am looking for the fastest way to get D.
I thought about two ways:
Given x is a byte.
x << 4; x >> 4
x %= 16
Any other ways? Which one is faster?
Thanks.
...
Are there any issues which might make MS's T4 Template code-generation system unsuitable for generating C++ code?
...
Hi,
say I have an asynchronous library, written in native C++, with an interface similar to this:
class connection {
public:
boost::signal< void() > sig_connection_made;
boost::signal< void(const std::string&) > sig_error;
void connect(const std::string& host, const std::string& port);
};
that I want to wrap in C#. Does ...
Hi all,
I'm trying to create a custom web browser for on a pocket pc in C++ MFC. When I add the Microsoft Web Browser activeX control and run the app on the pocket pc (emulator) then this error pops up:
"Debug assertion failed. occcont.cpp line: 916"
When I look in the debug window of VS2005:
"CoCreateInstance of OLE control {8856F961-...
Hello all,
I looked at the different options for plotting functions (or other types of graphs) in an interactive window. I mostly use wxWidgets but I'd be open to any other "interfaces".
Looking at what is available, here is what I've found:
wxPlot: Not updated since 2006. But it would be a good candidate if it was...
wxMathPlot: Ve...
What Database Abstraction Layer libraries would you recommend for use with C++? I am more interested in solutions for non-Windows platforms, but that is personal preference. Which libraries would you recommend and why?
...
The "ATL simple object" wizard doesn't provide a way to specify that a new class is derived from an existing coclass and its interface. In Visual Studio 2008, how do I make a new ATL COM class derived from an existing one (i.e. Base implements IBase, and I want to make a new Derived class derived from Base that implements IDerived, where...
Can you recommend an open source library (C or C++) to convert MS Office files into a set of images?
I am evaluating ImageMagick and while it does support PDF files, it does not work with MS Office files.
...
So using the system command file we can use file to determine if a file is ASCII Text or "data". I wanted to know if there is a way to check in code which one it was? I want to basically throw a corrupt error if the file is 'data'. I am using ifstream for reading the files. Thanks for any help!
Duplicate of this question.
...
Recently, when porting some STL code to VS2008 I wanted to disable warnings generated by std::copy by defining the new _SCL_SECURE_NO_WARNINGS flag. You can do this in two ways:
Using the /D compiler switch, which can be specified in the project properties. You need to ensure it is defined for both Release and Debug builds, which I of...
I'd like to setup a build server for unmanaged C++ code developed in Visual Studio 2005. The build server should be able to do the following:
Monitor a Subversion repository for code changes and schedule a build
Checkout code from Subversion and run unit tests
Provide some sort of report on build success and changes from previous build...
Recently voted into the C++0x working paper was an attribute syntax. This syntax provides a way to specify other pieces of information to the compiler. The Committee Draft also includes several standard attributes.
The syntax is to wrap the attribute list in double square brackets, e.g. [[noreturn]]. These attributes can be "namespaced"...
I have a screen with say 20 controls on it.
I want to show all twenty, then hide only the ones that don't relate to what I'm working on.
psudoCode.
for each element
show element
for each element in hide list
hide element.
My problem is that between the loops the screen paints. It looks very ugly.
I know I've seen this do...
Seems a great C++ unit testing framework. I'm just wanting something a bit more sophisticated than the console output for running the test, also something that makes it really easy to run specific tests (since gtest supports all kinds of test filtering)
If there is nothing, I'll probably roll my own
...
I want to use the nltk libraries in c++.
Is there a glue language/mechanism I can use to do this?
Reason:
I havent done any serious programming in c++ for a while and want to revise NLP concepts at the same time.
Thanks
...
What should I keep in mind when converting my projects from C to C++? Is there any reason to use C at all? The only thing in my mind now is to make sure it's friendly to DLLs so I can create a C interface if I need it.
Note: I know C++ just fine. Templates, partial specialization, why multiple inheritance is bad (I've only seen one prop...