[lnkForumImage]
TotalShareware - Download Free Software

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


 

Leo

8/18/2010 4:00:00 AM

I have a standard DLL whose subs take a while to complete. I was
thinking of somehow using a calback sub/function to allow the program
calling them to display progress. Is that possible in vb?

--
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Free usenet access at http://www.eternal-sep...


16 Answers

Jim Mack

8/18/2010 4:26:00 AM

0

Leo wrote:
> I have a standard DLL whose subs take a while to complete. I was
> thinking of somehow using a calback sub/function to allow the
> program calling them to display progress. Is that possible in vb?

It depends on the DLL. If it's written to call back to a __stdcall
function, and it's operating on the main thread, and it passes only
numerics (or understands BSTRs), then it should be no problem.

Devil's in the details, which we'd need to see to make a better guess.
(-:

--
Jim Mack
Twisted tees at http://www.cafepress.c...
"We sew confusion"

Leo

8/18/2010 4:35:00 AM

0

Jim Mack wrote :
> Leo wrote:
>> I have a standard DLL whose subs take a while to complete. I was
>> thinking of somehow using a calback sub/function to allow the
>> program calling them to display progress. Is that possible in vb?
>
> It depends on the DLL. If it's written to call back to a __stdcall
> function, and it's operating on the main thread, and it passes only
> numerics (or understands BSTRs), then it should be no problem.
>
> Devil's in the details, which we'd need to see to make a better guess.
> (-:

I should have made it more clear that the DLL is written in vb and I
havent written anything but the time consuming subs.

--
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Free usenet access at http://www.eternal-sep...


Dee Earley

8/18/2010 7:59:00 AM

0

On 18/08/2010 05:35, Leo wrote:
> Jim Mack wrote :
>> Leo wrote:
>>> I have a standard DLL whose subs take a while to complete. I was
>>> thinking of somehow using a calback sub/function to allow the
>>> program calling them to display progress. Is that possible in vb?
>>
>> It depends on the DLL. If it's written to call back to a __stdcall
>> function, and it's operating on the main thread, and it passes only
>> numerics (or understands BSTRs), then it should be no problem.
>>
>> Devil's in the details, which we'd need to see to make a better guess.
>> (-:
>
> I should have made it more clear that the DLL is written in vb and I
> havent written anything but the time consuming subs.

Then it's a COM DLL and you can use Events to return progress information.

Or move it to an ActiveX EXE and use multi threading:
http://hashvb.earlsoft.co.uk/Mult...

--
Dee Earley (dee.earley@icode.co.uk)
i-Catcher Development Team

iCode Systems

(Replies direct to my email address will be ignored.
Please reply to the group.)

Jim Mack

8/18/2010 11:44:00 AM

0

Leo wrote:
> Jim Mack wrote :
>> Leo wrote:
>>> I have a standard DLL whose subs take a while to complete. I was
>>> thinking of somehow using a calback sub/function to allow the
>>> program calling them to display progress. Is that possible in vb?
>>
>> It depends on the DLL. If it's written to call back to a __stdcall
>> function, and it's operating on the main thread, and it passes only
>> numerics (or understands BSTRs), then it should be no problem.
>>
>> Devil's in the details, which we'd need to see to make a better
>> guess. (-:
>
> I should have made it more clear that the DLL is written in vb and I
> havent written anything but the time consuming subs.

Then it isn't a 'standard' DLL, it's a COM DLL. It can yield, and
generate events that your app can sink -- instantiate it 'WithEvents'
in the app.

--
Jim Mack
Twisted tees at http://www.cafepress.c...
"We sew confusion"

(nobody)

8/18/2010 1:30:00 PM

0

"Leo" <ttdhead@gmail.com> wrote in message
news:i4fnsh$pvh$1@news.eternal-september.org...
> I should have made it more clear that the DLL is written in vb and I
> havent written anything but the time consuming subs.

Then add it as a reference, then use a line like this in Form1 to use it:

Private WithEvents oClass As DLLReferenceName.ClassName

"DLLReferenceName" and "ClassName" should be what you see in Object
Browser(F2) for the DLL.

Then in Form_Load:

Set oClass = New DLLReferenceName.ClassName

And in Form_Unload:

Set oClass = Nothing

After that, on the left dropdown box, where the controls on the form are
listed, select "oClass". If you don't see "oClass", then it doesn't generate
events, and you have to do something else to get it to work.


Jeff Johnson [MVP: VB]

8/18/2010 1:41:00 PM

0

"Leo" <ttdhead@gmail.com> wrote in message
news:i4flpu$68q$1@news.eternal-september.org...

>I have a standard DLL whose subs take a while to complete. I was thinking
>of somehow using a calback sub/function to allow the program calling them
>to display progress. Is that possible in vb?

Does this DLL already have the capability to call a callback function while
processing? If not, no amount of programming on the VB6 is going to make a
bit of difference.


Jeff Johnson [MVP: VB]

8/18/2010 1:42:00 PM

0

"Jeff Johnson" <i.get@enough.spam> wrote in message
news:i4gnt7$6sg$1@news.eternal-september.org...

>>I have a standard DLL whose subs take a while to complete. I was thinking
>>of somehow using a calback sub/function to allow the program calling them
>>to display progress. Is that possible in vb?
>
> Does this DLL already have the capability to call a callback function
> while processing? If not, no amount of programming on the VB6 is going to
> make a bit of difference.

....and I should have read all the replies before making mine.


Leo

8/18/2010 3:43:00 PM

0

Dee Earley expressed precisely :
> On 18/08/2010 05:35, Leo wrote:
>> Jim Mack wrote :
>>> Leo wrote:
>>>> I have a standard DLL whose subs take a while to complete. I was
>>>> thinking of somehow using a calback sub/function to allow the
>>>> program calling them to display progress. Is that possible in vb?
>>>
>>> It depends on the DLL. If it's written to call back to a __stdcall
>>> function, and it's operating on the main thread, and it passes only
>>> numerics (or understands BSTRs), then it should be no problem.
>>>
>>> Devil's in the details, which we'd need to see to make a better guess.
>>> (-:
>>
>> I should have made it more clear that the DLL is written in vb and I
>> havent written anything but the time consuming subs.
>
> Then it's a COM DLL and you can use Events to return progress information.
>
> Or move it to an ActiveX EXE and use multi threading:
> http://hashvb.earlsoft.co.uk/Mult...

But it is a standard DLL as I discussed in another thread earlierr. I
have read I can use function pointers in VB either using VFTables or
CallWindowProc. Which is better? I have gaps in the blocking subs that
I can add calls to code to call function pointers.

--
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Free usenet access at http://www.eternal-sep...


Jeff Johnson [MVP: VB]

8/18/2010 5:52:00 PM

0

"Leo" <ttdhead@gmail.com> wrote in message
news:i4gv0q$gm8$1@news.eternal-september.org...

> But it is a standard DLL as I discussed in another thread earlierr.

Without some third-party add-on VB CANNOT create standard DLLs.


ralph

8/18/2010 7:06:00 PM

0

On Wed, 18 Aug 2010 13:52:14 -0400, "Jeff Johnson" <i.get@enough.spam>
wrote:

>"Leo" <ttdhead@gmail.com> wrote in message
>news:i4gv0q$gm8$1@news.eternal-september.org...
>
>> But it is a standard DLL as I discussed in another thread earlierr.
>
>Without some third-party add-on VB CANNOT create standard DLLs.
>

Define what you mean by a "third-party add-on".

http://www.vb-helper.com/howto_make_standar...

This looks pretty straight-forward to me.
(And better than how I used to tell people how to do it. <g>)

-ralph