logo
down
shadow

Use VCL Styles From Delphi XE7 to Delphi XE2


Use VCL Styles From Delphi XE7 to Delphi XE2

By : user2956346
Date : November 22 2020, 10:54 AM
will be helpful for those in need The internal format of the vsf files (styles) was changed in the XE3 version (v 2.0). So the styles included in XE7 version can't be used in XE2.
XE2 - can use only the VCL Styles version 1.0 XE3-XE7 - can use any VCL style (version 1.0 or 2.0)
code :


Share : facebook icon twitter icon
FitNesse for Delphi 2006 / Delphi 2007 /Delphi 2009

FitNesse for Delphi 2006 / Delphi 2007 /Delphi 2009


By : tombh
Date : March 29 2020, 07:55 AM
wish helps you Fitnesse has support for Delphi. See the FitServers page at fitnesse.org.
Can Delphi 2009 be installed on the same machine as Delphi 2006 or Delphi 2007?

Can Delphi 2009 be installed on the same machine as Delphi 2006 or Delphi 2007?


By : Netdeveloperx
Date : March 29 2020, 07:55 AM
will help you All new versions of Delphi can always be installed safely /next/ to older version.
Each new version should be installed in its own directory.
TMonthCalendar & Delphi Styles (Delphi XE2)

TMonthCalendar & Delphi Styles (Delphi XE2)


By : JustMe
Date : March 29 2020, 07:55 AM
This might help you The TMonthCalendar is wrapper for the MONTHCAL_CLASS and as far i know this control doesn't support owner draw, but provides the CalColors property which allow you to set the colors of the elements of the calendar, but this property only works when the themes is not enabled. So first you must call the SetWindowTheme function to disable the themes in the calendar and then you can set the colors to match with the vcl styles.
Something like this
code :
uses
  Vcl.Styles,
  Vcl.Themes,
  uxTheme;

Procedure SetVclStylesColorsCalendar( MonthCalendar: TMonthCalendar);
Var
  LTextColor, LBackColor : TColor;
begin
   uxTheme.SetWindowTheme(MonthCalendar.Handle, '', '');//disable themes in the calendar
   MonthCalendar.AutoSize:=True;//remove border

   //get the vcl styles colors
   LTextColor:=StyleServices.GetSystemColor(clWindowText);
   LBackColor:=StyleServices.GetSystemColor(clWindow);

   //set the colors of the calendar
   MonthCalendar.CalColors.BackColor:=LBackColor;
   MonthCalendar.CalColors.MonthBackColor:=LBackColor;
   MonthCalendar.CalColors.TextColor:=LTextColor;
   MonthCalendar.CalColors.TitleBackColor:=LBackColor;
   MonthCalendar.CalColors.TitleTextColor:=LTextColor;
   MonthCalendar.CalColors.TrailingTextColor:=LTextColor;
end;
Passing string from Delphi to C# returns null. However it works fine when I call the Delphi lib from Delphi. How to rece

Passing string from Delphi to C# returns null. However it works fine when I call the Delphi lib from Delphi. How to rece


By : user2127511
Date : March 29 2020, 07:55 AM
I wish this help you The DLL code you have shown is NOT compatible with your C# code.
Your C# code is relying on default string marshaling behavior that your DLL is not conforming to.
code :
// uncomment this if you are NOT using D2009+ ...
{
type
  UnicodeString = WideString;
}

function UnicodeStringToCoTaskMemStr(const s: UnicodeString): PWideChar;
var
  Size: Integer;
begin
  Size := (Length(s) + 1) * SizeOf(WideChar);
  Result := PWideChar(CoTaskMemAlloc(Size));
  if Result <> nil then
    Move(PWideChar(s)^, Result^, Size);
end;

function DBConnet(inputStr: PWideChar; connStr: PWideChar): PWideChar; stdcall; export;
var
  sInput: UnicodeString;
  sConn: UnicodeString;
begin  
  try
    sInput := inputStr;
    sConn := connStr;
    Result := UnicodeStringToCoTaskMemStr('Hello from Delphi! How are you ' + sInput + sConn);
  except
    Result := UnicodeStringToCoTaskMemStr('exception');
  end;
end;
function DBConnet(inputStr: PWideChar; connStr: PWideChar): PWideChar; stdcall; external 'NewLib.dll';

// uncomment this if you are NOT using D2009+ ...
{
type
  UnicodeString = WideString;
}

procedure TUseDLLForm.functionxClick(Sender: TObject);
var
  a: UnicodeString;
  conStr: UnicodeString;
  ret: PWideChar;
begin
  a := 'firstname';
  conStr := 'lastname';
  ret := DBConnet(PWideChar(a), PWideChar(conStr));
  if ret <> nil then
  begin
    try
      ShowMessage(ret);
    finally
      CoTaskMemFree(ret);
    end;
  end else
    ShowMessage('nil');
end;
[DllImport("NewLib.dll",
    CallingConvention = CallingConvention.StdCall,
    CharSet = CharSet.Unicode)]
[return: MarshalAs(UnmanagedType.LPWStr)]
public static extern string DBConnet(string inputString, string connectionString);
// uncomment this if you are NOT using D2009+ ...
{
type
  UnicodeString = WideString;
}

function UnicodeStringToCoTaskMemStr(const s: UnicodeString): PWideChar;
var
  Size: Integer;
begin
  Size := (Length(s) + 1) * SizeOf(WideChar);
  Result := PWideChar(CoTaskMemAlloc(Size));
  if Result <> nil then
    Move(PWideChar(s)^, Result^, Size);
end;

