![]() |
#1 |
Junior Member
Join Date: Mar 2002
Posts: 1
|
need a sample dll for generic plugin
Hi, Im new to dll's and winamp plugins.
I was wondering if anyone has a sample gen_plugin dll which is completely empty and doesnt do anything, just has all the necessary methods needed for winamp to register it? Im using VS.NET, but shouldnt make a difference. This is the main hurdle Im facing. I know how to do the rest once I have the bare bones dll to work with ![]() Cheers. |
![]() |
![]() |
![]() |
#2 |
Senior Member
Join Date: Feb 2002
Location: The backside of the universe on the trailing edge of eternity
Posts: 238
|
I'd like to get my hands on one of those also..I'm using a wrapper which isnt very efficient, but it works
|
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Apr 2002
Posts: 8
|
This can be compiled with vc++ 6.0
Put the code in two files: gen_empty.h and gen_empty.c (not *.cpp) //----------------------- //gen_empty.h //----------------------- #ifndef gen_empty_h #define gen_empty_h typedef struct { int version; char *description; int (*init)(); void (*config)(); void (*quit)(); HWND hwndParent; HINSTANCE hDllInstance; } winampGeneralPurposePlugin; #define GPPHDR_VER 0x10 extern winampGeneralPurposePlugin *gen_plugins[256]; typedef winampGeneralPurposePlugin * (*winampGeneralPurposePluginGetter)(); #endif //gen_empty_h //----------------------- //gen_empty.c //----------------------- #include <windows.h> #include "gen_empty.h" int init(void); void config(void); void quit(void); winampGeneralPurposePlugin plugin = { GPPHDR_VER, // "Empty (gen_empty.dll)",// Description init, // Initialization function config, // Configuration function quit // Deinitialization function }; int init() { MessageBox(plugin.hwndParent,"init","",MB_OK); return 0; } void config() { MessageBox(plugin.hwndParent,"config","",MB_OK); } void quit() { MessageBox(plugin.hwndParent,"quit","",MB_OK); } __declspec( dllexport ) winampGeneralPurposePlugin * winampGetGeneralPurposePlugin() { return &plugin; } //----------------- Bananskib |
![]() |
![]() |
![]() |
#4 |
feminazi
(Major Dude) Join Date: Apr 2001
Posts: 1,767
|
Ah.. could you convert this to C++?
|
![]() |
![]() |
![]() |
#5 | |
Major Dude
|
Quote:
![]() What do you think this was written in??? |
|
![]() |
![]() |
![]() |
#6 |
Junior Member
Join Date: Apr 2002
Posts: 8
|
My first post was written in C, not C++.
I use VC++ 6.0 - and I'm NOT AN EXPERT IN C++ I zipped the project as well :-) I didn't find out myself - most of it has been posted before. 1. Make a new project : MFC AppWizard DLL, name it gen_test4 if you want to copy paste the code below. 2. Add the 2 header files to the project (frontend.h, gen.h) (gen.h is listed below - frontend.h: http://www.winamp.com/nsdn/winamp2x/dev/sdk/FRONTEND.H) -- gen.h - start --- typedef struct { int version; char *description; int (*init)(); void (*config)(); void (*quit)(); HWND hwndParent; HINSTANCE hDllInstance; } winampGeneralPurposePlugin; #define GPPHDR_VER 0x10 extern winampGeneralPurposePlugin *gen_plugins[256]; typedef winampGeneralPurposePlugin * (*winampGeneralPurposePluginGetter)(); -- gen.h - end --- [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][] -- gen_test4.h - start -- #if !defined(AFX_GEN_TEST4_H__E840A61D_E8A1_49BB_8977_31A218301C01__INCLUDED_) #define AFX_GEN_TEST4_H__E840A61D_E8A1_49BB_8977_31A218301C01__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #ifndef __AFXWIN_H__ #error include 'stdafx.h' before including this file for PCH #endif #include "resource.h" // main symbols ///////////////////////////////////////////////////////////////////////////// // CGen_test4App // See gen_test4.cpp for the implementation of this class // class CGen_test4App : public CWinApp { public: CGen_test4App(); int winampInit(void); void winampConfig(void); void winampQuit(void); // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CGen_test4App) //}}AFX_VIRTUAL //{{AFX_MSG(CGen_test4App) // NOTE - the ClassWizard will add and remove member functions here. // DO NOT EDIT what you see in these blocks of generated code ! //}}AFX_MSG DECLARE_MESSAGE_MAP() }; ///////////////////////////////////////////////////////////////////////////// //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined //(AFX_GEN_TEST4_H__E840A61D_E8A1_49BB_8977_31A218301C01__INCLUDED_) -- gen_test4.h - end -- [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][] -- gen_test4.cpp - start -- // gen_test4.cpp : Defines the initialization routines for the DLL. // #include "stdafx.h" #include "gen.h" #include "gen_test4.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CGen_test4App BEGIN_MESSAGE_MAP(CGen_test4App, CWinApp) //{{AFX_MSG_MAP(CGen_test4App) // NOTE - the ClassWizard will add and remove mapping macros here. // DO NOT EDIT what you see in these blocks of generated code! //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CGen_test4App construction CGen_test4App::CGen_test4App() { } int CGen_test4App::winampInit(void) { AfxMessageBox("winampInit()"); return 0; } ///////////////////////////////////////////////////////////////////////////// // Winapp methods ///////////////////////////////////////////////////////////////////////////// void CGen_test4App::winampConfig(void) { AfxMessageBox("winampConfog()"); } void CGen_test4App::winampQuit(void) { AfxMessageBox("winampQuit()"); } ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // The one and only CGen_test4App object CGen_test4App theApp; //////////////////// // Winamp Stuff int init(void) { AFX_MANAGE_STATE(AfxGetStaticModuleState()); return theApp.winampInit(); } void config(void) { AFX_MANAGE_STATE(AfxGetStaticModuleState()); theApp.winampConfig(); } void quit(void) { AFX_MANAGE_STATE(AfxGetStaticModuleState()); theApp.winampQuit(); }; winampGeneralPurposePlugin plugin = { GPPHDR_VER, // "gen_test4 (gen_test4.dll)", // Description init, // Initialization function config, // Configuration function quit // Deinitialization function }; extern "C" { __declspec(dllexport) winampGeneralPurposePlugin *winampGetGeneralPurposePlugin(void) { AFX_MANAGE_STATE(AfxGetStaticModuleState()); return &plugin; } } // End Winamp Stuff /////////////////// -- gen_test4.cpp - start -- have fun, Bananskib |
![]() |
![]() |
![]() |
#7 |
Junior Member
Join Date: Apr 2002
Posts: 8
|
and the project zipped !
forgot it :-) bananskib |
![]() |
![]() |
![]() |
#8 | |
feminazi
(Major Dude) Join Date: Apr 2001
Posts: 1,767
|
Quote:
|
|
![]() |
![]() |
![]() |
#9 | |
feminazi
(Major Dude) Join Date: Apr 2001
Posts: 1,767
|
Quote:
|
|
![]() |
![]() |
![]() |
#10 |
ist death
Join Date: May 2000
Posts: 3,704
|
C code should compile fine in CPP after adding a few typecast fixes and extern "C" on _declspec(dllexport) function.
|
![]() |
![]() |
![]() |
#11 |
Junior Member
Join Date: May 2002
Location: la,ca
Posts: 3
|
also like an example Win32 project
I've managed to build a general plug in using the MFC example gen_test4 but i'd also rather build one from a stripped down Win32 dll project as well.
i've downloaded the SDK, if anyone has a Win32 project which compiles using that SDK and could zip it up and put it on this thread, it'd be very cool. remember - VB sucks. |
![]() |
![]() |
![]() |
#12 |
Senior Member
Join Date: Feb 2002
Location: The backside of the universe on the trailing edge of eternity
Posts: 238
|
anyone got a template in VB (other than genwrapper, ick) for a plugin? I know it wont be by any means short enough to paste in here, but I would love to be able to turn all these programs I have into plugins.
|
![]() |
![]() |
![]() |
#13 |
feminazi
(Major Dude) Join Date: Apr 2001
Posts: 1,767
|
For all of you who are as dumb as myself, here it is then
gen.h code: main.cpp code: |
![]() |
![]() |
![]() |
#15 |
feminazi
(Major Dude) Join Date: Apr 2001
Posts: 1,767
|
Yes, but this way I can use C++ in my application, which is great for me because I suck at C.
|
![]() |
![]() |
![]() |
#16 |
Junior Member
Join Date: Sep 2001
Location: Victoria, B.C., Canada
Posts: 3
|
Empty DSP Plugin Code
Last summer I took the time to post the code for an empty Winamp DSP Plugin... I haven't touched it since, and I didn't post the link anywhere so it was for my eyes only... Web page HERE:
http://members.shaw.ca/cfogelklou/wi...keletondsp.htm |
![]() |
![]() |
![]() |
#17 |
Member
|
I'm completely new at winamp developping, i'd like to code a simple general purpose plugin to start. I want to develop it in C because i have knowledge in C unix and all i need is to open minibrowser on startup to a specified url and change the url on song change. But even if i have read this thread i still don't understand how to create my dll and everything.
First what compiler should i use i have Visual C++ 6 and dev-C++ Then what precisely should i do do create dll project ? Thanks a lot in advance and sorry for my english and maybe my lack of knowledge too Paikan |
![]() |
![]() |
![]() |
#18 |
Junior Member
Join Date: Jan 2005
Posts: 1
|
hi a newbie here just want to know if there is a c# version of this general plug-in?
|
![]() |
![]() |
![]() |
#19 |
Junior Member
|
Confused
I have really confused, i am learning ansi C in school, and i coded an plugin with Dev C++ (i used devc++ winamp plugin template for project) it is working good, but i dont have any configuration dialog on my application, so that i decided to learn Visual c++, but i confused it is really too different than c++?? there are lots of text around :P Is there any way to make dialog with Dev c++?
Or i had to learn visual c++?? |
![]() |
![]() |
![]() |
#20 |
Junior Member
Join Date: Nov 2005
Posts: 8
|
I downloaded the zip file and it is woring fine
Now i want to get the information about the current playing song. Can anyone help me. how can i get information by using above gen_test4.dll |
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|