NO

Author Topic: missing function / api  (Read 6467 times)

Offline nsp

  • Member
  • *
  • Posts: 15
missing function / api
« on: August 03, 2012, 03:02:56 PM »
i have code for MSVC that use oleacc.h but i do not see this header file and/how to integrate.
I also want to use _stat64 function but the declaration is missing ???

where to get up to date winapi header and libraries ??

CommonTater

  • Guest
Re: missing function / api
« Reply #1 on: August 03, 2012, 05:22:58 PM »
For the _stat() function... there are two types _stat() and _wstat() to be used with ansi and unicode respectively.  _stat64 is not needed since the file size is already an _off_t  which is defined in stdio.h as a long long integer which is 64 bits.  You can #include <stdio.h> and #include <sys\stat.h>

For the missing header, you can download the Windows SDK (which you should have anyway) and get the header from there or if you are running MSVC++ you may already have it in your includes section.  Don't forget to copy the corresponding .lib if you don't have it already. You may have to make some changes and if it's a C++ header you might be in for a bit of a problem getting it to work at all. 
 
 

Offline nsp

  • Member
  • *
  • Posts: 15
Re: missing function / api
« Reply #2 on: August 04, 2012, 01:41:03 AM »
Unfortunately I'm producing 32bit program. What you said  is only valid for 64bit this is a snapshot of stdio.h (the same code is in sys/types.h )
Code: [Select]
#define _OFF_T_DEFINED
#if __POCC_TARGET__ == 3
typedef long long _off_t;
#else
typedef long _off_t;
#endif /* __POCC_TARGET */
_stat is not aware of BIG file in 32bit pgm and stat64 is not accessible as is. It should be avalable in crtmt.lib and Ms library libcmt overlaps :(
It works with msvc / gcc and  tinyCC .... but not Pelles C. (I have to distribute some source code and some trainee  will have to complete and compile.)
I do not want to broke the distro as people will install it from the net !  And I do not really know how to update in order to have kernel32.lib/user32.lib and all includes properly sets for PellesC.
« Last Edit: August 04, 2012, 02:36:31 AM by nsp »

CommonTater

  • Guest
Re: missing function / api
« Reply #3 on: August 04, 2012, 02:44:18 AM »
Unfortunately I'm producing 32bit program. What you said  is only valid for 64bit this is a snapshot of stdio.h (the same code is in sys/types.h )
Code: [Select]
#define _OFF_T_DEFINED
#if __POCC_TARGET__ == 3
typedef long long _off_t;
#else
typedef long _off_t;
#endif /* __POCC_TARGET */
_stat is not aware of BIG file in 32bit pgm and stat64 is not accessible as is. It ugly to do a GetModuleHandle for a documented function !

I see your dilemma... Unfortunatly there's not much I can do about it. The best I can offer is that you use GetFileSizeEx() from the Windows API.
 
 
 
Quote
It works with msvc / gcc and  tinyCC .... but not Pelles C. (I have to distribute some source code and some trainee  will have to complete and compile.)
I do not want to broke the distro as people will install it from the net !  And I do not really know how to update in order to have kernel32.lib/user32.lib and all includes properly sets for PellesC.

The big problem with translating headers is that much of the Windows API is for C++... That's not to say it can't be done, but it's not always easy. 
 
 
 

Offline nsp

  • Member
  • *
  • Posts: 15
Re: missing function / api
« Reply #4 on: August 04, 2012, 11:32:41 AM »

I see your dilemma... Unfortunatly there's not much I can do about it. The best I can offer is that you use GetFileSizeEx() from the Windows API.
 
........

The big problem with translating headers is that much of the Windows API is for C++... That's not to say it can't be done, but it's not always easy.
Thank you for your help !
I've used _filelength64 that is working great and did myself a version of _stat64 using _stat and some addition..... I just hope on day we can get if inside standard libraries of PellesC.   

CommonTater

  • Guest
Re: missing function / api
« Reply #5 on: August 04, 2012, 03:19:48 PM »
I've used _filelength64 that is working great and did myself a version of _stat64 using _stat and some addition..... I just hope on day we can get if inside standard libraries of PellesC.   

Then you should submit a feature request... :D