WinAPI vs CRT library function choices

Hi,

I hope this question isn’t too basic for the folks
on this list (or considered off-topic for the list),
but I would like to ask whether anyone has any
guidance re how to choose between using a Win32
API function and its C runtime library equivalent
(e.g., lstrlen() and strlen(), respectively)…?

If I could choose to use just one of these two libraries
exclusively, which would you recommend (for things like
performance, executable size, reliability, etc…don’t
worry about portability to other OS environments in this
case)?

Also, if I have to use both libraries in an application
(e.g., I need some functions from each that are not
duplicated in the other), does that change the guidance
for making the choice on any single function? In other
words, should I use as many functions as possible from
one of the two libraries and only those functions that
don’t have equivalents from the other library?

I did an MS KB search and found a few related articles
– mostly at least several years old and some dating
back to Win95 days – but nothing that really seemed
to address the issues directly.

Any guidance you have…general or specific…will be
appreciated.

[We are planning a code-scrub for a product that has
been deployed for quite a few years in the near future
and this is one of the areas we’d like to address.]

Thanks,

BobN
www.winsnmp.com

> guidance re how to choose between using a Win32

API function and its C runtime library equivalent
(e.g., lstrlen() and strlen(), respectively)…?

One of the issues:

  • CRT working a multithreaded environment require the threads to be
    started with _beginthreadex, which Win32 requires only CreateThread.

Max

Man, you seem to me as one of those guys who have digested everything
related to computer programming. I never saw you asking any question for
yourself. Have you taken any oath that you will give your services
full-fledgedly to the ntdev community??!!!

You are THE guy on this list!!!

One personal Q…whats the secret? :slight_smile:

----- Original Message -----
From: “Maxim S. Shatskih”
To: “NT Developers Interest List”
Sent: Friday, November 22, 2002 4:25 PM
Subject: [ntdev] Re: WinAPI vs CRT library function choices

> > guidance re how to choose between using a Win32
> > API function and its C runtime library equivalent
> > (e.g., lstrlen() and strlen(), respectively)…?
>
> One of the issues:
> - CRT working a multithreaded environment require the threads to be
> started with _beginthreadex, which Win32 requires only CreateThread.
>
> Max
>
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@sasken.com
> To unsubscribe send a blank email to %%email.unsub%%
>

> related to computer programming. I never saw you asking any question
for

yourself.

Very rarely, but this occurs, and, in these cases, usually Tony Mason
answers :slight_smile:

Max