How to use CopyFileEx() function in VB .NET

G

Guest

I have a VB6 project that call CopyFileEx with ProgressRoutine to display the
progress. The code is like this

'Copy the file to the destination folder
lpCallBack = AddressOf CopyProgressCallback

CopyFileEx strSourcePath & strFileName, strDestnPath & strFileName,
lpCallBack, 0&, False, GC_CopyFileRestartable

Then I converted the project to VB .NET and the statement AddressOf doesn't
return the memory address of the CopyProgressCallback function. Is there any
what I could pass the value of lpCallBack to CopyFileEx in VB .NET? Thanks
 
P

Petar Atanasov

tailochik said:
I have a VB6 project that call CopyFileEx with ProgressRoutine to display the
progress. The code is like this

'Copy the file to the destination folder
lpCallBack = AddressOf CopyProgressCallback

CopyFileEx strSourcePath & strFileName, strDestnPath & strFileName,
lpCallBack, 0&, False, GC_CopyFileRestartable

Then I converted the project to VB .NET and the statement AddressOf doesn't
return the memory address of the CopyProgressCallback function. Is there any
what I could pass the value of lpCallBack to CopyFileEx in VB .NET? Thanks

hmmm, make a delegate for CopyProgressCallback...
I don't think you can make it directly as it was in VB6.

Regards,
Petar Atanasov
http://a-wake.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top