Errors!

This is a discussion on Errors! within the Windows Programming forums, part of the Platform Specific Boards category; Code: Code: HFILE haya; LPFILETIME hara; SYSTEMTIME stUTC,last; LPSECURITY_ATTRIBUTES sec_attr; sec_attr->nLength=sizeof(SECURITY_ATTRIBUTES); sec_attr->lpSecurityDescriptor=NULL; sec_attr->bInheritHandle=TRUE; haya=CreateFile("C:\My Documents\Ago\error.php",GENERIC_READ,FILE_SHARE_READ,sec_attr,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); GetFileTime(haya,NULL,NULL,hara); FileTimeToSystemTime(&hara,&last); CloseHandle(haya); Log: Code: ...

  1. #1
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318

    Errors!

    Code:
    Code:
    HFILE haya;
    LPFILETIME hara;
    SYSTEMTIME stUTC,last;
    LPSECURITY_ATTRIBUTES sec_attr;
    sec_attr->nLength=sizeof(SECURITY_ATTRIBUTES);
    sec_attr->lpSecurityDescriptor=NULL;
    sec_attr->bInheritHandle=TRUE;
    haya=CreateFile("C:\\My Documents\\Ago\\error.php",GENERIC_READ,FILE_SHARE_READ,sec_attr,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
    GetFileTime(haya,NULL,NULL,hara);
    FileTimeToSystemTime(&hara,&last);
    CloseHandle(haya);
    Log:
    Code:
    Kompilaator: Consoles
    Building Makefile: "C:\Programs\Dev-Cpp\Makefile.win"
     make... käivitus
    make.exe -f "C:\Programs\Dev-Cpp\Makefile.win" all
    g++.exe -c Hhuba.cpp -o Hhuba.o -I"C:/PROGRAMS/DEV-CPP/lib/gcc/mingw32/3.4.2/include"  -I"C:/PROGRAMS/DEV-CPP/include/c++/3.4.2/backward"  -I"C:/PROGRAMS/DEV-CPP/include/c++/3.4.2/mingw32"  -I"C:/PROGRAMS/DEV-CPP/include/c++/3.4.2"  -I"C:/PROGRAMS/DEV-CPP/include"   
    
    Hhuba.cpp: In function `LRESULT WindowProcedure(HWND__*, UINT, WPARAM, LPARAM)':
    Hhuba.cpp:43: error: invalid conversion from `void*' to `HFILE'
    Hhuba.cpp:44: error: invalid conversion from `HFILE' to `void*'
    Hhuba.cpp:44: error:   initializing argument 1 of `BOOL GetFileTime(void*, _FILETIME*, _FILETIME*, _FILETIME*)'
    Hhuba.cpp:45: error: cannot convert `_FILETIME**' to `const FILETIME*' for argument `1' to `BOOL FileTimeToSystemTime(const FILETIME*, _SYSTEMTIME*)'
    Hhuba.cpp:46: error: invalid conversion from `HFILE' to `void*'
    Hhuba.cpp:46: error:   initializing argument 1 of `BOOL CloseHandle(void*)'
    Hhuba.cpp:55: error: invalid conversion from `void*' to `HFILE'
    Hhuba.cpp:56: error: invalid conversion from `HFILE' to `void*'
    Hhuba.cpp:56: error:   initializing argument 1 of `BOOL GetFileTime(void*, _FILETIME*, _FILETIME*, _FILETIME*)'
    Hhuba.cpp:57: error: cannot convert `_FILETIME**' to `const FILETIME*' for argument `1' to `BOOL FileTimeToSystemTime(const FILETIME*, _SYSTEMTIME*)'
    Hhuba.cpp:64: error: invalid conversion from `void*' to `HFILE'
    Hhuba.cpp:65: error: invalid conversion from `HFILE' to `void*'
    Hhuba.cpp:65: error:   initializing argument 1 of `BOOL GetFileTime(void*, _FILETIME*, _FILETIME*, _FILETIME*)'
    Hhuba.cpp:66: error: cannot convert `_FILETIME**' to `const FILETIME*' for argument `1' to `BOOL FileTimeToSystemTime(const FILETIME*, _SYSTEMTIME*)'
    Hhuba.cpp:71: error: invalid conversion from `HFILE' to `void*'
    Hhuba.cpp:71: error:   initializing argument 1 of `BOOL CloseHandle(void*)'
    
    Käivitus peatatud

  2. #2
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,263
    Funny, I don't recall "HFILE" being a valid Win32 data type. Perhaps you meant:-
    Code:
    HANDLE haya;
    ?

  3. #3
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    Yes, thanks...

  4. #4
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    >> LPSECURITY_ATTRIBUTES sec_attr;

    You do not allocate memory for this pointer. If there is no reason for it being so, it seems logical to make it a local stack variable, and then pass the address-of it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. global namespace errors
    By stubaan in forum C++ Programming
    Replies: 9
    Last Post: 04-02-2008, 03:11 PM
  2. Ten Errors
    By AverageSoftware in forum Contests Board
    Replies: 0
    Last Post: 07-20-2007, 10:50 AM
  3. Stupid compiler errors
    By ChrisEacrett in forum C++ Programming
    Replies: 9
    Last Post: 11-30-2003, 04:44 PM
  4. Help me with these errors... :-(
    By major_small in forum C++ Programming
    Replies: 6
    Last Post: 09-07-2003, 08:18 PM
  5. errors in class(urgent)
    By ayesha in forum C++ Programming
    Replies: 2
    Last Post: 11-10-2001, 05:51 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21