Example Code - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Example Code

I am looking for some example code to copy files in WinXP.
The code I currently have doesn't work if the destination folder is hidden.

Thanks.

Comments

  • GaashiusGaashius Posts: 349Member
    [b][red]This message was edited by Gaashius at 2005-12-16 10:51:47[/red][/b][hr]
    : I am looking for some example code to copy files in WinXP.
    : The code I currently have doesn't work if the destination folder is hidden.
    :
    : Thanks.
    :
    Show us the code and we maybe can help.

    EDIT: maybe

    ****************

    [blue]Gaashius[/blue]




  • Luke7Luke7 Posts: 156Member
    : [b][red]This message was edited by Gaashius at 2005-12-16 10:51:47[/red][/b][hr]
    : : I am looking for some example code to copy files in WinXP.
    : : The code I currently have doesn't work if the destination folder is hidden.
    : :
    : : Thanks.
    : :
    : Show us the code and we maybe can help.
    :
    : EDIT: maybe
    :
    : ****************
    :
    : [blue]Gaashius[/blue]
    :
    :
    :
    :
    :

    Here is what I have so far.
    Thanks.

    ; copyf.asm Copy a file over an existing file
    ;

    .486
    .model flat, stdcall ; 32 bit memory model
    option casemap :none ; case sensitive


    include masm32includewindows.inc
    include masm32includemasm32.inc
    include masm32includegdi32.inc
    include masm32includeuser32.inc
    include masm32includekernel32.inc
    include masm32includeComctl32.inc
    include masm32includecomdlg32.inc
    include masm32includeshell32.inc
    include masm32includeoleaut32.inc
    include masm32macrosmacros.asm

    includelib masm32libmasm32.lib
    includelib masm32libgdi32.lib
    includelib masm32libuser32.lib
    includelib masm32libkernel32.lib
    includelib masm32libComctl32.lib
    includelib masm32libcomdlg32.lib
    includelib masm32libshell32.lib
    includelib masm32liboleaut32.lib

    .data

    File1 db "C:SuppliesLab_Order.xls", 0 ; file names are case sensitive
    File2 db "C:spareLab_Order.xls", 0

    .code

    start:

    main proc

    LOCAL buffer[260]:BYTE
    invoke GetCL,1,ADDR buffer

    ; Specifies how this operation is to proceed if a file of the same
    ; name as that specified by lpNewFileName already exists.
    ; If this parameter is TRUE and the new file already exists,
    ; the function fails. If this parameter is FALSE and the new file
    ; already exists, the function overwrites the existing file and succeeds.

    invoke CopyFile, offset File1, offset File2, FALSE
    invoke ExitProcess,0

    main endp

    end start

  • GaashiusGaashius Posts: 349Member
    : : [b][red]This message was edited by Gaashius at 2005-12-16 10:51:47[/red][/b][hr]
    : : : I am looking for some example code to copy files in WinXP.
    : : : The code I currently have doesn't work if the destination folder is hidden.
    : : :
    : : : Thanks.
    : : :
    : : Show us the code and we maybe can help.
    : :
    : : EDIT: maybe
    : :
    : : ****************
    : :
    : : [blue]Gaashius[/blue]
    : :
    : :
    : :
    : :
    : :
    :
    : Here is what I have so far.
    : Thanks.
    :
    : ; copyf.asm Copy a file over an existing file
    : ;
    :
    : .486
    : .model flat, stdcall ; 32 bit memory model
    : option casemap :none ; case sensitive
    :
    :
    : include masm32includewindows.inc
    : include masm32includemasm32.inc
    : include masm32includegdi32.inc
    : include masm32includeuser32.inc
    : include masm32includekernel32.inc
    : include masm32includeComctl32.inc
    : include masm32includecomdlg32.inc
    : include masm32includeshell32.inc
    : include masm32includeoleaut32.inc
    : include masm32macrosmacros.asm
    :
    : includelib masm32libmasm32.lib
    : includelib masm32libgdi32.lib
    : includelib masm32libuser32.lib
    : includelib masm32libkernel32.lib
    : includelib masm32libComctl32.lib
    : includelib masm32libcomdlg32.lib
    : includelib masm32libshell32.lib
    : includelib masm32liboleaut32.lib
    :
    : .data
    :
    : File1 db "C:SuppliesLab_Order.xls", 0 ; file names are case sensitive
    : File2 db "C:spareLab_Order.xls", 0
    :
    : .code
    :
    : start:
    :
    : main proc
    :
    : LOCAL buffer[260]:BYTE
    : invoke GetCL,1,ADDR buffer
    :
    : ; Specifies how this operation is to proceed if a file of the same
    : ; name as that specified by lpNewFileName already exists.
    : ; If this parameter is TRUE and the new file already exists,
    : ; the function fails. If this parameter is FALSE and the new file
    : ; already exists, the function overwrites the existing file and succeeds.
    :
    : invoke CopyFile, offset File1, offset File2, FALSE
    : invoke ExitProcess,0
    :
    : main endp
    :
    : end start
    :
    :
    The problem should be in the CopyFile thingy you invoke... what could not be modified easily I think. If you know in which include file does CopyFile exist, you could show us that also.

    ****************

    [blue]Gaashius[/blue]


  • Luke7Luke7 Posts: 156Member
    : : : [b][red]This message was edited by Gaashius at 2005-12-16 10:51:47[/red][/b][hr]
    : : : : I am looking for some example code to copy files in WinXP.
    : : : : The code I currently have doesn't work if the destination folder is hidden.
    : : : :
    : : : : Thanks.
    : : : :
    : : : Show us the code and we maybe can help.
    : : :
    : : : EDIT: maybe
    : : :
    : : : ****************
    : : :
    : : : [blue]Gaashius[/blue]
    : : :
    : : :
    : : :
    : : :
    : : :
    : :
    : : Here is what I have so far.
    : : Thanks.
    : :
    : : ; copyf.asm Copy a file over an existing file
    : : ;
    : :
    : : .486
    : : .model flat, stdcall ; 32 bit memory model
    : : option casemap :none ; case sensitive
    : :
    : :
    : : include masm32includewindows.inc
    : : include masm32includemasm32.inc
    : : include masm32includegdi32.inc
    : : include masm32includeuser32.inc
    : : include masm32includekernel32.inc
    : : include masm32includeComctl32.inc
    : : include masm32includecomdlg32.inc
    : : include masm32includeshell32.inc
    : : include masm32includeoleaut32.inc
    : : include masm32macrosmacros.asm
    : :
    : : includelib masm32libmasm32.lib
    : : includelib masm32libgdi32.lib
    : : includelib masm32libuser32.lib
    : : includelib masm32libkernel32.lib
    : : includelib masm32libComctl32.lib
    : : includelib masm32libcomdlg32.lib
    : : includelib masm32libshell32.lib
    : : includelib masm32liboleaut32.lib
    : The problem should be in the CopyFile thingy you invoke... what could not be modified easily I think. If you know in which include file does CopyFile exist, you could show us that also.
    :
    : ****************
    :
    : [blue]Gaashius[/blue]

    Would you be able to narrow down the list of include files. I don't have
    a search utility that can search through multiple files.

    Thanks.
  • anthrax11anthrax11 Posts: 511Member
    : : : : [b][red]This message was edited by Gaashius at 2005-12-16 10:51:47[/red][/b][hr]
    : : : : : I am looking for some example code to copy files in WinXP.
    : : : : : The code I currently have doesn't work if the destination folder is hidden.
    : : : : :
    : : : : : Thanks.
    : : : : :
    : : : : Show us the code and we maybe can help.
    : : : :
    : : : : EDIT: maybe
    : : : :
    : : : : ****************
    : : : :
    : : : : [blue]Gaashius[/blue]
    : : : :
    : : : :
    : : : :
    : : : :
    : : : :
    : : :
    : : : Here is what I have so far.
    : : : Thanks.
    : : :
    : : : ; copyf.asm Copy a file over an existing file
    : : : ;
    : : :
    : : : .486
    : : : .model flat, stdcall ; 32 bit memory model
    : : : option casemap :none ; case sensitive
    : : :
    : : :
    : : : include masm32includewindows.inc
    : : : include masm32includemasm32.inc
    : : : include masm32includegdi32.inc
    : : : include masm32includeuser32.inc
    : : : include masm32includekernel32.inc
    : : : include masm32includeComctl32.inc
    : : : include masm32includecomdlg32.inc
    : : : include masm32includeshell32.inc
    : : : include masm32includeoleaut32.inc
    : : : include masm32macrosmacros.asm
    : : :
    : : : includelib masm32libmasm32.lib
    : : : includelib masm32libgdi32.lib
    : : : includelib masm32libuser32.lib
    : : : includelib masm32libkernel32.lib
    : : : includelib masm32libComctl32.lib
    : : : includelib masm32libcomdlg32.lib
    : : : includelib masm32libshell32.lib
    : : : includelib masm32liboleaut32.lib
    : : The problem should be in the CopyFile thingy you invoke... what could not be modified easily I think. If you know in which include file does CopyFile exist, you could show us that also.
    : :
    : : ****************
    : :
    : : [blue]Gaashius[/blue]
    :
    : Would you be able to narrow down the list of include files. I don't have
    : a search utility that can search through multiple files.
    :
    : Thanks.
    :

    [blue]CopyFile is a standard Winapi function defined in kernel32.inc
    I dont know how this is helpful though.
    [/blue]

Sign In or Register to comment.