wininet.dll FtpFindFirstFile function FTP programming using VB.Net

G

Guest

I am using "FtpFindFirstFile" function of wininet.dll in my application. I
had the Declare statement for this function in my code but when I executed my
applicaiton, it gave me an error saying "Unable to find the entry point for
FtpFindFirstFile in the DLL wininet.dll". Then, instead of Declare, I used
<DllImport("wininet.dll">Public Shared Function FtpFindFirstFile..... End
Function - which is a dummy implementation. Then, I got that error resolved
but I could see that the return handle of the function is set to 0 once the
FtpFindFirstFile is executed. When I did, Err.GetLastError, it gives me 997
error which is ERROR_IO_PENDING. I am not sure what could be the problem. I
checked by closing the return handle also by using
InternetCloseHandle(returnHandle) where returnHandle is the handle returned
by the FtpFindFirstFile function.

Please let me know what could be the problem. Also, if I don't use
<DllImport>, am getting the error for not able to find entry point. Is the
usage of <DllImport> right? If it is right, then what else could be the
problem?

Note: I have allocated memory using Marshal.AllocHGloabal(instance of
WIN32_FIND_DATA) and I created a long pointer for it by again using
Marshal.StructuretoPtr(...). I am passing this structure only to the
FtpFindFirstFile function. I hope there is no error in this approach.
 

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