How to use CopyFileEx() function in VB .NET

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
Back
Top