473,396 Members | 2,140 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to use CopyFileEx() function in VB .NET

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

May 22 '07 #1
2 5046
tailochik wrote:
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
May 22 '07 #2
Petar Atanasov wrote:
tailochik wrote:
>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
Anyway,
It's better to refresh your code and use ProgressBar Class
http://msdn2.microsoft.com/en-us/lib...ogressbar.aspx

HTH,
Petar Atanasov
http://a-wake.net
May 22 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
5
by: phil_gg04 | last post by:
Dear Javascript Experts, Opera seems to have different ideas about the visibility of Javascript functions than other browsers. For example, if I have this code: if (1==2) { function...
2
by: laredotornado | last post by:
Hello, I am looking for a cross-browser way (Firefox 1+, IE 5.5+) to have my Javascript function execute from the BODY's "onload" method, but if there is already an onload method defined, I would...
2
by: sushil | last post by:
+1 #include<stdio.h> +2 #include <stdlib.h> +3 typedef struct +4 { +5 unsigned int PID; +6 unsigned int CID; +7 } T_ID; +8 +9 typedef unsigned int (*T_HANDLER)(void); +10
2
by: H Glenn Hatfield | last post by:
I know this has come up a couple of times on the group, but I'm still having trouble with it. I'm fine with creating the delegate and CopyFileEx declarations and the function which gets...
3
by: Paul | last post by:
I have been trying to code a callback in vb.net using the delegate method. I have successfully compiled the program and run it but after it accessess the copyfileex winapi method and then calls the...
8
by: Olov Johansson | last post by:
I just found out that JavaScript 1.5 (I tested this with Firefox 1.0.7 and Konqueror 3.5) has support not only for standard function definitions, function expressions (lambdas) and Function...
3
by: Beta What | last post by:
Hello, I have a question about casting a function pointer. Say I want to make a generic module (say some ADT implementation) that requires a function pointer from the 'actual/other modules'...
2
by: hzgt9b | last post by:
I've been executing the CopyFileEx code below in a Windows Application for several months... Try If CopyFileEx(fiSource.FullName, strTargetFile, Fpr, ACTION_COPY, 0, 0) 0 Then Else Throw New...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.