Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Is this illigal?
Is this illigal? [message #257189] Fri, 04 May 2007 00:15 Go to previous message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma:
General (3 Stars)
I'm trying to create a closed source dll that has access to the engine calls in scripts.dll.
The GNU doesn't say anything about calling custom code with a function pointer, But then, it doesn't say much else either.

So, here's what i did:

Scripts.dll
//.h
#include <string>
using namespace std;

typedef void (*CI)(string);
typedef void (*CO)(string);

void Con_In(string Str);
void Con_Out(string Str);



//.cpp
#include "scripts.h"
#include "engine.h"
void Con_In(string Str)
{
	Console_Input(Str.c_str());
}
void Con_Out(string Str)
{
	Console_Output("%s", Str.c_str());
}


MyDLl
#include <string>
using namespace std;

typedef void (*CI)(string);
typedef void (*CO)(string);


CI Console_Input;
CO Console_Output;

extern "C" 
{
	__declspec(dllexport) void InitCustomCommands(CI ConIn, CO ConOut)
	{
		Console_Output = ConOut;
		Console_Input = ConIn;
		
		Console_Output("myDll Loaded.\n");

	}
}

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Question About a Map
Next Topic: Trains? Possible?
Goto Forum:
  


Current Time: Wed Dec 11 13:37:25 MST 2024

Total time taken to generate the page: 0.00812 seconds