Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Neet to run a program before InstallShield
Message
General information
Forum:
Visual FoxPro
Category:
Installation, Setup and Configuration
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01051261
Message ID:
01051504
Views:
5
Wow, all that to copy a file!? Thanks for your help, Borislav.

>Russell,
>here it is the whole code you needed:
>
>#include "stdafx.h"
>#include <windows.h>
>#include <stdio.h>
>
>int APIENTRY _tWinMain(HINSTANCE hInstance,
>                     HINSTANCE hPrevInstance,
>                     LPTSTR    lpCmdLine,
>                     int       nCmdShow)
>{
>	WIN32_FIND_DATA FileData;
>	HANDLE hSearch;
>
>	hSearch = FindFirstFile("c:\\TEST\\test.dbf", &FileData); // CHeck if the file exists
>	if (hSearch != INVALID_HANDLE_VALUE)
>	   {
>                // File exists
>                // Copy file c:\test\dbf to c:\test\test1.dbf
>                // and we don't want the function to fail if the file TEST1.DBF exists
>		CopyFile("c:\\TEST\\test.dbf", "c:\\TEST\\test1.dbf", FALSE);
>
>                // Close handle to file
>		FindClose(hSearch);
>	   }
>	   return 0;
>}
>
>
>The stdafx.h contains:
>
>
>#define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers
>// Windows Header Files:
>#include <windows.h>
>// C RunTime Header Files
>#include <stdlib.h>
>#include <malloc.h>
>#include <memory.h>
>#include <tchar.h>
>
>
>
>This is a modified code from MSDN library.
>This is a very simple code, no way to specify a file name and path as a parameters. but you can modify it.
eCost.com continues to rip people off
Check their rating at ResellerRatings.com
Previous
Reply
Map
View

Click here to load this message in the networking platform