Re: After recalling same Function get GetLastError = 1008
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Fri, 30 Mar 2007 15:16:11 -0500
strsafe.h is a free download and is not related to anything else. You can download it and
use it without MFC or VS2005 or anything else. It comes with the platform SDKs. It works
fine in VS6. Since it is free, there's no rationale I can find for not using it. Everyone
will have it.
Using GetProcAddress seems more than a little strange unless you are calling APIs on older
platforms, e.g., if you need to use a Server-2003-only API but want your code to run on
Win2K (and just not allow it to call the newer functionality). I've done this. But
otherwise using GetProcAddress doesn't make sense, since if you are programming in C or
C++ the entire native API is available. I am not aware that there is any need to use
PInvoke to call a native API from a C or C++ program that isn't using CLR.
Given strsafe.h is available, is free, is available to everyone, does not require a
distribution library, works in all versions of VS (I see no reason it would not work in
VS4.2, for example), there is no reason to not use it. So all of your arguments about why
you can't use it appear to be invalid.
joe
On Fri, 30 Mar 2007 19:40:30 +0200, "Kerem Gümrükcü" <kareem114@xxxxxxxxxxx> wrote:
Hi Joseph,Joseph M. Newcomer [MVP]
See below...
****
strsafe.h is not an issue here. You can use the _s functions because they
are part of the
VS2005 runtime, which has to be present in some form or other, so it would
not be an issue
here.
Since the .NET framework is going to be available on all Vista platforms,
this will become
less of an issue over time.
****
Once again: I dont have VS2005 or VS2002/2003 or any Windows Core Software
Development Kit
on my system, to say not yet! I must take what i got and thats VStudio 6.0.
.NET framework will be
available on every system some day, even on other platforms (Mono), but
there are some differences
betwen the releases, you know what i am talking about. The truth is, that
most of
the users, evend the adanvced users never heard of net framework and thus
they
dont have it on their system. Also a sad truth is, that most of the users
dont do any
updates to their systems, so they dont get net framework or vs2005 C++
runtime
unless another application carries it to their system,...
****
This is an erroneous attitude. If you are writing in VS 2005, then you
consider using the
_s functions. If you are not using VS2005, or expect others to want to use
the code in
lower versions of VS, use the strsafe.
The "it was good enough for my grandfather, and by gum it's good enough for
me" attitude
is not really acceptable as a technical argument for writing potentially
erroneous code.
Note that native C/C++ has the _s functions; they are part of the new
ANSI/ISO C/C++
standard, so you can't argue that they are not native functions. strsafe.h
builds
I NEVER said that they are NOT native C/C++ functions and i KNOW
the new ansi/iso c/c++ standard. The term "native functions" was said in
conjunction with the .NET Framework. What i was talking about was the fact,
that
some of the "native" windows API functions must be invoked via
Interop/PInvoke,
which in fact makes some calls difficult and erroneous, so i decided to use
my old
VStudio 6.0 IDE with its compilers and LoadLibrary,GetProcAddress to
call functions from the underlying APIs.
functions on top of the older C library, and there is no excuse to not use
it. So I
Sure, this is no excuse, and i did made any,...
consider your rationale just silly. The decision is erroneous. There is
no sane way to
justify it as sensible.
silly,...........ok thats what you think. Sure you are right, use the safe
functions,...in future projects,...and with new VStudio,..
Joseph, you are a pro and you know what i was talking about, i know
that you are right and i should, in fact i must use safe functions as much
as possible ans whenever and wherever i can. Ill promise, new
Vstudio -> safe Functions!,....:-)
But my initial problem is solved successfully,...it was a buffer problem,
funny isnt it!
Best regards
Kerem Gümrükcü
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- References:
- After recalling same Function get GetLastError = 1008
- From: Kerem Gümrükcü
- Re: After recalling same Function get GetLastError = 1008
- From: Joseph M . Newcomer
- Re: After recalling same Function get GetLastError = 1008
- From: Kerem Gümrükcü
- Re: After recalling same Function get GetLastError = 1008
- From: Joseph M . Newcomer
- Re: After recalling same Function get GetLastError = 1008
- From: Kerem Gümrükcü
- Re: After recalling same Function get GetLastError = 1008
- From: Joseph M . Newcomer
- Re: After recalling same Function get GetLastError = 1008
- From: Kerem Gümrükcü
- After recalling same Function get GetLastError = 1008
- Prev by Date: Re: Changing mainframe size
- Next by Date: Re: MFC SplashScreen Issue: Sleep in main application
- Previous by thread: Re: After recalling same Function get GetLastError = 1008
- Next by thread: Connection Manager API problem
- Index(es):
Relevant Pages
|