The code worked all along. Somehow I manage to get Visual C++ Express not hit the break point on the final return statement and it appeared to run for ever.
In the example code bellow EnumWindows enumerates infinitely.
How can one make it stop after all windows has been enumerated.
#include <Windows.h>
BOOL CALLBACK EnumWindowsProc(HW...
Is there a single-expression way to assign a scalar to all elements of of a boost matrix or vector? I'm trying to find a more compact way of representing:
boost::numeric::ublas::c_vector<float, N> v;
for (size_t i=0; i<N; i++) {
v[i] = myScalar;
}
The following do not work:
boost::numeric::ublas::c_vector<float, N>
v(myScal...
Take a look at this example function:
RuntimeConfiguration* conf_rt_conf() {
RuntimeConfiguration *conf;
conf = new RuntimeConfiguration();
conf->arch_path="./archive";
conf->err_log="./err_log";
conf->fail_log="./fail_log";
conf->msg_log="./msg_log";
conf->save="html, htm, php";
conf->ignore="jpg, gif";...
Hello,
I'm new in C++.I have double variable double a=0.1239857 I want to limit variable a
from decimal point two digits.So a will be 0.12. I know C++ have functions that return largest or smallest integer that is greater or lower than a like ceil or floor.Is there a function that implement digit limitation of floating-point variab...
Hi,
I'm trying to write an editor overtop a multi-threaded game engine. In theory, through the editor, the contents of the scene can be totally changed but I haven't been able to come up with a good way for the engine to cope with the changes. (ie delete an entity while the renderer was drawing it). Additionally, I'm hesitant to write c...
I have a PHP module written in C++, which relies on a C++ library (Boost Date_Time) being installed.
Currently, in my config.m4 file I'm checking for the library as follows:
LIBNAME=boost_date_time
LIBSYMBOL=_ZN5boost9gregorian9bad_monthD0Ev
PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,,
[
AC_MSG_ERROR([lib $LIBNAME not found. T...
I had a colleague check in code like this in C (syntax #1):
(*(*(*p_member).p_member).p_member).member
When I asked him why he didn't use -> (syntax #2):
p_member->p_member->p_member->member
he got really defensive stating that syntax #2 is more complicated than #1...I ended up changing his code because I had to modify it and cou...
I've been all over the ifstream questions here on SO and I'm still having trouble reading a simple text file. I'm working with Visual Studio 2008.
Here's my code:
// CPPFileIO.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <fstream>
#include <conio.h>
#include <iostream>
#include <string>
...
I would like to retrieve an error message that explains why the jvm failed to load. From the examples provided here:
http://java.sun.com/docs/books/jni/html/invoke.html
I extracted this example:
/* Create the Java VM */
res = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
if (res < 0) {
// retrieve verbose error here?
f...
I don't mean how to connect to a socket. What should I know about UDP programming?
Do I need to worry about bad data in my socket?
I should assume if I send 200bytes I may get 120 and 60 bytes separately?
Should I worry about another connection sending me bad data on the same port?
If data doesnt arrive typically how long may I (typ...
Hi,
In a function in my C++ DLL, I'm returning a std::string to my c# application. It pretty much looks like this:
std::string g_DllName = "MyDLL";
extern "C" THUNDER_API const char* __stdcall GetDLLName()
{
return g_DllName.c_str();
}
But when my C# code calls this function, I get this message in my output window:
Invalid Add...
Trying to upgrade an MFC app to use the new MFC feature pack, we are loosing the messages from a context menu. The menu appears and can be clicked, but the message seems not to be handled anywhere. We overrode OnCmdMsg() in lots of places but to no avail, the context menu's command message are not caught.
Is there a way, tool, or approa...
I am bit confused about the difference between the usage of std::remove algorithm. Specifically I am not able to understand what is being removed when I use this algorithm. I wrote a small test code like this:
std::vector<int> a;
a.push_back(1);
a.push_back(2);
std::remove(a.begin(), a.end(), 1);
int s = a.size();
std::vector<int>::...
I wrote a file parser for a game I'm writing to make it easy for myself to change various aspects of the game (things like the character/stage/collision data). For example, I might have a character class like this:
class Character
{
public:
int x, y; // Character's location
Character* teammate;
}
I set up my parser to read in ...
In C++, to print a number in hexadecimal you do this:
int num = 10;
std::cout << std::hex << num; // => 'a'
I know I can create a manipulator that just adds stuff to the stream like so:
std::ostream& windows_feed(std::ostream& out)
{
out << "\r\n";
return out;
}
std::cout << "Hello" << windows_feed; // => "Hello\r\n"
Howev...
I am using libsigc++ to wire up an application, and is uncertain as to the easier way of going about it.
There is a preexisting object hierarchy that manages the data layer, and the top level object exposes all functions. All good so far.
To this I am adding a GUI object hierarchy, and in the application object I am hooking them toge...
What's a high performance hashing library that's also cross platform for C/C++. For algorithms such as MD5, SHA1, CRC32 and Adler32.
I initially had the impression that Boost had these, but apparently not (yet).
The most promising one I have found so far is Crypto++, any other suggestions? http://www.cryptopp.com/ This seems to be qui...
In another thread I got convinced into using HTML parsers instead of regexps for HTML parsing. I thought of using libxml (it has some HTML parser built in), but failed to find any useful tutorial. I also found this site and it says here it should do fine even with severely broken HTML.
Could you give me some examples of HTML parsing wit...
[EDIT]Whoops there was a mistake in the code, and now all the responses to the question seem bizzare, but basically the for loop used to be, for(i=0; i<15; i++). I also edited to make the question more clear.[/EDIT]
I am trying to make a for loop, that checks a 16 element array, so it loops from 0 to 15. I then use the i variable later,...
My company is trying to make the decision between using Qt/C++ for our GUI framework or migrating to .NET and using WPF. We have up to this point been using MFC. It seems that .NET/WPF is technically the most advanced and feature-rich platform. I do, however, have several concerns. These include:
Platform support
Framework longevit...