Re: After recalling same Function get GetLastError = 1008

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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,

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ü





Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: pros and cons of Tkinter in comparison with other GUI toolboxes, please?
    ... Tk and wxWindows are of this type. ... actually become quite large due to differences between platforms. ... is difficult to create an API that works well for all platforms. ... The widgets work the same on all ...
    (comp.lang.python)
  • Re: is the C library a wrapper for windows API?
    ... Am i right in saying that the C library i use on a windows machine ... Big parts of the C library can be implemented in a platform-independent way, and those may use particular calling conventions but not need to defer to any external API implementation that calls such an API). ... The former will only work on Win32, the latter on a great multitude of platforms. ... You may not always be able or even willing to use libraries to increase portability, but it's worth thinking about it. ...
    (comp.lang.c)
  • Re: Why 64bit Delphi compiler from Borland may be meaningless!
    ... It will however not be feasible to do a Win64 VCL *outside* of ... the .NET framework. ... win64 native api - analogous to the native win32 api. ... native divide in a manner that Microsoft will only term a "hack"? ...
    (borland.public.delphi.non-technical)
  • Re: Caracter Presionado a mostrar
    ... I haven't implement a global hook with .NET till now. ... It is more closer to win32 api. ... ..NET framework provides language abstraction too... ... > I want to capture the final character that must show, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: API
    ... to develop applications, for example. ... make them an API. ... In see definitly the .Net Framework as a layer from the OS. ... Framework simply means a set of libraries, tools, etc. which can be used ...
    (microsoft.public.dotnet.languages.vb)