// To Get the manager version (Not ment for bug fixes, but for interface version, ie if functions or data past changes
function GetManagerVersion(var Major, Minor: Integer): Boolean; stdcall;
// To Get the supported interface version
function GetSupportedInterfaceVersion(var Major, Minor: Integer): Boolean; stdcall;
// Allows the calling process to select the directory of the plugins
// This way multiex can store the plugin path whereever it wants
// Should always be called once
function SetPluginDirectory(Directory: PChar): Boolean; stdcall;
// This refreshes the plugin list, also must be called to load for the first time too
function RefeshPluginList(): Boolean; stdcall;
function PluginCount(): Integer; stdcall;
function PluginInfo(Index: Integer; var PluginInfo: TPluginInfo): Boolean; stdcall;
// TPluginInfo so far is defined as
type
TPluginInfo = packed record
Size: Integer;
PluginName: PChar; // Module Name (to be displayed)
PluginFullPath: PChar; // Full path to the plugin module
VersionMajor, VersionMinor: Integer;
InterfaceMajor, InterfaceMinor: Integer;
Supported: Boolean; // This allows us to show Unsupported plugins in the list
end;
This information is mainly ment for display purposes to a user. And Except for GetManagerVersion, should not be USED in coding. The plugin manager will handle all supported and unsupported versions automatically. This also lets plugin developers see what mexcom's plugin manager sees.
"By nature men are alike. Through practice they have become far apart." Confucius (Analect 17:2)
I most certainly will!
There's been some criticism on the Painkiller.dll, and one thing that bugs me is that the Commander can't yet create these pak files from scratch.
I will have to find time to implement stuff like that, but before I can, the Plugin Manager will have to be operational. There's no rush, by the way, this is not a push! Take your time, it's best to have something good, that took some time eh.
Mr. Mouse, can you make me 2 vb programs for testing.
Something really simple
Program 1:
Create a program with 3 buttons on it,
1) imports a function from "test.dll" called "TestFunction1" and calls it. Function has a parameter of a String returns a Long/Integer.
2) imports a function from "test.dll" called "TestFunction2" and calls it. Function has a parameter of an array of long/integer, returns a long/integer.
3) imports a function from "test.dll" called "TestFunction3" and calls it. Function has a parameter of an array of string, returns a long/integer.
Program 2:
Create a program with 3 buttons on it,
1) import a function from "testcall.dll" called "TestFunction1" and calls it. Function has a parameter of a pointer/reference to a function that takes a paramter of a string and returns a long/integer.
2) imports a function from "test.dll" called "TestFunction2" and calls it. Function has a parameter of a pointer/reference to a function has a parameter of an array of long/integer, returns a long/integer.
3) imports a function from "test.dll" called "TestFunction3" and calls it. Function has a parameter of a pointer/reference to a function has a parameter of an array of string, returns a long/integer.
Thx for your time.
This is for me to see how VB6 passes data back and forth between DLLs, and to see how i can make VB6 call backs. Esp with strings and arrays.
"By nature men are alike. Through practice they have become far apart." Confucius (Analect 17:2)
I'll see what I can do on short notice. I'm @work at the mo', so it will have to wait until I get home, and have time there. Pleasing the mrs. and raising the dog can be quite time-consuming, let alone a bunch of other hobby chores that await me.
Rahly wrote:Mr. Mouse, can you make me 2 vb programs for testing.
Something really simple
Program 1:
Create a program with 3 buttons on it,
1) imports a function from "test.dll" called "TestFunction1" and calls it. Function has a parameter of a String returns a Long/Integer.
2) imports a function from "test.dll" called "TestFunction2" and calls it. Function has a parameter of an array of long/integer, returns a long/integer.
3) imports a function from "test.dll" called "TestFunction3" and calls it. Function has a parameter of an array of string, returns a long/integer.
Program 2:
Create a program with 3 buttons on it,
1) import a function from "testcall.dll" called "TestFunction1" and calls it. Function has a parameter of a pointer/reference to a function that takes a paramter of a string and returns a long/integer.
2) imports a function from "test.dll" called "TestFunction2" and calls it. Function has a parameter of a pointer/reference to a function has a parameter of an array of long/integer, returns a long/integer.
3) imports a function from "test.dll" called "TestFunction3" and calls it. Function has a parameter of a pointer/reference to a function has a parameter of an array of string, returns a long/integer.
Thx for your time.
This is for me to see how VB6 passes data back and forth between DLLs, and to see how i can make VB6 call backs. Esp with strings and arrays.
Can you also give me the test.dll? Or should I create one. I must make sure the program does what it is supposed to do.
Though you can just try these, scroll down for the download:
testapp1 wrote:
MODULE :
Public Declare Function TestFunction1 Lib "test.dll" (ByVal str As String) As Long
Public Declare Function TestFunction2 Lib "test.dll" (ByRef arrLong() As Long) As Long
Public Declare Function TestFunction3 Lib "test.dll" (ByRef arrStr() As String) As Long
FORM:
Private Sub Command1_Click()
'Call
Dim John As Long
John = TestFunction1("ZuurmanRulez")
End Sub
Private Sub Command2_Click()
'Call
Dim Anita As Long
Dim John() As Long
ReDim John(10)
John(0) = 15
John(1) = 255
John(2) = 1023
Anita = TestFunction2(John)
End Sub
Private Sub Command3_Click()
'Call
Dim John As Long
Dim You() As String
ReDim You(10)
You(0) = "Mike"
You(1) = "Zuurman"
You(2) = "Was"
You(3) = "Here"
John = TestFunction3(You)
End Sub
testapp2 wrote:
Public Declare Function TestFunction1 Lib "testcall.dll" (ByVal ptrFunc As Long) As Long
Public Declare Function TestFunction2 Lib "testcall.dll" (ByVal ptrFunc As Long) As Long
Public Declare Function TestFunction3 Lib "testcall.dll" (ByVal ptrFunc As Long) As Long
Public Function myFunc(str As String) As Long
myFunc = Len(str)
End Function
Public Function myFunc2(arrLong() As Long) As Long
myFunc2 = UBound(arrLong)
End Function
Public Function myFunc3(arrStr() As String) As Long
myFunc3 = UBound(arrStr)
End Function
Public Sub Command1_Clicked()
'Call
Dim John As Long
John = TestFunction1(AddressOf myFunc)
End Sub
Public Sub Command2_Clicked()
'Call
Dim Anita As Long
Anita = TestFunction2(AddressOf myFunc2)
End Sub
Public Sub Command3_Clicked()
'Call
Dim Anita As Long
Anita = TestFunction3(AddressOf myFunc3)
End Sub
You do not have the required permissions to view the files attached to this post.
Thanks, the first program works great. I need to write the DLL for the second one. I just wanted to see how VB passed Strings and Arrays to functions. I had thought that it passed strings as PWideChars which is the native strings in VB, but it infact converts them PChars using OLE automation. Now i need to find how how to call a function
"By nature men are alike. Through practice they have become far apart." Confucius (Analect 17:2)
TPluginInfo = packed record
// Version 1.0
Size: Integer;
Name: PChar;
Author: PChar;
Major: Integer;
Minor: Integer;
end;
function mpGetPluginInfo(var Info: TPluginInfo): Boolean; stdcall;
This allows information such as a plugin name and the name of the author, All information this function provides is for display or informational purposes only, and my no means, should be used in conditional coding, use the Interface Version number for conditional testing.
"By nature men are alike. Through practice they have become far apart." Confucius (Analect 17:2)
Current I have plugin information completed. Here is the manager dll with the ability to get a list of plugins and plugin information, if you wanna test it, or start that functionality in mexcom. You can bind statically to this dll.
How it should work.
On startup
1. mexcom calls GetManagerVersion to get the version of the manager dll, alert the user if its not the version your looking for and exit OR ignore, continue if its the right version
2. call SetPluginDirectory to set the path for the plugins for the manager to use
3. call RefreshPluginList to find all available plugins (Initial Plugin Load)
Where you want to display a list of the plugins
1. Call PluginCount to get a count of plugins
2. Call PluginInfo with an index of 0 to (PluginCount-1) to get information for a plugin.
Whenever you want to refresh the a list of the plugins call RefreshPluginList.
"By nature men are alike. Through practice they have become far apart." Confucius (Analect 17:2)