How to include dll files with plugins automatically

Forum for plugin, effect and behavior programmers. Please use the Help & Support forum for help using Construct.

Post » Thu Jun 02, 2011 6:05 pm

Here is how to automatically include dlls with your plugins. I found this in the xaudio2 source when I was making the audiere plugin.

Add this to edittime.cpp after #ifndef RUN_ONLY

[code:1iakkpxh]//////////////////////////////////////////////////////////////////////////////////
// Dependencies
//////////////////////////////////////////////////////////////////////////////////

// Add any DLLs your plugin depends on here.
void WINAPI ETAddDependencies(MicroDependency& dependencies)
{
// Any DLL files added here are retrieved from the Plugins\Runtime directory, and compiled in to exported EXEs.
// When the EXE runs, the DLL is extracted to the current directory before loading your plugin, so calls such
// as LoadLibrary("example.dll") will succeed at runtime. This greatly simplifies redistribution for end users.

// Eg.
//dependencies.Add("example.dll");
}[/code:1iakkpxh]

Then edit ConstructSDK.def and add this line
[code:1iakkpxh] ETAddDependencies @15[/code:1iakkpxh]
B
79
S
24
G
54
Posts: 4,749
Reputation: 40,761

Post » Thu Jun 02, 2011 6:52 pm

Awesome find, right up there with your Resource plug!
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Thu Jun 02, 2011 7:13 pm

Have you tested this works? I can't remember if we ever finished the feature...
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Thu Jun 02, 2011 7:21 pm

I have tested it as working with my Audiere plugin. The only other plugin I know of that appears to use this feature is the mod plugin.
B
79
S
24
G
54
Posts: 4,749
Reputation: 40,761

Post » Fri Jun 03, 2011 2:08 pm

Oooh, I'll have to include this with the next build of Noise.
B
5
S
2
G
5
Posts: 221
Reputation: 2,272


Return to Construct engineering

Who is online

Users browsing this forum: No registered users and 0 guests