Re: API vs. FSO

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Bob Butler (tiredofit_at_nospam.com)
Date: 09/28/04


Date: Tue, 28 Sep 2004 13:16:42 -0700


"Joe" <Joe@discussions.microsoft.com> wrote in message news:898CDE91-
9B62-48C1-9800-D173A1C9F3C6@microsoft.com
> Would some of you please explain why you prefer the Windows API
> drives/directories/files functions to the FSO and its associated
> objects? Other than performance, why choose one over the other?
>
> Personally, I prefer the API calls because somewhere in my mind, I
> believe that they are more robust. I don't actually know if this is
> true. Is it?
>
> I've also noticed that some are rabidly contre the Scripting Objects
> (FSO and Dictionary). Again, would you please explain why?

FSO is slow, adds overhead, requires and external DLL, and is sometimes
disabled by corporate policies to avoid virus issues. If you don't
distribute the DLL you have to deal with incompatible versions that exist
"in the wild". It also adds nothing that can't be done with native VB
syntax and/or some windows API work that is well documented and for which
numerous samples exist.

The dictionary does provide functionality that is harder to duplicate in VB
although there are samples around that accomplish it. The main issue with
that IMO is that it requires the extra DLL and you run into the same issues
of the DLL being incompatible and/or unusable by policy.



Relevant Pages

  • Re: RRAS Static Route
    ... Thanks Ashok for the information, but I was actually thinking about ... Is there no windows API or exported DLL function that can do it? ... >> up so that it uses my DOD Interface. ...
    (microsoft.public.win2000.ras_routing)
  • Re: Changing the text of a Command Button using SetWindowText
    ... simplified it to a direct call to SetWindowText in vb.net. ... Why not simply pass the button as a parameter to your DLL? ... Can I force .NET to redraw the button using a Windows API call? ... API Function SetWindowText, which I have declared as follows: ...
    (microsoft.public.dotnet.languages.vb)
  • Re: SysAllocString
    ... It is appreciated if you could list the DLL and import library file names ... for Windows API and CRT. ... CloseHandle there, because CreateFile and CloseHandle are Windows APIs ...
    (microsoft.public.vc.language)
  • Re: Learn API or VB.Net instead
    ... To code for the Windows API with VB IMHO there are three essential things: ... You have to read the documentation of the Windows API function you would ... For b) a good source of information is the VB online help. ... another one "DLL" since programming the Windows API with VB primarily is ...
    (microsoft.public.vb.winapi)
  • API vs. FSO
    ... Would some of you please explain why you prefer the Windows API ... drives/directories/files functions to the FSO and its associated objects? ... VBA Automation/VB/C++/Web and DB development ...
    (microsoft.public.vb.general.discussion)