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
92
S
32
G
109
Posts: 5,291
Reputation: 70,993

Post » Thu Jun 02, 2011 6:52 pm

Awesome find, right up there with your Resource plug!
Image ImageImage
B
169
S
50
G
174
Posts: 8,325
Reputation: 110,794

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
398
S
236
G
88
Posts: 24,428
Reputation: 194,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
92
S
32
G
109
Posts: 5,291
Reputation: 70,993

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