|
-
Apr 13th, 2007, 07:54 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] How to get a class event raised from a Function called trhrough addressof?
Hi All,
I'm adding some API functionality to my ClsFiles Class.
So I'm wrapping CopyFileEx
(Public Declare Function CopyFileEx Lib "kernel32.dll" Alias "CopyFileExA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal lpProgressRoutine As Long, lpData As Any, ByRef pbCancel As Long, ByVal dwCopyFlags As Long) As Long)
Now the progress can be evaluted in the function given the adres for:
CopyFileEx("c:\verybigfile.ext", "c:\copy.ext", AddressOf CopyProgressRoutine, ByVal 0&, bCancel, COPY_FILE_RESTARTABLE)
but that routine has to reside in a bas module to be able to pass an base adres.
This part goes fine but I need to raise an event in the class that sends this progress to the calling object so is can be proccessed in a progressbar, label etc...
Does anyone knows a trick to get that information from the function CopyProgressRoutine in the bas module to the class that can be created anywhere, keeping the code reusable (that is without re-writing it for every situation)
Hoping for a positive answer.....
sincerly yours Dnereb.
 why can't programmers keep and 31 Oct and 25 dec apart. Why Rating is Useful
for every question you ask provide an answer on another thread.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|