[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.vb.general.discussion

Using yDec Decode dll in VB6

(Mike Mitchell)

11/9/2011 12:04:00 PM

I'm attempting to implement yEnc decoding in a VB6 app by using the
library yDecLib.dll.
(See http://tinyurl.c... if anyone wants to download the dll.)

This dll exports the following functions:

ydec_add_file
ydec_set_callback
ydec_set_output_path
ydec_decode

It works in VB6. Basically, you set the callback to handle the events,
add one or more yEnc encoded files using ydec_add_file, set the output
path, then invoke ydec_decode.

It even sorts out multipart files when the parts are out of order!

Fantastic. Except that the author overlooked one key function: erase
the internal file list in order to start afresh with a different set
of files.

Now, I have, after HOURS of detective work on SourceForge and the
Wayback Machine, tracked down the Delphi source code (GPL or Lesser
GPL). I've even installed Delphi 7 Personal from a cover-mount DVD
I've had since 2002 and successfully run the source with a small test
app in the Delphi IDE.

So one possibility would be to modify the source code and add a
function: ydec_reset or something similar. It would simply erase the
internal InputFileList, which is a Delphi/Pascal TStringList.

However, I cannot call myself a Delphi programmer by any means,
although I've written one or two very simple "Hello World" test
projects in the past, so modifying a whole chunk of Delphi stuff and
not knowing where to begin doesn't exactly fill me with excitement.

So I'm looking for an easier way to get rid of that string list!

Just suppose I unloaded yDecLib.dll from my VB6 app? That would free
up any memory the dll used, wouldn't it? And then I could reload it
anew, or the first call from VB to it would cause it to be reloaded.

Or is there any other way?

Thanks.

MM
3 Answers

ralph

11/9/2011 5:45:00 PM

0

On Wed, 09 Nov 2011 12:04:12 +0000, MM <kylix_is@yahoo.co.uk> wrote:


>
>So I'm looking for an easier way to get rid of that string list!
>
>Just suppose I unloaded yDecLib.dll from my VB6 app? That would free
>up any memory the dll used, wouldn't it? And then I could reload it
>anew, or the first call from VB to it would cause it to be reloaded.
>
>Or is there any other way?
>

Managing libraries dynamically is certainly an option. Formatting
stable CallWindowProc's is usually the only adventure. <g>

The DLL seems simple enough that any option should work. Depends on
how seemless you need yEnc32 to be as part of your delivered product.

If it is for local use, and I was in a hurry, I would be tempted to
just wrap the DLL in an ActiveX component.

-ralph

(Mike Mitchell)

11/9/2011 6:24:00 PM

0

On Wed, 09 Nov 2011 11:44:56 -0600, ralph <nt_consulting64@yahoo.net>
wrote:

>On Wed, 09 Nov 2011 12:04:12 +0000, MM <kylix_is@yahoo.co.uk> wrote:
>
>
>>
>>So I'm looking for an easier way to get rid of that string list!
>>
>>Just suppose I unloaded yDecLib.dll from my VB6 app? That would free
>>up any memory the dll used, wouldn't it? And then I could reload it
>>anew, or the first call from VB to it would cause it to be reloaded.
>>
>>Or is there any other way?
>>
>
>Managing libraries dynamically is certainly an option. Formatting
>stable CallWindowProc's is usually the only adventure. <g>
>
>The DLL seems simple enough that any option should work. Depends on
>how seemless you need yEnc32 to be as part of your delivered product.
>
>If it is for local use, and I was in a hurry, I would be tempted to
>just wrap the DLL in an ActiveX component.

Just one problem: I've never done that! Nope, never created an ActiveX
component. I can go away and start reading, but first, how would this
help address the problem, i.e. the need to erase those strings in
order to start again with a clean slate?

Ah.. (thinks...) maybe you mean put the own-written ActiveX on a
separate form, then load/unload that form at will, which would have
the effect of freeing the memory used, yes?

MM

(Mike Mitchell)

11/10/2011 9:55:00 AM

0

On Wed, 09 Nov 2011 11:44:56 -0600, ralph <nt_consulting64@yahoo.net>
wrote:

>On Wed, 09 Nov 2011 12:04:12 +0000, MM <kylix_is@yahoo.co.uk> wrote:
>
>
>>
>>So I'm looking for an easier way to get rid of that string list!
>>
>>Just suppose I unloaded yDecLib.dll from my VB6 app? That would free
>>up any memory the dll used, wouldn't it? And then I could reload it
>>anew, or the first call from VB to it would cause it to be reloaded.
>>
>>Or is there any other way?
>>
>
>Managing libraries dynamically is certainly an option. Formatting
>stable CallWindowProc's is usually the only adventure. <g>
>
>The DLL seems simple enough that any option should work. Depends on
>how seemless you need yEnc32 to be as part of your delivered product.
>
>If it is for local use, and I was in a hurry, I would be tempted to
>just wrap the DLL in an ActiveX component.
>
>-ralph

Notwithstanding the ActiveX route, I just happened to be persuing the
Delphi source code in yDecLib.dpr and saw this:

// Decode the selected files (specified by ydec_add_file())
procedure ydec_decode; export; stdcall;
begin
try Decoder.Active:=True; except
on E: EyDecoder do Notify(YDEC_MSG_NOTICE,E.Message,0);
end;
Decoder.InputFileList.Clear;
end;

That is, the ydec_decode command simply clears the file list after
decoding the files!!

Job done! (Well, no job required...)

I could kick myself for not reading the code beforehand. There is no
mention in any of the docs that this is how it works, though.

MM