Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / C++ Plugin Matrix1Util Imports

Author
Message
DigitalFury
14
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 12th Jul 2012 01:58 Edited at: 12th Jul 2012 02:00
I'm trying to get the imports to work with my plugin and it just crashes.

I used the XN Resource Editor to get: "CALL FUNCTION NAME%S%CallFunctionName"

I noticed commands are defined differently in the plugin template like this: "?SetTexture@@YAXHH@Z"

Here is the code:


I also made a Dependency function:


Any ideas why it is crashing or what I could do to get it to work? My code seems fine and I followed the same way everything is defined in the plugin template.

Thanks,

DigitalFury

Zombie Video Game!
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 12th Jul 2012 02:00
The exported function name is the third part of the line in the string table, not the whole line, so in this case it would be "CallFunctionName":


[b]
DigitalFury
14
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 12th Jul 2012 02:05 Edited at: 12th Jul 2012 02:07
I tried it but it still crashes...

DBP Code:


Revised C++ Code:


Thanks,

DigitalFury

Zombie Video Game!
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 12th Jul 2012 02:31
You have to put the code to get the function pointer in an initialisation function, also why do you have those precompiler commands? At the moment your code will be precompiled to this:


Which of course will crash because Import3000 is always null.

[b]
DigitalFury
14
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 12th Jul 2012 02:42
Changes I've made:

Revised DBP Code:


String Table:


New Function to Init:


Still didn't work. It still crashes for some reason. I know that MyLoop exists and everything.

Thanks,

DigitalFury

Zombie Video Game!
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 12th Jul 2012 04:55
In your code:


Import3000 will not be accessible outside the function "SetupPerformance()" so there's no way you can call it, and you still aren't assigning it inside the SetupPerformance() function. Also there's no way your new code will compile unless you still have the precompiler problems, although seeing the whole code is necessary to be sure.

I think you need to learn a bit more about C++, perhaps try some tutorials?

[b]
DigitalFury
14
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 12th Jul 2012 05:05 Edited at: 12th Jul 2012 05:08
@Diggsey - I took advanced c++ a few years ago but forgot a lot of it. I'm still a little confused of how you want me to define Import3000. I don't know how to use function pointers. I did some research online and I came up with something but I don't know if it is right.

Do you mean something like:


Right? Also, it still crashes with this.

Thanks,

DigitalFury

Zombie Video Game!
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 12th Jul 2012 05:41


[b]
DigitalFury
14
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 12th Jul 2012 05:54 Edited at: 12th Jul 2012 06:04
@Diggsey - Oo duh I should have notice that. In the plugin template he doesn't do that and I just copied off of his code. I don't know how his code works because it won't execute.

It works though!

Thanks so much,

DigitalFury

Zombie Video Game!

Login to post a reply

Server time is: 2024-11-21 15:54:16
Your offset time is: 2024-11-21 15:54:16