This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ Setup APIs } | |
type | |
{ HDEVINFO } | |
HDEVINFO = THandle; | |
{$EXTERNALSYM HDEVINFO} | |
{ SP_DEVINFO_DATA } | |
SP_DEVINFO_DATA = packed record | |
cbSize: DWORD; | |
ClassGuid: TGUID; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <setupapi.h> | |
#include <System.hpp> | |
void __fastcall GetCommPortsWithName(std::vector<std::pair<int,String> >& CommPorts) | |
{ | |
GUID Guid; | |
DWORD RequiredSize = 0; | |
if (!SetupDiClassGuidsFromName(_TEXT("Ports"),&Guid,1,&RequiredSize)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type | |
&IF = record | |
class function &Then<T>(AValue: Boolean; AThen: T; AElse: T): T; static; inline; | |
end; | |
class function &IF.&Then<T>(AValue: Boolean; AThen: T; AElse: T): T; | |
begin | |
if AValue then | |
begin | |
Result := AThen; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unit Unit2; | |
interface | |
uses | |
{$IF CompilerVersion >= 23.0} | |
System.SysUtils; | |
{$ELSE} | |
SysUtils; | |
{$IFEND} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unit Unit3; | |
interface | |
uses | |
{$IF CompilerVersion >= 23.0} | |
System.SysUtils; | |
{$ELSE} | |
SysUtils; | |
{$IFEND} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Delphi 2007 and XE3 | |
// Create form 'TForm1', place 2 Edit, 2 Button and 1 Label. | |
unit Unit1; | |
interface | |
uses | |
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, | |
Dialogs, StdCtrls; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Delphi 2007 and XE3 | |
// Create form 'TForm1', place 1 Edit, 1 ComboBox, 1 Button. | |
unit Unit1; | |
interface | |
uses | |
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, | |
Dialogs, StdCtrls; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Delphi 2007 and XE3 | |
// Create form 'TForm1', place 2 ComboBox, 4 Button. | |
unit Unit1; | |
interface | |
uses | |
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, | |
Dialogs, StdCtrls; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unit Unit2; | |
interface | |
uses | |
TypInfo, SysUtils, SysConst; | |
type | |
TEnumHelper = record | |
class function TryGetEnumName<T: record>(Value: T; out S: String): Boolean; static; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unit Unit2; | |
interface | |
function PopulationCount(Value: UInt8): Integer; overload; | |
function PopulationCount(Value: UInt16): Integer; overload; | |
function PopulationCount(Value: UInt32): Integer; overload; | |
function PopulationCount(Value: UInt64): Integer; overload; | |
OlderNewer