function DBConnet(inputStr: PWideChar; connStr: PWideChar; out outputStr: PWideChar): boolean; stdcall; export;
var
  sInput: UnicodeString;
  sConn: UnicodeString;
begin  
  Result := False;
  try
    sInput := inputStr;
    sConn := connStr;
    outputStr := UnicodeStringToCoTaskMemStr('Hello from Delphi! How are you ' + sInput + sConn);
    Result := outputStr <> nil;
  except
  end;
end;
function DBConnet(inputStr: PWideChar; connStr: PWideChar, out outputStr: PWideChar): boolean; stdcall; external 'NewLib.dll';

// uncomment this if you are NOT using D2009+ ...
{
type
  UnicodeString = WideString;
}

procedure TUseDLLForm.functionxClick(Sender: TObject);
var
  a: UnicodeString;
  conStr: UnicodeString;
  ret: PWideChar;
begin
  a := 'firstname';
  conStr := 'lastname';
  if DBConnet(PWideChar(a), PWideChar(conStr), ret) then
  begin
    try
      ShowMessage(ret);
    finally
      CoTaskMemFree(ret);
    end;
  end else
    ShowMessage('fail');
end;
[DllImport("NewLib.dll",
    CallingConvention = CallingConvention.StdCall,
    CharSet = CharSet.Unicode)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool DBConnet(string inputString, string connectionString,
  [MarshalAs(UnmanagedType.LPWStr)] out outputString string);
// uncomment this if you are NOT using D2009+ ...
{
type
  UnicodeString = WideString;
}

function DBConnet(inputStr: PWideChar; connStr: PWideChar): PWideChar; stdcall; export;
var
  sInput: UnicodeString;
  sConn: UnicodeString;
begin  
  try
    sInput := inputStr;
    sConn := connStr;
    // the RTL's StringToOleStr() function returns a BSTR...
    Result := StringToOleStr('Hello from Delphi! How are you ' + sInput + sConn);
  except
    Result := StringToOleStr('exception');
  end;
end;
function DBConnet(inputStr: PWideChar; connStr: PWideChar): PWideChar; stdcall; external 'NewLib.dll';

// uncomment this if you are NOT using D2009+ ...
{
type
  UnicodeString = WideString;
}

procedure TUseDLLForm.functionxClick(Sender: TObject);
var
  a: UnicodeString;
  conStr: UnicodeString;
  ret: WideString; // NOT UnicodeString!
begin
  a := 'firstname';
  conStr := 'lastname';
  Pointer(ret) := DBConnet(PWideChar(a), PWideChar(conStr));
  if ret <> '' then
    ShowMessage(ret)
  else
    ShowMessage('nil');
end;
[DllImport("NewLib.dll",
    CallingConvention = CallingConvention.StdCall,
    CharSet = CharSet.Unicode)]
[return: MarshalAs(UnmanagedType.BStr)]
public static extern string DBConnet(string inputString, string connectionString);
// uncomment this if you are NOT using D2009+ ...
{
type
  UnicodeString = WideString;
}

function DBConnet(inputStr: PWideChar; connStr: PWideChar; out outputStr: WideString): boolean; stdcall; export;
var
  sInput: UnicodeString;
  sConn: UnicodeString;
begin  
  Result := False;
  try
    sInput := inputStr;
    sConn := connStr;
    outputStr := 'Hello from Delphi! How are you ' + sInput + sConn;
    Result := True;
  except
  end;
end;
function DBConnet(inputStr: PWideChar; connStr: PWideChar; out outputStr: WideString): boolean; stdcall; external 'NewLib.dll';

// uncomment this if you are NOT using D2009+ ...
{
type
  UnicodeString = WideString;
}

procedure TUseDLLForm.functionxClick(Sender: TObject);
var
  a: UnicodeString;
  conStr: UnicodeString;
  ret: WideString;
begin
  a := 'firstname';
  conStr := 'lastname';
  if DBConnet(PWideChar(a), PWideChar(conStr), ret) then
    ShowMessage(ret)
  else
    ShowMessage('fail');
end;
[DllImport("NewLib.dll",
    CallingConvention = CallingConvention.StdCall,
    CharSet = CharSet.Unicode)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool DBConnet(string inputString, string connectionString,
  [MarshalAs(UnmanagedType.BStr)] out string outputStr);
Delphi 7 and Delphi 2010 to Delphi Xe6 Read File Conflict

Delphi 7 and Delphi 2010 to Delphi Xe6 Read File Conflict


By : Govin Pillay
Date : March 29 2020, 07:55 AM
seems to work fine I got this source code but some how I'm confused about the lines why in Delphi 7 the size of the integer is 33 BUT in using Delphi XE6 the size is 65.
Related Posts Related Posts :
  • Which is current correct indy and open ssl versions to use with delphi2007
  • Delphi Xe2: WH_KEYBOARD won't return left-right virtual key codes
  • Collecting a list/table of version specific information for RAD Studio/Delphi/C++ Builder related development environmen
  • delphi 2009, interface already released
  • chained proxy in delphi
  • Rotating an image Delphi XE7
  • Understanding waitable timers
  • Delphi Created Images are not displayed
  • former worked code does not work
  • Formatsettings of client are changing when printing in Firemonkey
  • Why does Delphi XE7 IDE hangs and fails on out of memory exception?
  • How to build delphi projects for WIN64 when units inside it uses DesignEditors DesignIntf?
  • Cannot Destroy Dynamically created Menu Item in Delphi
  • How can I set a message unread?? with delphi 7 and imap from indy10
  • How can I save a TTreeview to Windows and keep its hierarchical structure?
  • Nullable scalar types and LiveBindings
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org