|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Callback functionI 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-september.org Leo wrote:
> I have a standard DLL whose subs take a while to complete. I was It depends on the DLL. If it's written to call back to a __stdcall> thinking of somehow using a calback sub/function to allow the > program calling them to display progress. Is that possible in vb? 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 wrote :
> Leo wrote: I should have made it more clear that the DLL is written in vb and I >> 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. > (-: havent written anything but the time consuming subs. -- ClassicVB Users Regroup! comp.lang.basic.visual.misc Free usenet access at http://www.eternal-september.org On 18/08/2010 05:35, Leo wrote:
Show quoteHide quote > Jim Mack wrote : Then it's a COM DLL and you can use Events to return progress information.>> 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. Or move it to an ActiveX EXE and use multi threading: http://hashvb.earlsoft.co.uk/Multithreading -- Dee Earley (dee.ear***@icode.co.uk) i-Catcher Development Team iCode Systems (Replies direct to my email address will be ignored. Please reply to the group.) Dee Earley expressed precisely :
Show quoteHide quote > On 18/08/2010 05:35, Leo wrote: But it is a standard DLL as I discussed in another thread earlierr. I >> 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/Multithreading 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-september.org "Leo" <ttdh***@gmail.com> wrote in message Without some third-party add-on VB CANNOT create standard DLLs.news:i4gv0q$gm8$1@news.eternal-september.org... > But it is a standard DLL as I discussed in another thread earlierr. On Wed, 18 Aug 2010 13:52:14 -0400, "Jeff Johnson" <i.get@enough.spam> Define what you mean by a "third-party add-on".wrote: >"Leo" <ttdh***@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. > http://www.vb-helper.com/howto_make_standard_dll.html This looks pretty straight-forward to me. (And better than how I used to tell people how to do it. <g>) -ralph ralph formulated the question :
Show quoteHide quote > On Wed, 18 Aug 2010 13:52:14 -0400, "Jeff Johnson" <i.get@enough.spam> That's rather clever. I once created an add-on for vb5/6 that would > wrote: > >> "Leo" <ttdh***@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_standard_dll.html > > This looks pretty straight-forward to me. > (And better than how I used to tell people how to do it. <g>) > > -ralph let me specifiy the command line arguments to c2.exe per module. It worked in a similar manner - I renamed c2.exe and replaced it with my own c2.exe :) Hmmm... I wonder if I still have that around somewhere? Someone might find a use for it... It also let me play around with other command line options as well, but I don't remember finding to many being useful other then those used by VB :) Been an awful long time ago.... -- Tom Shelton On Wed, 18 Aug 2010 13:17:52 -0600, Tom Shelton
<tom_shelton@comcast.invalid> wrote: Show quoteHide quote >ralph formulated the question : Sharing and protecting .bas files was always a problem in a>> On Wed, 18 Aug 2010 13:52:14 -0400, "Jeff Johnson" <i.get@enough.spam> >> wrote: >> >>> "Leo" <ttdh***@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_standard_dll.html >> >> This looks pretty straight-forward to me. >> (And better than how I used to tell people how to do it. <g>) >> >> -ralph > >That's rather clever. I once created an add-on for vb5/6 that would >let me specifiy the command line arguments to c2.exe per module. It >worked in a similar manner - I renamed c2.exe and replaced it with my >own c2.exe :) Hmmm... I wonder if I still have that around somewhere? > Someone might find a use for it... It also let me play around with >other command line options as well, but I don't remember finding to >many being useful other then those used by VB :) Been an awful long >time ago.... multi-developer environment because of VB's inherent nature not to share. So, combined with a typelibrary, the technique provides for what MS left out of VB, and that is 'function libraries'. I became quite enamored with them at one time thus, of course, abused the H out of them. Later on sanity finally struck and I worked out a more healthy balance between modules and libraries. <g> However, they did come in particularly handy in one mixed VC/VB shop. We needed to 'standardize' and share the business rules - And it would be useful to have the same code running in Excel, Access, etc, as we had in our business programs. The VCers, for the usual reasons (some blind, some with merit), hated to use VB ActiveX components and wanted to do it all in VC. Unfortunately, while the VC crowd were good coders they were few in number, and the VBers tended to be the subject matter experts and I had a lot more of them than VCers. The problem was solved when I discovered that if handed a standard dll - they imported with little squawk. <bg> -ralph
Show quote
Hide quote
"ralph" <nt_consultin***@yahoo.net> wrote in message Okay, let's put it this way: There is no setting within the VB IDE to make news:jlbo669p828sb81rcvmf3o6uga0ni0om7s@4ax.com... >>> 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_standard_dll.html > > This looks pretty straight-forward to me. > (And better than how I used to tell people how to do it. <g>) the IDE create a standard DLL. You must use other tools to achieve this. (Cool process, by the way.) "Jeff Johnson" <i.get@enough.spam> wrote in message Except that it uses the FSO. <g>news:i4hfbv$bmh$1@news.eternal-september.org... > (Cool process, by the way.) -- Mike It happens that Jeff Johnson formulated :
> "Leo" <ttdh***@gmail.com> wrote in message I have vbAdvance installed.> 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. -- ClassicVB Users Regroup! comp.lang.basic.visual.misc Free usenet access at http://www.eternal-september.org Leo wrote:
> Jeff Johnson formulated : Is there a reason why you need this to be a standard DLL?>> >> Without some third-party add-on VB CANNOT create standard DLLs. > > I have vbAdvance installed. In any case, doesn't vbAdvance leave any COM interface intact while adding standard exports? If so, there's nothing stopping you from using events to communicate back to the main program. Leo wrote:
Show quoteHide quote > Jim Mack wrote : Then it isn't a 'standard' DLL, it's a COM DLL. It can yield, and>> 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. generate events that your app can sink -- instantiate it 'WithEvents' in the app. "Leo" <ttdh***@gmail.com> wrote in message Then add it as a reference, then use a line like this in Form1 to use it: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. 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. "Leo" <ttdh***@gmail.com> wrote in message Does this DLL already have the capability to call a callback function while 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? processing? If not, no amount of programming on the VB6 is going to make a bit of difference. "Jeff Johnson" <i.get@enough.spam> wrote in message ....and I should have read all the replies before making mine.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.
Re: How to get the File Properties
Latest VB6 Cumulative Update? GDI+ and resizing a PictureBox KBasic .NUT Fail Microsoft may back off of .NET languages .Net slipped itself in while I wasn't looking! Specify DLL version when using mc.exe, rc.exe and/or link.exe Re: Problem with Direct Sound / VB6 Running more then one Functions at once, HOW? |
|||||||||||||||||||||||