Re-Using Plugin's in Visual Basic

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
phantasm
Junior Member
Junior Member
Posts: 3
Joined: 2003-05-22, 11:36 UTC
Location: UK
Contact:

Re-Using Plugin's in Visual Basic

Post by *phantasm »

This may sound like a cheeky post......

I'm in the process of writting a VB application that extract's information from an EPOC SIS file.
- Whilst doing some research I came across a 'Total Commander' freeware plugin called SISVIEW

As the WCX (and other plugin's) are simply renamed DLL's I thought GREAT - I could reuse the dll/function's to do the work for me and not re-invent the wheel....

I've already done some work on calling DLL's from VB, But I've hit a problem.
My previous work used calls to documented functions, but I can't seem to turn the C++ WCX definition back into usable code.

This is what i've got so far, but firstly it it's not passing the filelocation to the DLL.

Can anybody help?

Private Declare Function OpenArchive Lib "sisview" (ByRef ArcName As String) As Long
Private Declare Function CloseArchive Lib "sisview" (ByVal hArcData As Long) As Long
Private Declare Function ReadHeader Lib "sisview" (ByVal hArcData As Long, ByRef HeaderData As String) As String

a$ = "c:\a.sis"
a = OpenArchive(a$)
b= ReadHeader(a, 1)
c = CloseArchive(a)
Last edited by phantasm on 2003-05-23, 15:45 UTC, edited 1 time in total.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

You can find detailed documentation help files of the plugin interfaces on our plugins page:
http://www.ghisler.com/plugins.htm

Please note that there are 3 different plugin types, and each has a separate documentation help file:
- packer plugins
- file system plugins
- lister plugins

The sisview plugin is a packer plugin. The delclarations are in C, but it shouldn't be difficult to convert them to VB.
Author of Total Commander
https://www.ghisler.com
phantasm
Junior Member
Junior Member
Posts: 3
Joined: 2003-05-22, 11:36 UTC
Location: UK
Contact:

Post by *phantasm »

Thanks for the reply! But i'm having problem changing the packer C delclarations to VB.

Any help would be appreciated.

+Phantasm
ByteNick
Junior Member
Junior Member
Posts: 10
Joined: 2003-05-22, 13:55 UTC
Location: Bucharest, Romania

Post by *ByteNick »

While at it, since you are working on the *.sis files, maybe after reading the plugins documentation you have some spare time to develop a plugin for the TC to be able to correctly view the files inside a sis pack.

The reason behind this is when for instance you try to see the content of a *.txt file that is packed in a *.sis pack, it shows some coded content, not the actually text file you would normally see on your PDA's screen.

Well, not to mention a FSPlugin to manage your PDA's drives like any other usual drive. That would be greater, even.

Good luck!
User avatar
CoMiKe
Senior Member
Senior Member
Posts: 285
Joined: 2003-05-05, 17:45 UTC
Location: Salamanca, Spain

Post by *CoMiKe »

This is what i've got so far, but firstly it it's not passing the filelocation to the DLL.

Can anybody help?

Private Declare Function OpenArchive Lib "sisview" (ByRef ArcName As String) As Long
Private Declare Function CloseArchive Lib "sisview" (ByVal hArcData As Long) As Long
Private Declare Function ReadHeader Lib "sisview" (ByVal hArcData As Long, ByRef HeaderData As String) As String
Well, in Visual Basic, strings must always be passed to API functions using ByVal, not ByRef. So test it again and post another message if it's not working.

Byez!
phantasm
Junior Member
Junior Member
Posts: 3
Joined: 2003-05-22, 11:36 UTC
Location: UK
Contact:

Post by *phantasm »

Still no joy with ByVal (instead of ByRef).....

I've even used the Softice debugger and set a breakpoint on OpenArchive!

With:
Total Commander, it breaks and the EDI register contains the full path and filename
My VB app - it breaks but EDI contains nothing :(
User avatar
CoMiKe
Senior Member
Senior Member
Posts: 285
Joined: 2003-05-05, 17:45 UTC
Location: Salamanca, Spain

Post by *CoMiKe »

I've read archive plugin's documentation. The OpenArchive function does expect a User Defined Type as parameter, not a string containing the .sis filename.

This is the way for calling this function:

Public Type tOpenArchiveData
ArcName as string
OpenMode as integer
OpenResult as integer
CmtBuf as string
CmtBufSize as integer
CmtSize as integer
CmtState as integer
End Type

Public Declare Function OpenArchive _
lib "sisview.wcx" alias "OpenArchive" ( _
byval ArchiveData as tOpenArchiveData)

You must first fill the data of tOpenArchiveData structure as said in plugin reference documentation, then call the function OpenArchive.

You can read the rest of the VERY GOOD documentation downloading the plugin reference guide from ghisler website, in the Addons -> Plugins section.
Post Reply