How to call/share functions between plugins?
#1

Hi,

I want to call function of a plugin, inside another plugin. Is possible? If yes, can you describe how do, and there is plugin order for loading in samp server?

Thanks
Reply
#2

I dont think its possible
Reply
#3

Well, it is possible with Pawn so i really think it is possible with C or C++ maybe. Nobody know?
Reply
#4

you can do that using DLL Export/Import functions

Quote:

C Language Reference
DLL Import and Export Functions

Microsoft Specific

The most complete and up-to-date information on this topic can be found in dllexport, dllimport.

The dllimport and dllexport storage-class modifiers are Microsoft-specific extensions to the C language. These modifiers explicitly define the DLL's interface to its client (the executable file or another DLL). Declaring functions as dllexport eliminates the need for a module-definition (.DEF) file. You can also use the dllimport and dllexport modifiers with data and objects.

The dllimport and dllexport storage-class modifiers must be used with the extended attribute syntax keyword, __declspec, as shown in this example:

Code:
#define DllImport __declspec( dllimport )
#define DllExport __declspec( dllexport )

DllExport void func();
DllExport int i = 10;
DllExport int j;
DllExport int n;

DllImport Int Func();
DllImport float axi = 0.0;
Source:http://msdn.microsoft.com/en-us/libr...ae(VS.80).aspx

Tell me if it helped
Reply
#5

What about Linux?
Reply
#6

Or you could use the .def file, That way it would work on Linux and Windows
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)