Git Product home page Git Product logo

verinfo's People

Contributors

delphidabbler avatar

Watchers

 avatar

verinfo's Issues

Rationalise how TCPInfoEx is set and used

Creation of required TCPInfoEx record could be rationalised.

There are numerous type names created as would be required if the the structure was a public API translation, but aren't used here.

Additionally, the ANSI and Unicode versions of TCPInfoEx are so similar that we can rely on compiler to compile correct version without explicit conditional compilation.

Here's what I suggest:

type
  TCPInfoEx = packed record
      // max length in bytes of a character in the code page
      MaxCharSize: UINT;
      // default character used to translate strings to the specific code page
      DefaultChar: array[0..MAX_DEFAULTCHAR-1] of Byte;
      // fixed-length array of lead byte ranges: all elements null if none
      LeadByte: array[0..MAX_LEADBYTES-1] of Byte;
      //  unicode default char used in translations from the specific code page
      UnicodeDefaultChar: WideChar;
      // code page value
      CodePage: UINT;
      // full localised name of the code page
      // - Char is automatically set to correct AnsiChar or WideChar by compiler
      // - depending on whether UNICODE is defined, so conditional 
      // - compilation isn't necessary
      CodePageName: array[0..MAX_PATH-1] of Char;
  end;

  PCPInfoEx = ^TCPInfoEx;  // *** only define this if strictly necessary 

Drop support for pre-Unicode Delphi compilers

Continuing to support compilers prior to Delphi 2009 is problematic & I can't test them anything. In fact I can only test back to XE, so it may be worth dropping pre-XE support.

Create a lighter class to provide basic version information

Provide a class that is based on TObject rather than TComponent that provides much of the functionality of the present component.

I would drop the predefined string info properties in favour of string indexed array property and provide a const array that gives predefined string info names.

Current component could call into this class to do the real work.

Not the best way to call `VerLanguageName` in `TPJVersionInfo.GetLanguage`

In

function TPJVersionInfo.GetLanguage: string;

VerLanguageName is called like this:

if fHaveInfo and
  (VerLanguageName(GetLanguageCode, Buf, Pred(cBufSize)) > 0) then
  Result := Buf;

However the VerLanguageName docs say that if buffer size is too small, the language name is truncated. Also the number of characters written excludes the terminating null.

In practice the buffer used is probably large enough, but still the code is not best practice.

Maybe try something like example 2 from C++ (Cpp) VerLanguageName Examples - but note that the logic needs tweaking regarding buffer sizes.

Include "advanced" code from vilib core in this library?

delphidabbler/vilib#8 proposes pulling out the core functionality from vilib and releasing it as a separate library.

Should that code be merged into this library, or should a new one be created?

If the code is merged in here, how about placing the rwo different code bases in basic (for the current component) and advanced (for the vilib code)?

Drop all deprecated code

This will be an API breaking change so will need a major version bump. Given that, there's an opportunity to tidy up the API too.

Remove WinHelp files

WinHelp is way out of date & not supported at all on Windows 10 & 11.

Remove these files at the next major release.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.