Results 1 to 40 of 59

Thread: [VB6] Use IFileOperation to replace SHFileOperation for modern Copy/Move box/prompts

Threaded View

  1. #23
    Member
    Join Date
    Oct 2007
    Posts
    52

    Re: [VB6] Use IFileOperation to replace SHFileOperation for modern Copy/Move box/prom

    Hi fafalone, First - THANK YOU for this!

    I am not actually using the class, but took out the necessary parts I needed to do a basic move operation and it works fine. However, both my code and also in the class invokes an interface function like so:

    In MoveFile function for instance:
    iFileOp.PerformOperations

    Not:
    retval = iFileOp.PerformOperations

    which won't work. How do I get the return value from the PerformOperations function? Surely there's a way as that's important to know what the error return code is!??

    In other words, all the "functions" seem to be declared as Subs in the tlb and thus not returning their hresult/long. Yet that hresult is key to knowing what went wrong. For example, if the move didn't succeed, that hresult tells you why.

    What am I missing? Is there some other way I'm supposed to be getting the return value of those interface functions?

    EDIT: I ran across your notes for the TLB and see this problem is a common one. I don't understand why you declared them as HRESULT in the TLB if VB treats those as Subs? I also am not clear at all how to use the SwapvTableEntry thing to get the return value. Is there another way? What do I need to do?
    Last edited by chrislong2; Feb 23rd, 2017 at 08:27 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width