thanks for the reply, this is very weird. heres the code

Code:
//stuff at the top for maps etc
typedef map<string, string> MapFunction;

MapFunction KeyStorer;
MapFunction::iterator iT;

extern "C" int WINAPI StoreKey(HWND, HWND, char *data, char *parms, BOOL, BOOL) {

	string channel = GetTok(data, 1, 32);
	string key = GetTok(data, 2, 32);

	KeyStorer.insert(MapFunction::value_type(channel, key));

	return 1;
}

extern "C" int WINAPI GetKey(HWND, HWND, char *data, char *parms, BOOL, BOOL) {

	string channel = data;
	MapFunction::iterator it = KeyStorer.find( channel );

	if ( it != KeyStorer.end( ) ) 
		lstrcpy( data, (*it).second.c_str( ) );
	else  
		lstrcpy( data, "Key Not Found" );
	
	return 3;
}


//.dll Test.dll StoreKey #hello testkey

then

//echo -a $dll(Test.dll, GetKey, #hello) - should echo testkey but it just echos 'no key found' :S

Last edited by pouncer; 25/01/06 03:01 AM.