Lite-C and SDK plug-in problem

Posted By: Dartacan

Lite-C and SDK plug-in problem - 02/17/10 16:46

Hi guys.
I compile the “GStudio7\sdk_pugin\sampledll” and copy the sampledll.dll in the “acknex_plugins” folder. I build a application (test.exe) to communicate between Game Studio project (shooter_Demo) and test.exe. I don’t have any problem if I try to call some DLL function inside game studio, but I have problem when I try to call this function inside the test.exe. To probed this DLL I create other simple function inside this sampledll.dll, the function is “int Sum(long a, long b);” when I call this function in the test.exe it function work perfect.
I try to change the mouse coordinate in the game studio project and I want to use other external .exe software to do that, but I always have “Access Violation”.
Look this sample:
****** sampledll.dll ****
….
DLLFUNC void ZoomIn(var value)
{
// decrease the camera FOV by the value
v(camera).arc -= value;
}
DLLFUNC int Sum(long a, long b)
{
// I create this simple function
Return a+b;
}

******* test.exe ********

extern "C" _declspec(dllimport)void ZoomIn(long value);
extern "C" _declspec(dllimport)int Sum(long a, long b);


Void TForm1::ButtonClick(TObject *Sender)
{
Int aux=Sum(2,3);// It work PERFECT
ZoomIn(30);// It have a access violation message. Yes, the gstudio A7 project (shooter_demo) is working.
}
Anybody knows what happening here?
Posted By: Lukas

Re: Lite-C and SDK plug-in problem - 02/17/10 17:04

Please don't make double posts. I removed your other thread, which was in the wrong forum anyway.

To set the coordinates of the mouse, you can include windows.h and use SetCursorPos(x,y). You needn't create a plugin for this.
Posted By: Dartacan

Re: Lite-C and SDK plug-in problem - 02/17/10 17:21

Sorry about double post. blush

My real problem is try to change any Entity, Var, Panel or Vector property in the game studio through an external .exe application. For sample, If I call, in the .exe application, the ZoomIn() function to change the camera parameters(in the sampledll.dll I use the DLLFUNC void ZoomIn(var value) function) then I have an access violation message. I want change any game studio vector through an external .exe application. Yes ,I use a DLL plug-in to do that but all function send me an access violation message.

Posted By: Aku_Aku

Re: Lite-C and SDK plug-in problem - 02/17/10 18:11

Interesting subject.
Posted By: Lukas

Re: Lite-C and SDK plug-in problem - 02/17/10 19:55

Well, I don't know much about this topic, but the access violation message is propably because Windows prevents programs to manipulate other programs or accessing their memory. You will somehow have to make Gamestudio allow your other exe to access it, if that is possible.

But what about just writing a text file which is read and interpreted by the Gamestudio program?
© 2023 lite-C Forums