|
|
|
Page 1 of 1 |
[ 6 posts ] |
|
 Plugin with code injection question : Developer's Corner
|
|
Posted: April 14th, 2004, 5:04 am
|
|
|
|
drdeath
drdeath's Reps:
|
I am writing a plugin that will be doing some code injection in order to stick some pointers to dynamic memory locs in a static location. I have this working outside of XUn in a seperate DLL and a sample VB app just fine but I now want to make it into a proper plugin.
I have the code injection happening in the Initialize section of the class at the moment but I was thinking if I port this to a plugin wont it be already running before the game is started that needs the code injected into it causing it to fail ?
Not to sure how best to handle this. Best I can think of atm is sticking a loop before the code injection that wait until the game window pops up or a timeout is reached.
Is there a better approach ?
|
|
|
|
|
Posted: April 14th, 2004, 6:20 am
|
|
|
|
Admin
Admin's Reps:
|
You can put a bDoSomething flag in your window_activate function, and call it only once when the user opens the plugin window for the first time.
|
|
|
|
|
Posted: April 14th, 2004, 2:36 pm
|
|
|
|
drdeath
drdeath's Reps:
|
OK got that going as suggested Admin. Works like a charm. However I got another question. I want to update a bunch of static text boxes. I thought that doing this on the OnPaint event would work but alas not, The update seems to paint the number to the screen OK but it then disappears, and it on;y updates if I move my cursor over the window. Makes sense i guess that the on paint is only called when the Plugin window is painted but why does it disappear ?
I guess the best solution would some kind of timer to update from. Any pointer on how i would do that in Xun ?
Also my plugin will have some public functions that you can call from the scripting plugin but how would you do that ? Normaly I would use Set X = CreateObject("BLAH") but since its a plugin its already created aint it ?
|
|
|
|
|
Posted: April 14th, 2004, 2:48 pm
|
|
|
|
WyvernX
WyvernX's Reps:
|
Quick question. Does your plugin use the xml code for viewing, or a vb interface using vb forms?
|
|
|
|
|
Posted: April 14th, 2004, 2:49 pm
|
|
|
|
drdeath
drdeath's Reps:
|
Is a VB6 project based off the VB Plugin example so it uses the xml files.
Since I dont really need a GUI atm since most of the stuff is really only usefull within a script. I will drop the gui stuff. Do I need to do anything else to a bog standard VB dll to make it a plugin like the SWG chatlogger ?
|
|
|
|
|
Posted: April 22nd, 2004, 7:47 pm
|
|
|
|
SideReal
SideReal's Reps:
|
DrDeath -
You can still do your GUI stuff, just do it on the ::Flip event, not the OnPaint event. You have to remember this is a gaming DirectX environment. The sequence of events is ::BeginScene, ::EndScene, ::Flip. Putting your 2d draw on the Flip ensures it won't get overwritten during the scene creation.
|
|
|
|
|
Who is online |
|
Users browsing this forum: No registered users and 5 guests |
|
|
|