1. Using msvcrt vs win32 API

I've been looking at OS specific file handling routines and doing a little
research. A question occurs to me:

Is there any advantage in using Win32 API directly over using msvcrt.dll
functions? msvcrt contains "standard" C library functions so it looks like it
would be easier to create a cross-platform library.

--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
j.

new topic     » topic index » view message » categorize

2. Re: Using msvcrt vs win32 API

Hi Jason,
msvcrt.dll define functions of general usage,
these are not specific to windows OS,these are more generic functions. 
You can use those functions in a windows program, but you canM program a 
windows application by the only usage of those functions. Win32api gives access 
to services offered by windows OS, like drawing windows, application messaging 
mechanism, etc. You won't find such fonctionnality in msvcrt.dll

regards,
Jacques Deschênes

new topic     » goto parent     » topic index » view message » categorize

3. Re: Using msvcrt vs win32 API

jacques deschênes wrote:
> 
> 
> Hi Jason,
> msvcrt.dll define functions of general usage,
> these are not specific to windows OS,these are more generic functions. 
> You can use those functions in a windows program, but you canM program a 
> windows application by the only usage of those functions. Win32api gives
> access
> 
> to services offered by windows OS, like drawing windows, application messaging
> 
> mechanism, etc. You won't find such fonctionnality in msvcrt.dll
> 
> regards,
> Jacques Deschênes

Thanks for the reply, Jacques.

I was wondering because I want to work on the ESL project filesys.e. It is
supposed to be a cross-platform library with functions for renaming, deleting,
and copying files.

I was also thinking about making another library with lower-level filehandling
functions (fopen, fclose, fgetc, etc.)

I could write filesys.e to use win32-, DOS-, and Linux-specific routines. But I
think it would make the library more straightforward to use msvcrt routines
(which are the same routines that Linux uses) instead of writing directly to
win32. It would probably cut about a third of the size of the library. It would
probably be easier to maintain as well.

I was wondering if there was any downside to using msvcrt instead of win32. It
seems mostly positive to me. msvcrt is used by most programs, can I rely on it
being installed on all Windows from Win 95 on up? Is it part of the OS? I think
that it is.

--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
j.

new topic     » goto parent     » topic index » view message » categorize

4. Re: Using msvcrt vs win32 API

Hi Jason,

 MSVCRT.DLL implement standards C functions but in the context of window OS.
 There is no MSVCRT.DLL (or MSVCRT.O) on linux OS  but MSVCRT containt functions
 with the same prototypes as those in standanrd C libraries. 
Microsoft gathered math, i/o, memory allocation,etc in a single file, where in 
others systems those are in many files.

My experience in windows programming is limited to win32 api. I can't be of much
help about using that library.

regards,
Jacques Deschênes

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu