Old 29th March 2001, 02:08   #1
481group
Junior Member
 
Join Date: Mar 2001
Posts: 2
Send a message via AIM to 481group
I am trying to write a Winamp general purpose plug-in (gen_XXXXX.dll) in C++. These types of plug-ins are loaded at start-up, but when is the code actually executed? I tried creating a data file in the code to test if it runs, but the data file is never created after I open and close Winamp.

To summarize, how do you run general purpose plug-ins? (Btw, I did remember to put the .dll in the Plugins folder).

Any help would be appreciated. Thanks.
481group is offline   Reply With Quote
Old 10th April 2001, 18:40   #2
schweitn
Winamp3 Component Guuuru
Beta Team
 
schweitn's Avatar
 
Join Date: Dec 2000
Location: Milwaukee, WI
Posts: 1,068
Send a message via AIM to schweitn Send a message via Yahoo to schweitn
Tall order...

A general purpose plugin is "run" when Winamp starts. You'll notice that there is only one exposed function out to the dll... BTW I suggest that you start with the genMiniSDK at the NSDN website.

That one function: winampGetGeneralPurposePlugin() simply returns a structure of type winampGeneralPurposePlugin.

This structure then contains function pointers which act as call backs.

When winamp starts, the init function is called.
When winamp quites, the quit function is called.
If the user clicks configure in the preferences box, then
config is called.

The example from NSDN also has a WndProc callback setup for catching events.

One important note that got me for a couple minutes is that the example is using C NOT C++ which causes different compile options in Visual C++. That means that if you rename your main file to .cpp in order to compile as a C++ program, you change the dll export call from:

__declspec( dllexport ) winampGeneralPurposePlugin * winampGetGeneralPurposePlugin()
{
return &plugin;
}

to this in order to work properly:

#ifdef __cplusplus
extern "C" {
#endif

__declspec( dllexport ) winampGeneralPurposePlugin * winampGetGeneralPurposePlugin()
{
return &plugin;
}

#ifdef __cplusplus
}
#endif

I hope this helps!


Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.
- Albert Einstein

Winamp 3 Projects | Winamp 2x Plugin Manager | Explorer Playlist | FileSystem Object | Shoutcast List | Sashimi
schweitn is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Winamp > Winamp Technical Support

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump