<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1030596328209703715</id><updated>2011-07-28T03:52:44.436-07:00</updated><category term='Async fetch'/><category term='DML'/><category term='how to'/><category term='control'/><category term='report'/><category term='anyDAC'/><category term='progress bar'/><category term='Barcodes'/><category term='tutorial'/><title type='text'>Delphi</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://delphizine.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://delphizine.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Aisyah Runi</name><uri>http://www.blogger.com/profile/09754809777891988684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp3.blogger.com/_iNFxbPL4FYE/R_dMDxJPHQI/AAAAAAAAAAM/L8A99OeHoPU/S220/runi001.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1030596328209703715.post-1033083322601149875</id><published>2009-07-26T22:53:00.002-07:00</published><updated>2009-07-26T23:05:08.115-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='how to'/><title type='text'>How protect Excel Sheet using Delphi?</title><content type='html'>How protect Excel Sheet using Delphi?&lt;br /&gt;Answer:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;unit UTesteProtect;&lt;br /&gt;&lt;br /&gt;interface&lt;br /&gt;&lt;br /&gt;uses&lt;br /&gt;  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,&lt;br /&gt;  Dialogs, StdCtrls, ComObj;&lt;br /&gt;&lt;br /&gt;type&lt;br /&gt;  TForm1 = class(TForm)&lt;br /&gt;    Button1: TButton;&lt;br /&gt;    procedure Button1Click(Sender: TObject);&lt;br /&gt;    procedure FormDestroy(Sender: TObject);&lt;br /&gt;  private&lt;br /&gt;    { Private declarations }&lt;br /&gt;  public&lt;br /&gt;    { Public declarations }&lt;br /&gt;  end;&lt;br /&gt;&lt;br /&gt;var&lt;br /&gt;  Form1: TForm1;&lt;br /&gt;  ExcelApp: OleVariant;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;implementation&lt;br /&gt;&lt;br /&gt;{$R *.dfm}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;procedure TForm1.Button1Click(Sender: TObject);&lt;br /&gt;const&lt;br /&gt;  // SheetType&lt;br /&gt;  xlChart = -4109;&lt;br /&gt;  xlWorksheet = -4167;&lt;br /&gt;  // WBATemplate&lt;br /&gt;  xlWBATWorksheet = -4167;&lt;br /&gt;  xlWBATChart = -4109;&lt;br /&gt;  // Page Setup&lt;br /&gt;  xlPortrait = 1;&lt;br /&gt;  xlLandscape = 2;&lt;br /&gt;  xlPaperA4 = 9;&lt;br /&gt;  // Format Cells&lt;br /&gt;  xlBottom = -4107;&lt;br /&gt;  xlLeft = -4131;&lt;br /&gt;  xlRight = -4152;&lt;br /&gt;  xlTop = -4160;&lt;br /&gt;  // Text Alignment&lt;br /&gt;  xlHAlignCenter = -4108;&lt;br /&gt;  xlVAlignCenter = -4108;&lt;br /&gt;  // Cell Borders&lt;br /&gt;  xlThick = 4;&lt;br /&gt;  xlThin = 2;&lt;br /&gt;var&lt;br /&gt;  ColumnRange: OleVariant;&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;  { Start Excel }&lt;br /&gt;&lt;br /&gt;  // By using GetActiveOleObject, you use an instance o&lt;br /&gt;  // f Word that's already running,&lt;br /&gt;  // if there is one.&lt;br /&gt;    try&lt;br /&gt;      // If no instance of Word is running, try to Create a new Excel Object&lt;br /&gt;      ExcelApp := CreateOleObject('Excel.Application');&lt;br /&gt;    except&lt;br /&gt;      ShowMessage('Cannot start Excel/Excel not installed ?');&lt;br /&gt;      Exit;&lt;br /&gt;    end;&lt;br /&gt;&lt;br /&gt;  // Add a new Workbook, Neue Arbeitsmappe offnen&lt;br /&gt;  ExcelApp.Workbooks.Add(xlWBatWorkSheet);&lt;br /&gt;&lt;br /&gt;  // Open a Workbook, Arbeitsmappe offnen&lt;br /&gt;  ExcelApp.Workbooks.Open('c:\pasta1.xls');&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  // Rename the active Sheet&lt;br /&gt;  ExcelApp.ActiveSheet.Name := 'Pasta1';&lt;br /&gt;&lt;br /&gt;  // Rename&lt;br /&gt;  ExcelApp.Workbooks[1].WorkSheets[1].Name := 'Pasta1';&lt;br /&gt;&lt;br /&gt;  // Insert some Text in some Cells[Row,Col]&lt;br /&gt;  ExcelApp.Cells[1, 1].Value := 'Test';&lt;br /&gt;  ExcelApp.Cells[2, 1].Value := 'http://www.delphi3000.com';&lt;br /&gt;  ExcelApp.Cells[3, 1].Value := FormatDateTime('dd-mmm-yyyy', Now);&lt;br /&gt;&lt;br /&gt;  // Setting a row of data with one call&lt;br /&gt;  //ExcelApp.Range['A2', 'D2'].Value := VarArrayOf([1, 10, 100, 1000]);&lt;br /&gt;&lt;br /&gt;  // Setting a formula&lt;br /&gt;// ExcelApp.Range['A11', 'A11'].Formula := '=Sum(A1:A10)';&lt;br /&gt;&lt;br /&gt;  // Change Cell Alignement&lt;br /&gt;// ExcelApp.Cells[2, 1].HorizontalAlignment := xlright;&lt;br /&gt;&lt;br /&gt;  // Change the Column Width.&lt;br /&gt;  ColumnRange := ExcelApp.Workbooks[1].WorkSheets[1].Columns;&lt;br /&gt;  ColumnRange.Columns[1].ColumnWidth := 20;&lt;br /&gt;  ColumnRange.Columns[2].ColumnWidth := 40;&lt;br /&gt;&lt;br /&gt;  // Change Rowheight / Zeilenhohe andern:&lt;br /&gt;  ExcelApp.Rows[1].RowHeight := 15.75;&lt;br /&gt;&lt;br /&gt;  // Merge cells, Zellen verbinden:&lt;br /&gt;  ExcelApp.Range['B3:D3'].Mergecells := True;&lt;br /&gt;&lt;br /&gt;  // Apply borders to cells, Zellen umrahmen:&lt;br /&gt;  ExcelApp.Range['A14:M14'].Borders.Weight := xlThick; // Think line/ Dicke Linie&lt;br /&gt;  ExcelApp.Range['A14:M14'].Borders.Weight := xlThin;  // Thin line Dunne Linie&lt;br /&gt;&lt;br /&gt;  // Set Bold Font in cells, Fettdruck in den Zellen&lt;br /&gt;&lt;br /&gt;  ExcelApp.Range['B16:M26'].Font.Bold := True;&lt;br /&gt;&lt;br /&gt;  // Set Font Size, Schriftgro?e setzen&lt;br /&gt;  ExcelApp.Range['B16:M26'].Font.Size := 12;&lt;br /&gt;&lt;br /&gt;  //right-aligned Text, rechtsbundige Textausrichtung&lt;br /&gt;  ExcelApp.Cells[9, 6].HorizontalAlignment := xlright;&lt;br /&gt;&lt;br /&gt;  // horizontal-aligned text, horizontale Zentrierung&lt;br /&gt;  ExcelApp.Range['B14:M26'].HorizontalAlignment := xlHAlignCenter;&lt;br /&gt;&lt;br /&gt;  // left-aligned Text, vertikale Zentrierung&lt;br /&gt;// ExcelApp.Range['B14:M26'].VerticallyAlignment := xlVAlignCenter;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  { Page Setup }&lt;br /&gt;&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.Orientation := xlLandscape;&lt;br /&gt;&lt;br /&gt;  // Left, Right Margin (Seitenrander)&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.LeftMargin  := 35;&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.RightMargin := -15;&lt;br /&gt;&lt;br /&gt;  // Set Footer Margin&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.FooterMargin := ExcelApp.InchesToPoints(0);&lt;br /&gt;&lt;br /&gt;  // Fit to X page(s) wide by Y tall&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.FitToPagesWide := 1;  // Y&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.FitToPagesTall := 3; // Y&lt;br /&gt;&lt;br /&gt;  // Zoom&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.Zoom := 95;&lt;br /&gt;&lt;br /&gt;  // Set Paper Size:&lt;br /&gt;// ExcelApp.PageSetup.PaperSize := xlPaperA4;&lt;br /&gt;&lt;br /&gt;  // Show/Hide Gridlines:&lt;br /&gt;  ExcelApp.ActiveWindow.DisplayGridlines := False;&lt;br /&gt;&lt;br /&gt;  // Set Black &amp;amp; White&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.BlackAndWhite := False;&lt;br /&gt;&lt;br /&gt;  // footers&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.RightFooter := 'Right Footer / Rechte Fu?zeile';&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.LeftFooter  := 'Left Footer / Linke Fu?zeile';&lt;br /&gt;&lt;br /&gt;  // Show Excel Version:&lt;br /&gt;  ShowMessage(Format('Excel Version %s: ', [ExcelApp.Version]));&lt;br /&gt;&lt;br /&gt;  // Show Excel:&lt;br /&gt;//  ExcelApp.Visible := True;&lt;br /&gt;&lt;br /&gt;  // Save the Workbook&lt;br /&gt;  //ExcelApp.SaveAs('c:\filename.xls');&lt;br /&gt;&lt;br /&gt;  // Save the active Workbook:&lt;br /&gt;// ExcelApp.ActiveSheet.Protect.Password := 'Teste';&lt;br /&gt;  ExcelApp.ActiveSheet.Protect(Password:='Teste', DrawingObjects:=True, Contents:=True, Scenarios:=True);//;&lt;br /&gt;  //Contents:=True, Scenarios:=True&lt;br /&gt;  ExcelApp.ActiveWorkBook.SaveAs('c:\filename.xls');&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;procedure TForm1.FormDestroy(Sender: TObject);&lt;br /&gt;begin&lt;br /&gt;  // Quit Excel&lt;br /&gt;  if not VarIsEmpty(ExcelApp) then&lt;br /&gt;  begin&lt;br /&gt;    ExcelApp.DisplayAlerts := False;  // Discard unsaved files....&lt;br /&gt;    ExcelApp.Quit;&lt;br /&gt;  end;&lt;br /&gt;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;end.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1030596328209703715-1033083322601149875?l=delphizine.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://delphizine.blogspot.com/feeds/1033083322601149875/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://delphizine.blogspot.com/2009/07/how-protect-excel-sheet-using-delphi_6285.html#comment-form' title='41 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/1033083322601149875'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/1033083322601149875'/><link rel='alternate' type='text/html' href='http://delphizine.blogspot.com/2009/07/how-protect-excel-sheet-using-delphi_6285.html' title='How protect Excel Sheet using Delphi?'/><author><name>Aisyah Runi</name><uri>http://www.blogger.com/profile/09754809777891988684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp3.blogger.com/_iNFxbPL4FYE/R_dMDxJPHQI/AAAAAAAAAAM/L8A99OeHoPU/S220/runi001.jpg'/></author><thr:total>41</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1030596328209703715.post-8520829565475239187</id><published>2009-07-26T22:53:00.001-07:00</published><updated>2009-07-26T23:03:56.671-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='how to'/><title type='text'>How protect Excel Sheet using Delphi?</title><content type='html'>How protect Excel Sheet using Delphi?&lt;br /&gt;Answer:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;unit UTesteProtect;&lt;br /&gt;&lt;br /&gt;interface&lt;br /&gt;&lt;br /&gt;uses&lt;br /&gt;  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,&lt;br /&gt;  Dialogs, StdCtrls, ComObj;&lt;br /&gt;&lt;br /&gt;type&lt;br /&gt;  TForm1 = class(TForm)&lt;br /&gt;    Button1: TButton;&lt;br /&gt;    procedure Button1Click(Sender: TObject);&lt;br /&gt;    procedure FormDestroy(Sender: TObject);&lt;br /&gt;  private&lt;br /&gt;    { Private declarations }&lt;br /&gt;  public&lt;br /&gt;    { Public declarations }&lt;br /&gt;  end;&lt;br /&gt;&lt;br /&gt;var&lt;br /&gt;  Form1: TForm1;&lt;br /&gt;  ExcelApp: OleVariant;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;implementation&lt;br /&gt;&lt;br /&gt;{$R *.dfm}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;procedure TForm1.Button1Click(Sender: TObject);&lt;br /&gt;const&lt;br /&gt;  // SheetType&lt;br /&gt;  xlChart = -4109;&lt;br /&gt;  xlWorksheet = -4167;&lt;br /&gt;  // WBATemplate&lt;br /&gt;  xlWBATWorksheet = -4167;&lt;br /&gt;  xlWBATChart = -4109;&lt;br /&gt;  // Page Setup&lt;br /&gt;  xlPortrait = 1;&lt;br /&gt;  xlLandscape = 2;&lt;br /&gt;  xlPaperA4 = 9;&lt;br /&gt;  // Format Cells&lt;br /&gt;  xlBottom = -4107;&lt;br /&gt;  xlLeft = -4131;&lt;br /&gt;  xlRight = -4152;&lt;br /&gt;  xlTop = -4160;&lt;br /&gt;  // Text Alignment&lt;br /&gt;  xlHAlignCenter = -4108;&lt;br /&gt;  xlVAlignCenter = -4108;&lt;br /&gt;  // Cell Borders&lt;br /&gt;  xlThick = 4;&lt;br /&gt;  xlThin = 2;&lt;br /&gt;var&lt;br /&gt;  ColumnRange: OleVariant;&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;  { Start Excel }&lt;br /&gt;&lt;br /&gt;  // By using GetActiveOleObject, you use an instance o&lt;br /&gt;  // f Word that's already running,&lt;br /&gt;  // if there is one.&lt;br /&gt;    try&lt;br /&gt;      // If no instance of Word is running, try to Create a new Excel Object&lt;br /&gt;      ExcelApp := CreateOleObject('Excel.Application');&lt;br /&gt;    except&lt;br /&gt;      ShowMessage('Cannot start Excel/Excel not installed ?');&lt;br /&gt;      Exit;&lt;br /&gt;    end;&lt;br /&gt;&lt;br /&gt;  // Add a new Workbook, Neue Arbeitsmappe offnen&lt;br /&gt;  ExcelApp.Workbooks.Add(xlWBatWorkSheet);&lt;br /&gt;&lt;br /&gt;  // Open a Workbook, Arbeitsmappe offnen&lt;br /&gt;  ExcelApp.Workbooks.Open('c:\pasta1.xls');&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  // Rename the active Sheet&lt;br /&gt;  ExcelApp.ActiveSheet.Name := 'Pasta1';&lt;br /&gt;&lt;br /&gt;  // Rename&lt;br /&gt;  ExcelApp.Workbooks[1].WorkSheets[1].Name := 'Pasta1';&lt;br /&gt;&lt;br /&gt;  // Insert some Text in some Cells[Row,Col]&lt;br /&gt;  ExcelApp.Cells[1, 1].Value := 'Test';&lt;br /&gt;  ExcelApp.Cells[2, 1].Value := 'http://www.delphi3000.com';&lt;br /&gt;  ExcelApp.Cells[3, 1].Value := FormatDateTime('dd-mmm-yyyy', Now);&lt;br /&gt;&lt;br /&gt;  // Setting a row of data with one call&lt;br /&gt;  //ExcelApp.Range['A2', 'D2'].Value := VarArrayOf([1, 10, 100, 1000]);&lt;br /&gt;&lt;br /&gt;  // Setting a formula&lt;br /&gt;// ExcelApp.Range['A11', 'A11'].Formula := '=Sum(A1:A10)';&lt;br /&gt;&lt;br /&gt;  // Change Cell Alignement&lt;br /&gt;// ExcelApp.Cells[2, 1].HorizontalAlignment := xlright;&lt;br /&gt;&lt;br /&gt;  // Change the Column Width.&lt;br /&gt;  ColumnRange := ExcelApp.Workbooks[1].WorkSheets[1].Columns;&lt;br /&gt;  ColumnRange.Columns[1].ColumnWidth := 20;&lt;br /&gt;  ColumnRange.Columns[2].ColumnWidth := 40;&lt;br /&gt;&lt;br /&gt;  // Change Rowheight / Zeilenhohe andern:&lt;br /&gt;  ExcelApp.Rows[1].RowHeight := 15.75;&lt;br /&gt;&lt;br /&gt;  // Merge cells, Zellen verbinden:&lt;br /&gt;  ExcelApp.Range['B3:D3'].Mergecells := True;&lt;br /&gt;&lt;br /&gt;  // Apply borders to cells, Zellen umrahmen:&lt;br /&gt;  ExcelApp.Range['A14:M14'].Borders.Weight := xlThick; // Think line/ Dicke Linie&lt;br /&gt;  ExcelApp.Range['A14:M14'].Borders.Weight := xlThin;  // Thin line Dunne Linie&lt;br /&gt;&lt;br /&gt;  // Set Bold Font in cells, Fettdruck in den Zellen&lt;br /&gt;&lt;br /&gt;  ExcelApp.Range['B16:M26'].Font.Bold := True;&lt;br /&gt;&lt;br /&gt;  // Set Font Size, Schriftgro?e setzen&lt;br /&gt;  ExcelApp.Range['B16:M26'].Font.Size := 12;&lt;br /&gt;&lt;br /&gt;  //right-aligned Text, rechtsbundige Textausrichtung&lt;br /&gt;  ExcelApp.Cells[9, 6].HorizontalAlignment := xlright;&lt;br /&gt;&lt;br /&gt;  // horizontal-aligned text, horizontale Zentrierung&lt;br /&gt;  ExcelApp.Range['B14:M26'].HorizontalAlignment := xlHAlignCenter;&lt;br /&gt;&lt;br /&gt;  // left-aligned Text, vertikale Zentrierung&lt;br /&gt;// ExcelApp.Range['B14:M26'].VerticallyAlignment := xlVAlignCenter;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  { Page Setup }&lt;br /&gt;&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.Orientation := xlLandscape;&lt;br /&gt;&lt;br /&gt;  // Left, Right Margin (Seitenrander)&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.LeftMargin  := 35;&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.RightMargin := -15;&lt;br /&gt;&lt;br /&gt;  // Set Footer Margin&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.FooterMargin := ExcelApp.InchesToPoints(0);&lt;br /&gt;&lt;br /&gt;  // Fit to X page(s) wide by Y tall&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.FitToPagesWide := 1;  // Y&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.FitToPagesTall := 3; // Y&lt;br /&gt;&lt;br /&gt;  // Zoom&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.Zoom := 95;&lt;br /&gt;&lt;br /&gt;  // Set Paper Size:&lt;br /&gt;// ExcelApp.PageSetup.PaperSize := xlPaperA4;&lt;br /&gt;&lt;br /&gt;  // Show/Hide Gridlines:&lt;br /&gt;  ExcelApp.ActiveWindow.DisplayGridlines := False;&lt;br /&gt;&lt;br /&gt;  // Set Black &amp;amp; White&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.BlackAndWhite := False;&lt;br /&gt;&lt;br /&gt;  // footers&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.RightFooter := 'Right Footer / Rechte Fu?zeile';&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.LeftFooter  := 'Left Footer / Linke Fu?zeile';&lt;br /&gt;&lt;br /&gt;  // Show Excel Version:&lt;br /&gt;  ShowMessage(Format('Excel Version %s: ', [ExcelApp.Version]));&lt;br /&gt;&lt;br /&gt;  // Show Excel:&lt;br /&gt;//  ExcelApp.Visible := True;&lt;br /&gt;&lt;br /&gt;  // Save the Workbook&lt;br /&gt;  //ExcelApp.SaveAs('c:\filename.xls');&lt;br /&gt;&lt;br /&gt;  // Save the active Workbook:&lt;br /&gt;// ExcelApp.ActiveSheet.Protect.Password := 'Teste';&lt;br /&gt;  ExcelApp.ActiveSheet.Protect(Password:='Teste', DrawingObjects:=True, Contents:=True, Scenarios:=True);//;&lt;br /&gt;  //Contents:=True, Scenarios:=True&lt;br /&gt;  ExcelApp.ActiveWorkBook.SaveAs('c:\filename.xls');&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;procedure TForm1.FormDestroy(Sender: TObject);&lt;br /&gt;begin&lt;br /&gt;  // Quit Excel&lt;br /&gt;  if not VarIsEmpty(ExcelApp) then&lt;br /&gt;  begin&lt;br /&gt;    ExcelApp.DisplayAlerts := False;  // Discard unsaved files....&lt;br /&gt;    ExcelApp.Quit;&lt;br /&gt;  end;&lt;br /&gt;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;end.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1030596328209703715-8520829565475239187?l=delphizine.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://delphizine.blogspot.com/feeds/8520829565475239187/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://delphizine.blogspot.com/2009/07/how-protect-excel-sheet-using-delphi_26.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/8520829565475239187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/8520829565475239187'/><link rel='alternate' type='text/html' href='http://delphizine.blogspot.com/2009/07/how-protect-excel-sheet-using-delphi_26.html' title='How protect Excel Sheet using Delphi?'/><author><name>Aisyah Runi</name><uri>http://www.blogger.com/profile/09754809777891988684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp3.blogger.com/_iNFxbPL4FYE/R_dMDxJPHQI/AAAAAAAAAAM/L8A99OeHoPU/S220/runi001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1030596328209703715.post-1174161629031414581</id><published>2009-07-26T22:53:00.000-07:00</published><updated>2009-07-26T23:02:03.650-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='how to'/><title type='text'>How protect Excel Sheet using Delphi?</title><content type='html'>How protect Excel Sheet using Delphi?&lt;br /&gt;Answer:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;unit UTesteProtect;&lt;br /&gt;&lt;br /&gt;interface&lt;br /&gt;&lt;br /&gt;uses&lt;br /&gt;  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,&lt;br /&gt;  Dialogs, StdCtrls, ComObj;&lt;br /&gt;&lt;br /&gt;type&lt;br /&gt;  TForm1 = class(TForm)&lt;br /&gt;    Button1: TButton;&lt;br /&gt;    procedure Button1Click(Sender: TObject);&lt;br /&gt;    procedure FormDestroy(Sender: TObject);&lt;br /&gt;  private&lt;br /&gt;    { Private declarations }&lt;br /&gt;  public&lt;br /&gt;    { Public declarations }&lt;br /&gt;  end;&lt;br /&gt;&lt;br /&gt;var&lt;br /&gt;  Form1: TForm1;&lt;br /&gt;  ExcelApp: OleVariant;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;implementation&lt;br /&gt;&lt;br /&gt;{$R *.dfm}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;procedure TForm1.Button1Click(Sender: TObject);&lt;br /&gt;const&lt;br /&gt;  // SheetType&lt;br /&gt;  xlChart = -4109;&lt;br /&gt;  xlWorksheet = -4167;&lt;br /&gt;  // WBATemplate&lt;br /&gt;  xlWBATWorksheet = -4167;&lt;br /&gt;  xlWBATChart = -4109;&lt;br /&gt;  // Page Setup&lt;br /&gt;  xlPortrait = 1;&lt;br /&gt;  xlLandscape = 2;&lt;br /&gt;  xlPaperA4 = 9;&lt;br /&gt;  // Format Cells&lt;br /&gt;  xlBottom = -4107;&lt;br /&gt;  xlLeft = -4131;&lt;br /&gt;  xlRight = -4152;&lt;br /&gt;  xlTop = -4160;&lt;br /&gt;  // Text Alignment&lt;br /&gt;  xlHAlignCenter = -4108;&lt;br /&gt;  xlVAlignCenter = -4108;&lt;br /&gt;  // Cell Borders&lt;br /&gt;  xlThick = 4;&lt;br /&gt;  xlThin = 2;&lt;br /&gt;var&lt;br /&gt;  ColumnRange: OleVariant;&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;  { Start Excel }&lt;br /&gt;&lt;br /&gt;  // By using GetActiveOleObject, you use an instance o&lt;br /&gt;  // f Word that's already running,&lt;br /&gt;  // if there is one.&lt;br /&gt;    try&lt;br /&gt;      // If no instance of Word is running, try to Create a new Excel Object&lt;br /&gt;      ExcelApp := CreateOleObject('Excel.Application');&lt;br /&gt;    except&lt;br /&gt;      ShowMessage('Cannot start Excel/Excel not installed ?');&lt;br /&gt;      Exit;&lt;br /&gt;    end;&lt;br /&gt;&lt;br /&gt;  // Add a new Workbook, Neue Arbeitsmappe offnen&lt;br /&gt;  ExcelApp.Workbooks.Add(xlWBatWorkSheet);&lt;br /&gt;&lt;br /&gt;  // Open a Workbook, Arbeitsmappe offnen&lt;br /&gt;  ExcelApp.Workbooks.Open('c:\pasta1.xls');&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  // Rename the active Sheet&lt;br /&gt;  ExcelApp.ActiveSheet.Name := 'Pasta1';&lt;br /&gt;&lt;br /&gt;  // Rename&lt;br /&gt;  ExcelApp.Workbooks[1].WorkSheets[1].Name := 'Pasta1';&lt;br /&gt;&lt;br /&gt;  // Insert some Text in some Cells[Row,Col]&lt;br /&gt;  ExcelApp.Cells[1, 1].Value := 'Test';&lt;br /&gt;  ExcelApp.Cells[2, 1].Value := 'http://www.delphi3000.com';&lt;br /&gt;  ExcelApp.Cells[3, 1].Value := FormatDateTime('dd-mmm-yyyy', Now);&lt;br /&gt;&lt;br /&gt;  // Setting a row of data with one call&lt;br /&gt;  //ExcelApp.Range['A2', 'D2'].Value := VarArrayOf([1, 10, 100, 1000]);&lt;br /&gt;&lt;br /&gt;  // Setting a formula&lt;br /&gt;// ExcelApp.Range['A11', 'A11'].Formula := '=Sum(A1:A10)';&lt;br /&gt;&lt;br /&gt;  // Change Cell Alignement&lt;br /&gt;// ExcelApp.Cells[2, 1].HorizontalAlignment := xlright;&lt;br /&gt;&lt;br /&gt;  // Change the Column Width.&lt;br /&gt;  ColumnRange := ExcelApp.Workbooks[1].WorkSheets[1].Columns;&lt;br /&gt;  ColumnRange.Columns[1].ColumnWidth := 20;&lt;br /&gt;  ColumnRange.Columns[2].ColumnWidth := 40;&lt;br /&gt;&lt;br /&gt;  // Change Rowheight / Zeilenhohe andern:&lt;br /&gt;  ExcelApp.Rows[1].RowHeight := 15.75;&lt;br /&gt;&lt;br /&gt;  // Merge cells, Zellen verbinden:&lt;br /&gt;  ExcelApp.Range['B3:D3'].Mergecells := True;&lt;br /&gt;&lt;br /&gt;  // Apply borders to cells, Zellen umrahmen:&lt;br /&gt;  ExcelApp.Range['A14:M14'].Borders.Weight := xlThick; // Think line/ Dicke Linie&lt;br /&gt;  ExcelApp.Range['A14:M14'].Borders.Weight := xlThin;  // Thin line Dunne Linie&lt;br /&gt;&lt;br /&gt;  // Set Bold Font in cells, Fettdruck in den Zellen&lt;br /&gt;&lt;br /&gt;  ExcelApp.Range['B16:M26'].Font.Bold := True;&lt;br /&gt;&lt;br /&gt;  // Set Font Size, Schriftgro?e setzen&lt;br /&gt;  ExcelApp.Range['B16:M26'].Font.Size := 12;&lt;br /&gt;&lt;br /&gt;  //right-aligned Text, rechtsbundige Textausrichtung&lt;br /&gt;  ExcelApp.Cells[9, 6].HorizontalAlignment := xlright;&lt;br /&gt;&lt;br /&gt;  // horizontal-aligned text, horizontale Zentrierung&lt;br /&gt;  ExcelApp.Range['B14:M26'].HorizontalAlignment := xlHAlignCenter;&lt;br /&gt;&lt;br /&gt;  // left-aligned Text, vertikale Zentrierung&lt;br /&gt;// ExcelApp.Range['B14:M26'].VerticallyAlignment := xlVAlignCenter;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  { Page Setup }&lt;br /&gt;&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.Orientation := xlLandscape;&lt;br /&gt;&lt;br /&gt;  // Left, Right Margin (Seitenrander)&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.LeftMargin  := 35;&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.RightMargin := -15;&lt;br /&gt;&lt;br /&gt;  // Set Footer Margin&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.FooterMargin := ExcelApp.InchesToPoints(0);&lt;br /&gt;&lt;br /&gt;  // Fit to X page(s) wide by Y tall&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.FitToPagesWide := 1;  // Y&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.FitToPagesTall := 3; // Y&lt;br /&gt;&lt;br /&gt;  // Zoom&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.Zoom := 95;&lt;br /&gt;&lt;br /&gt;  // Set Paper Size:&lt;br /&gt;// ExcelApp.PageSetup.PaperSize := xlPaperA4;&lt;br /&gt;&lt;br /&gt;  // Show/Hide Gridlines:&lt;br /&gt;  ExcelApp.ActiveWindow.DisplayGridlines := False;&lt;br /&gt;&lt;br /&gt;  // Set Black &amp;amp; White&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.BlackAndWhite := False;&lt;br /&gt;&lt;br /&gt;  // footers&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.RightFooter := 'Right Footer / Rechte Fu?zeile';&lt;br /&gt;  ExcelApp.ActiveSheet.PageSetup.LeftFooter  := 'Left Footer / Linke Fu?zeile';&lt;br /&gt;&lt;br /&gt;  // Show Excel Version:&lt;br /&gt;  ShowMessage(Format('Excel Version %s: ', [ExcelApp.Version]));&lt;br /&gt;&lt;br /&gt;  // Show Excel:&lt;br /&gt;//  ExcelApp.Visible := True;&lt;br /&gt;&lt;br /&gt;  // Save the Workbook&lt;br /&gt;  //ExcelApp.SaveAs('c:\filename.xls');&lt;br /&gt;&lt;br /&gt;  // Save the active Workbook:&lt;br /&gt;// ExcelApp.ActiveSheet.Protect.Password := 'Teste';&lt;br /&gt;  ExcelApp.ActiveSheet.Protect(Password:='Teste', DrawingObjects:=True, Contents:=True, Scenarios:=True);//;&lt;br /&gt;  //Contents:=True, Scenarios:=True&lt;br /&gt;  ExcelApp.ActiveWorkBook.SaveAs('c:\filename.xls');&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;procedure TForm1.FormDestroy(Sender: TObject);&lt;br /&gt;begin&lt;br /&gt;  // Quit Excel&lt;br /&gt;  if not VarIsEmpty(ExcelApp) then&lt;br /&gt;  begin&lt;br /&gt;    ExcelApp.DisplayAlerts := False;  // Discard unsaved files....&lt;br /&gt;    ExcelApp.Quit;&lt;br /&gt;  end;&lt;br /&gt;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;end.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1030596328209703715-1174161629031414581?l=delphizine.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://delphizine.blogspot.com/feeds/1174161629031414581/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://delphizine.blogspot.com/2009/07/how-protect-excel-sheet-using-delphi.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/1174161629031414581'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/1174161629031414581'/><link rel='alternate' type='text/html' href='http://delphizine.blogspot.com/2009/07/how-protect-excel-sheet-using-delphi.html' title='How protect Excel Sheet using Delphi?'/><author><name>Aisyah Runi</name><uri>http://www.blogger.com/profile/09754809777891988684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp3.blogger.com/_iNFxbPL4FYE/R_dMDxJPHQI/AAAAAAAAAAM/L8A99OeHoPU/S220/runi001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1030596328209703715.post-6773503453792217715</id><published>2009-07-24T19:38:00.000-07:00</published><updated>2009-07-24T19:41:23.061-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tutorial'/><title type='text'>BORLAND DELPHI 7 TUTORIAL - FOR WINDOWS - TUTORIAL GUIDE HELP FREE</title><content type='html'>&lt;h1 class="monog"&gt;&lt;br /&gt; &lt;br /&gt;&lt;/h1&gt;             &lt;b&gt;&lt;img src="http://www.tutorialspdf.com/img/pdf.gif" alt="Borland Delphi 7 Tutorial - For Windows" width="48" height="52" /&gt; &lt;span style="color:#ff0000;"&gt;FREE DOWNLOAD THIS TUTORIAL &lt;/span&gt;&lt;br /&gt;        This tutorial in pdf format so you can save it to your computer or print.&lt;/b&gt;&lt;br /&gt;       &lt;br /&gt;       &lt;br /&gt;        &lt;b&gt;&lt;/b&gt;&lt;br /&gt;       &lt;br /&gt;        &lt;b&gt;Here you leave the free download of the tutorial&lt;/b&gt;&lt;br /&gt;        &lt;b&gt;Nota:&lt;/b&gt; The tutorial you are about to download is compressed format . rar, if you do not have a decompressor rar files you can download free &lt;a href="http://www.7-zip.org/"&gt;7-zip&lt;/a&gt; and to display the &lt;a href="http://www.7-zip.org/"&gt;Foxit PDF Reader&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;CONTENTS BORLAND DELPHI 7 TUTORIAL - FOR WINDOWS&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Component Writer’s Guide&lt;br /&gt;Borland Delphi 7 for Windows&lt;br /&gt;Chapter 1&lt;br /&gt;Overview of component creation 1-1&lt;br /&gt;Class library&lt;br /&gt;Components and classes&lt;br /&gt;Creating components&lt;br /&gt;Modifying existing controls&lt;br /&gt;Creating windowed controls&lt;br /&gt;Creating graphic controls&lt;br /&gt;Subclassing Windows controls&lt;br /&gt;Creating nonvisual components&lt;br /&gt;What goes into a component?&lt;br /&gt;Removing dependencies&lt;br /&gt;Setting properties, methods, and events&lt;br /&gt;Properties&lt;br /&gt;Methods&lt;br /&gt;Events&lt;br /&gt;Encapsulating graphics&lt;br /&gt;Registering components&lt;br /&gt;Creating a new component&lt;br /&gt;Creating a component with the&lt;br /&gt;Component wizard&lt;br /&gt;Creating a component manually&lt;br /&gt;Creating a unit file&lt;br /&gt;Deriving the component&lt;br /&gt;Registering the component&lt;br /&gt;Creating a bitmap for a component&lt;br /&gt;Installing a component on the Component palette&lt;br /&gt;Making source files available&lt;br /&gt;Testing uninstalled components&lt;br /&gt;Testing installed components&lt;br /&gt;Delphi 7 Tutorial&lt;br /&gt;Good tutorials pdf&lt;br /&gt;Software user guide&lt;br /&gt;Manuals free&lt;br /&gt;Help me programming&lt;br /&gt;Bible Borland&lt;br /&gt;Table of Contents&lt;br /&gt;Chapter 2&lt;br /&gt;Object-oriented programming for component writers&lt;br /&gt;Defining new classes&lt;br /&gt;Deriving new classes&lt;br /&gt;To change class defaults to avoid repetition&lt;br /&gt;To add new capabilities to a class&lt;br /&gt;Declaring a new component class&lt;br /&gt;Ancestors, descendants, and class hierarchies&lt;br /&gt;Controlling access&lt;br /&gt;Hiding implementation details&lt;br /&gt;Defining the component writer’s interface&lt;br /&gt;Defining the runtime interface&lt;br /&gt;Defining the design-time interface&lt;br /&gt;Dispatching methods&lt;br /&gt;Static methods&lt;br /&gt;An example of static methods&lt;br /&gt;Virtual methods&lt;br /&gt;Overriding methods&lt;br /&gt;Dynamic methods&lt;br /&gt;Abstract class members&lt;br /&gt;Classes and pointers&lt;br /&gt;Chapter 3&lt;br /&gt;Creating properties&lt;br /&gt;Why create properties?&lt;br /&gt;Types of properties&lt;br /&gt;Publishing inherited properties&lt;br /&gt;Defining properties&lt;br /&gt;Property declarations&lt;br /&gt;Internal data storage&lt;br /&gt;Direct access&lt;br /&gt;Access methods&lt;br /&gt;The read method&lt;br /&gt;The write method&lt;br /&gt;Default property values&lt;br /&gt;Specifying no default value&lt;br /&gt;Creating array properties&lt;br /&gt;Creating properties for subcomponents&lt;br /&gt;Creating properties for interfaces&lt;br /&gt;Storing and loading properties&lt;br /&gt;Using the store-and-load mechanism&lt;br /&gt;Specifying default values&lt;br /&gt;Determining what to store&lt;br /&gt;Initializing after loading&lt;br /&gt;Storing and loading unpublished properties&lt;br /&gt;Creating methods to store and load property values&lt;br /&gt;Overriding the DefineProperties method&lt;br /&gt;Chapter 4&lt;br /&gt;Creating events&lt;br /&gt;What are events?&lt;br /&gt;Events are method pointers&lt;br /&gt;Events are properties&lt;br /&gt;Event types are method-pointer types&lt;br /&gt;Event-handler types are procedures&lt;br /&gt;Event handlers are optional&lt;br /&gt;Implementing the standard events&lt;br /&gt;Identifying standard events&lt;br /&gt;Standard events for all controls&lt;br /&gt;Standard events for standard controls&lt;br /&gt;Making events visible&lt;br /&gt;Changing the standard event handling&lt;br /&gt;Defining your own events&lt;br /&gt;Triggering the event&lt;br /&gt;Two kinds of events&lt;br /&gt;Defining the handler type&lt;br /&gt;Simple notifications&lt;br /&gt;Event-specific handlers&lt;br /&gt;Returning information from the handler&lt;br /&gt;Declaring the event&lt;br /&gt;Event names start with “On”&lt;br /&gt;Calling the event&lt;br /&gt;Chapter 5&lt;br /&gt;Creating methods&lt;br /&gt;Avoiding dependencies&lt;br /&gt;Naming methods&lt;br /&gt;Protecting methods&lt;br /&gt;Methods that should be public&lt;br /&gt;Methods that should be protected&lt;br /&gt;Abstract methods&lt;br /&gt;Making methods virtual&lt;br /&gt;Declaring methods&lt;br /&gt;Chapter 6&lt;br /&gt;Using graphics in components&lt;br /&gt;Overview of graphics&lt;br /&gt;Using the canvas&lt;br /&gt;Working with pictures&lt;br /&gt;Using a picture, graphic, or canvas&lt;br /&gt;Loading and storing graphics&lt;br /&gt;Handling palettes&lt;br /&gt;Specifying a palette for a control&lt;br /&gt;Off-screen bitmaps&lt;br /&gt;Creating and managing off-screen bitmaps&lt;br /&gt;Copying bitmapped images&lt;br /&gt;Responding to changes&lt;br /&gt;Chapter 7&lt;br /&gt;Handling messages and system notifications&lt;br /&gt;Understanding the message-handling system&lt;br /&gt;What’s in a Windows message?&lt;br /&gt;Dispatching messages&lt;br /&gt;Tracing the flow of messages&lt;br /&gt;Changing message handling&lt;br /&gt;Overriding the handler method&lt;br /&gt;Using message parameters&lt;br /&gt;Trapping messages&lt;br /&gt;Creating new message handlers&lt;br /&gt;Defining your own messages&lt;br /&gt;Declaring a message identifier&lt;br /&gt;Declaring a message-record type&lt;br /&gt;Declaring a new message-handling method&lt;br /&gt;Sending messages&lt;br /&gt;Broadcasting a message to all controls in a form&lt;br /&gt;Calling a control’s message handler directly&lt;br /&gt;Sending a message using the Windows message queue&lt;br /&gt;Sending a message that does not execute immediately&lt;br /&gt;Responding to system notifications using CLX&lt;br /&gt;Responding to signals&lt;br /&gt;Assigning custom signal handlers&lt;br /&gt;Responding to system events&lt;br /&gt;Commonly used events&lt;br /&gt;Overriding the EventFilter method&lt;br /&gt;Generating Qt events&lt;br /&gt;Chapter 8&lt;br /&gt;Making components available at design time&lt;br /&gt;Registering components&lt;br /&gt;Declaring the Register procedure&lt;br /&gt;Writing the Register procedure&lt;br /&gt;Specifying the components&lt;br /&gt;Specifying the palette page&lt;br /&gt;Using the RegisterComponents function&lt;br /&gt;Providing Help for your component&lt;br /&gt;Creating the Help file&lt;br /&gt;Creating the entries&lt;br /&gt;Making component Help context-sensitive&lt;br /&gt;Adding component Help files&lt;br /&gt;Adding property editors&lt;br /&gt;Deriving a property-editor class&lt;br /&gt;Editing the property as text&lt;br /&gt;Displaying the property value&lt;br /&gt;Setting the property value&lt;br /&gt;Editing the property as a whole&lt;br /&gt;Specifying editor attributes&lt;br /&gt;Registering the property editor&lt;br /&gt;Property categories&lt;br /&gt;Registering one property at a time&lt;br /&gt;Registering multiple properties at once&lt;br /&gt;Specifying property categories&lt;br /&gt;Using the IsPropertyInCategory function&lt;br /&gt;Adding component editors&lt;br /&gt;Adding items to the context menu&lt;br /&gt;Specifying menu items&lt;br /&gt;Implementing commands&lt;br /&gt;Changing the double-click behavior&lt;br /&gt;Adding clipboard formats&lt;br /&gt;Registering the component editor&lt;br /&gt;Compiling components into packages&lt;br /&gt;Chapter 9&lt;br /&gt;Modifying an existing component&lt;br /&gt;Creating and registering the component&lt;br /&gt;Modifying the component class&lt;br /&gt;Overriding the constructor&lt;br /&gt;Specifying the new default property value&lt;br /&gt;Chapter 10&lt;br /&gt;Creating a graphic control&lt;br /&gt;Creating and registering the component&lt;br /&gt;Publishing inherited properties&lt;br /&gt;Adding graphic capabilities&lt;br /&gt;Determining what to draw&lt;br /&gt;Declaring the property type&lt;br /&gt;Declaring the property&lt;br /&gt;Writing the implementation method&lt;br /&gt;Overriding the constructor and destructor&lt;br /&gt;Changing default property values&lt;br /&gt;Publishing the pen and brush&lt;br /&gt;Declaring the class fields&lt;br /&gt;Declaring the access properties&lt;br /&gt;Initializing owned classes&lt;br /&gt;Setting owned classes’ properties&lt;br /&gt;Drawing the component image&lt;br /&gt;Refining the shape drawing&lt;br /&gt;Chapter 11&lt;br /&gt;Customizing a grid&lt;br /&gt;Creating and registering the component&lt;br /&gt;Publishing inherited properties&lt;br /&gt;Changing initial values&lt;br /&gt;Resizing the cells&lt;br /&gt;Filling in the cells&lt;br /&gt;Tracking the date&lt;br /&gt;Storing the internal date&lt;br /&gt;Accessing the day, month, and year&lt;br /&gt;Generating the day numbers&lt;br /&gt;Selecting the current day&lt;br /&gt;Navigating months and years&lt;br /&gt;Navigating days&lt;br /&gt;Moving the selection&lt;br /&gt;Providing an OnChange event&lt;br /&gt;Excluding blank cells&lt;br /&gt;Chapter 12&lt;br /&gt;Making a control data aware&lt;br /&gt;Creating a data browsing control&lt;br /&gt;Creating and registering the component&lt;br /&gt;Making the control read-only&lt;br /&gt;Adding the ReadOnly property&lt;br /&gt;Allowing needed updates&lt;br /&gt;Adding the data link&lt;br /&gt;Declaring the class field&lt;br /&gt;Declaring the access properties&lt;br /&gt;An example of declaring access properties&lt;br /&gt;Initializing the data link&lt;br /&gt;Responding to data changes&lt;br /&gt;Creating a data editing control&lt;br /&gt;Changing the default value of FReadOnly&lt;br /&gt;Handling mouse-down and key-down messages&lt;br /&gt;Responding to mouse-down messages&lt;br /&gt;Responding to key-down messages&lt;br /&gt;Updating the field data link class&lt;br /&gt;Modifying the Change method&lt;br /&gt;Updating the dataset&lt;br /&gt;Chapter 13&lt;br /&gt;Making a dialog box a component&lt;br /&gt;Defining the component interface&lt;br /&gt;Creating and registering the component&lt;br /&gt;Creating the component interface&lt;br /&gt;Including the form unit&lt;br /&gt;Adding interface properties&lt;br /&gt;Adding the Execute method&lt;br /&gt;Testing the component&lt;br /&gt;Chapter 14&lt;br /&gt;Extending the IDE&lt;br /&gt;Overview of the Tools API&lt;br /&gt;Writing a wizard class&lt;br /&gt;Implementing the wizard interfaces&lt;br /&gt;Installing the wizard package&lt;br /&gt;Obtaining Tools API services&lt;br /&gt;Using native IDE objects&lt;br /&gt;Using the INTAServices interface&lt;br /&gt;Adding an image to the image list&lt;br /&gt;Adding an action to the action list&lt;br /&gt;Deleting toolbar buttons&lt;br /&gt;Debugging a wizard&lt;br /&gt;Interface version numbers&lt;br /&gt;Working with files and editors&lt;br /&gt;Using module interfaces&lt;br /&gt;Using editor interfaces&lt;br /&gt;Creating forms and projects&lt;br /&gt;Creating modules&lt;br /&gt;Notifying a wizard of IDE events&lt;br /&gt;Index&lt;br /&gt;Tables&lt;br /&gt;Component creation starting points&lt;br /&gt;Levels of visibility within an object&lt;br /&gt;How properties appear in the Object Inspector&lt;br /&gt;Canvas capability summary&lt;br /&gt;Image-copying methods&lt;br /&gt;TWidgetControl protected methods for responding to system notifications&lt;br /&gt;TWidgetControl protected methods for responding to events from controls&lt;br /&gt;Predefined property-editor types&lt;br /&gt;Methods for reading and writing property values&lt;br /&gt;Property-editor attribute flags&lt;br /&gt;Property categories&lt;br /&gt;The four kinds of wizards&lt;br /&gt;Tools API service interfaces&lt;br /&gt;Notifier interfaces&lt;br /&gt;Figures&lt;br /&gt;Visual Component Library class hierarchy&lt;br /&gt;Component wizard&lt;br /&gt;Signal routing&lt;br /&gt;System event routing&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.tutorialspdf.com/download/download.php?manual=Borland%20Delphi%207%20Tutorial%20-%20For%20Windows&amp;amp;enlace=http://rapidshare.com/files/182474569/delphi-7-tutorial.rar" class="cursor" target="_blank" rel="nofollow" onclick="window.open(this.href, this.target, 'width=560,height=260'); return false;"&gt;&lt;img src="http://www.tutorialspdf.com/img/dowload.gif" border="0" width="160" height="22" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1030596328209703715-6773503453792217715?l=delphizine.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://delphizine.blogspot.com/feeds/6773503453792217715/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://delphizine.blogspot.com/2009/07/borland-delphi-7-tutorial-for-windows.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/6773503453792217715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/6773503453792217715'/><link rel='alternate' type='text/html' href='http://delphizine.blogspot.com/2009/07/borland-delphi-7-tutorial-for-windows.html' title='BORLAND DELPHI 7 TUTORIAL - FOR WINDOWS - TUTORIAL GUIDE HELP FREE'/><author><name>Aisyah Runi</name><uri>http://www.blogger.com/profile/09754809777891988684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp3.blogger.com/_iNFxbPL4FYE/R_dMDxJPHQI/AAAAAAAAAAM/L8A99OeHoPU/S220/runi001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1030596328209703715.post-2559739847379219140</id><published>2009-07-22T22:53:00.000-07:00</published><updated>2009-07-22T22:56:40.108-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tutorial'/><title type='text'>Using Delphi's Excel components</title><content type='html'>&lt;i&gt;&lt;b&gt;Using Delphi's Excel components&lt;/b&gt;&lt;/i&gt; &lt;p&gt;The new Delphi 5 components make starting Excel very simple. Drop an ExcelApplication component on your form. If the AutoConnect property is true, Excel will start automatically when your program starts; if it's false, just call&lt;/p&gt; &lt;pre&gt;  ExcelApplication1.Connect;&lt;br /&gt;&lt;/pre&gt;  &lt;p&gt;when you want to start Excel. To use a running instance of Excel, if there is one, set the ConnectKind property of TExcelApplication to&lt;b&gt; ckRunningOrNew&lt;/b&gt;, or to &lt;b&gt;ckRunningInstance&lt;/b&gt; if you don't want to start a new instance if Excel isn't running.&lt;/p&gt; &lt;p&gt; Once Excel has started, you can connect other components, such as TExcelWorkbook, using their ConnectTo methods:&lt;/p&gt; &lt;pre&gt;  ExcelWorkbook1.ConnectTo(ExcelApplication1.ActiveWorkbook);&lt;br /&gt; ExcelWorksheet1.ConnectTo(ExcelApplication1.ActiveSheet as _Worksheet);&lt;br /&gt; ExcelWorksheet2.ConnectTo(ExcelApplication1.Worksheets.Item['Sheet2'] as _Worksheet);&lt;br /&gt;&lt;/pre&gt; Note that a workbook or worksheet must be open before you can connect to it! See &lt;a href="http://www.djpate.freeserve.co.uk/AutoExcl.htm#OpenWorkbook"&gt;How to open a workbook&lt;/a&gt; or &lt;a href="http://www.djpate.freeserve.co.uk/AutoExcl.htm#CreateWorkbook"&gt;How to create a workbook&lt;/a&gt; for code to do this.  &lt;p&gt;I advise you not to try to start Excel using any component except the application component, however. At least on some setups, calling the Connect method (NB not the ConnectTo method!) of a Workbook or Worksheet component will cause an exception. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1030596328209703715-2559739847379219140?l=delphizine.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://delphizine.blogspot.com/feeds/2559739847379219140/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://delphizine.blogspot.com/2009/07/using-delphis-excel-components.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/2559739847379219140'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/2559739847379219140'/><link rel='alternate' type='text/html' href='http://delphizine.blogspot.com/2009/07/using-delphis-excel-components.html' title='Using Delphi&apos;s Excel components'/><author><name>Aisyah Runi</name><uri>http://www.blogger.com/profile/09754809777891988684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp3.blogger.com/_iNFxbPL4FYE/R_dMDxJPHQI/AAAAAAAAAAM/L8A99OeHoPU/S220/runi001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1030596328209703715.post-5366571016572093019</id><published>2009-02-15T04:29:00.000-08:00</published><updated>2009-02-15T04:29:01.821-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='anyDAC'/><category scheme='http://www.blogger.com/atom/ns#' term='DML'/><title type='text'>AnyDAC. Very High Performance using the Array DML</title><content type='html'>&lt;p&gt;AnyDAC encapsulates all database server specific implementation of the Array DML commands and lets you use identical code for all server types. Obviously, the resulting performance will differ based on the server implementation; especially Oracle, MS SQL Server and IBM DB2 have very powerful support of the Array DML and the resulting performance increase is just amazing. &lt;/p&gt;&lt;p&gt;Please use the sample code to get a feeling for the potential performance increase within your application and network.&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 15pt;"&gt;&lt;b&gt;Introduction&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;This tutorial has three main sections:&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt; How to prepare your test environment.&lt;/li&gt;&lt;li&gt; The main elements of the Array DML commands.&lt;/li&gt;&lt;li&gt; The typical results of the Array DML test run.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-size: 15pt;"&gt;&lt;b&gt;Prepare your Test Environment&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;The following example works with the AnyDAC sample database environment. For further details about the installation of this database look into &lt;a href="http://wiki.remobjects.com/wiki/AnyDAC_Demo_Databases"&gt;AnyDAC Demo Databases&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;You find the demo projects in your sample directory:&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt; This tutorial code - &lt;anydac&gt;\Samples\Comp Layer\TADQuery\ExecSQL\AD03-ArrayDML or &lt;a href="http://wiki.remobjects.com/files/AD03_ArrayDML.zip"&gt;directly from article&lt;/a&gt;&lt;/li&gt;&lt;li&gt; A basic example code - &lt;anydac&gt;\Samples\Comp Layer\TADQuery\ExecSQL\Batch.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-size: 15pt;"&gt;&lt;b&gt;How does the Array DML command work?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;Imagine a "use case" where you have to INSERT, UPDATE, DELETE or run any other parametrized command N times, typically one command per single record. This means, that each set of input parameters requests to execute a SQL command and is transferred separately between the client and the server. This leads to a heavy load on the network, client and server.&lt;/p&gt;&lt;p&gt;Array DML allows you to transport not only one, but N-sets of data within one transfer. Have a look at the following example:&lt;br /&gt;&lt;/p&gt;&lt;pre class="delphi"&gt;&lt;br /&gt;ADQuery1.&lt;span class="me1"&gt;SQL&lt;/span&gt;.&lt;span class="kw4"&gt;Text&lt;/span&gt;:= &lt;span class="st0"&gt;'insert into ADQA_Batch_test (tint, tstring) values(:f1, :f2)'&lt;/span&gt;;&lt;/pre&gt;&lt;p&gt;You can speed up your code dramatically by using Array DML commands. Such commands transfer not only one, but N sets of parameters.&lt;br /&gt;&lt;/p&gt;&lt;pre class="delphi"&gt;&lt;br /&gt;ADQuery1.&lt;span class="me1"&gt;Params&lt;/span&gt;.&lt;span class="me1"&gt;ArraySize&lt;/span&gt; := &lt;span class="nu0"&gt;100&lt;/span&gt;;&lt;br /&gt;...&lt;br /&gt;&lt;span class="kw1"&gt;for&lt;/span&gt; i := &lt;span class="nu0"&gt;0&lt;/span&gt; &lt;span class="kw1"&gt;to&lt;/span&gt; ADQuery1.&lt;span class="me1"&gt;Params&lt;/span&gt;.&lt;span class="me1"&gt;ArraySize&lt;/span&gt; &lt;span class="kw1"&gt;do&lt;/span&gt; &lt;span class="kw1"&gt;begin&lt;/span&gt;&lt;br /&gt; ADQuery1.&lt;span class="me1"&gt;Params&lt;/span&gt;&lt;span class="br0"&gt;[&lt;/span&gt;&lt;span class="nu0"&gt;0&lt;/span&gt;&lt;span class="br0"&gt;]&lt;/span&gt;.&lt;span class="me1"&gt;AsIntegers&lt;/span&gt;&lt;span class="br0"&gt;[&lt;/span&gt;i&lt;span class="br0"&gt;]&lt;/span&gt; := i;&lt;br /&gt; ADQuery1.&lt;span class="me1"&gt;Params&lt;/span&gt;&lt;span class="br0"&gt;[&lt;/span&gt;&lt;span class="nu0"&gt;1&lt;/span&gt;&lt;span class="br0"&gt;]&lt;/span&gt;.&lt;span class="me1"&gt;AsStrings&lt;/span&gt;&lt;span class="br0"&gt;[&lt;/span&gt;i&lt;span class="br0"&gt;]&lt;/span&gt; := &lt;span class="st0"&gt;'Test'&lt;/span&gt; + &lt;span class="kw3"&gt;IntToStr&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt;i&lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;&lt;span class="kw1"&gt;end&lt;/span&gt;;&lt;br /&gt;ADQuery1.&lt;span class="me1"&gt;Execute&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt;ADQuery1.&lt;span class="me1"&gt;Params&lt;/span&gt;.&lt;span class="me1"&gt;ArraySize&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;;&lt;/pre&gt;&lt;p&gt;This means the Params property of the query is no more a one- but a two-dimensional array, that allows you to store N sets of parameter values before sending them to the server.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;br /&gt;Usage Hints:&lt;br /&gt;&lt;ul&gt;&lt;li&gt; Can be used for any SQL command that uses parameters (INSERT, UPDATE, DELETE ...).&lt;/li&gt;&lt;li&gt; The error handling is supported on record level and described in a separate article.&lt;/li&gt;&lt;li&gt; AnyDAC unifies the Array DML for different server types (no need for you do dig into the API).&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-size: 15pt;"&gt;&lt;b&gt;Typical Results of the Array DML Test Run&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;The attached test code allows you to experiment within your specific environment. &lt;/p&gt;&lt;p&gt;&lt;img src="http://1.1.1.4/bmi/www.delphipages.com/images/articles/AD03_Example_Pict1.jpg" /&gt;&lt;/p&gt;&lt;p&gt;Results of the test example can differ a lot depending on host and network performance. A typical picture of a local Oracle on a rather old laptop will still show &gt; 100'000 records per second as you can see in this screen shot:&lt;/p&gt;&lt;p&gt;&lt;img src="http://1.1.1.2/bmi/www.delphipages.com/images/articles/AD03_ResultLog.jpg" /&gt;&lt;/p&gt;&lt;p&gt;A larger Array DML ArraySize results in a higher performance (in our case up to a factor of 2000). We expect that the performance boost in your own environment will surprise you as well.&lt;/p&gt;&lt;p&gt;&lt;img src="http://1.1.1.1/bmi/www.delphipages.com/images/articles/AD03_Results.jpg" /&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;br /&gt;Performance Hints: Array DML command performance is influenced by:&lt;br /&gt;&lt;ul&gt;&lt;li&gt; The fact that they are a lot faster on slow networks as these commands create less TCP/IP packages.&lt;/li&gt;&lt;li&gt; They reduce the CPU load on the client side, as most of the time the server has to work on the array command.&lt;/li&gt;&lt;li&gt; The theoretical speed of &gt; 100'000 rec/sec is not often reached as the server normally has to evaluate triggers and indexes.&lt;/li&gt;&lt;li&gt; For real large batch inserts (e.g. &gt; 1'000'000 records), you should consider to drop and recreate non primary key indexes to reach a maximum performance.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/blockquote&gt;           &lt;span style="font-family:Arial,Helvetica;font-size:85%;"&gt;Written by &lt;a href="http://www.delphipages.com/email.cfm?ID=31578&amp;amp;F=N" target="_top"&gt;&lt;span style="font-family:Arial,Helvetica;font-size:85%;"&gt; Dmitry Arefiev&lt;/span&gt;&lt;/a&gt; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1030596328209703715-5366571016572093019?l=delphizine.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://delphizine.blogspot.com/feeds/5366571016572093019/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://delphizine.blogspot.com/2009/02/anydac-very-high-performance-using.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/5366571016572093019'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/5366571016572093019'/><link rel='alternate' type='text/html' href='http://delphizine.blogspot.com/2009/02/anydac-very-high-performance-using.html' title='AnyDAC. Very High Performance using the Array DML'/><author><name>Aisyah Runi</name><uri>http://www.blogger.com/profile/09754809777891988684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp3.blogger.com/_iNFxbPL4FYE/R_dMDxJPHQI/AAAAAAAAAAM/L8A99OeHoPU/S220/runi001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1030596328209703715.post-5468805692604624147</id><published>2009-02-11T04:32:00.001-08:00</published><updated>2009-02-11T04:36:03.024-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='report'/><title type='text'>Fast Report. Grouping</title><content type='html'>&lt;p&gt;In continuation of the topic on practical use of Fast Report components in complex programmes for billing, I will show you several practical examples of using grouping. For these examples I will use the payroll described in the first article 'First step in inheritance'. Reminding that a simplified form of the table has this appearance:&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt; Synthetic key (PK)&lt;/li&gt;&lt;li&gt; Pay period&lt;/li&gt;&lt;li&gt; Payer’s code&lt;/li&gt;&lt;li&gt; Payer’s name&lt;/li&gt;&lt;li&gt; Kind of payment (FK)&lt;/li&gt;&lt;li&gt; Payment’s documents (FK)&lt;/li&gt;&lt;li&gt; Date of payments&lt;/li&gt;&lt;li&gt; Total payment&lt;/li&gt;&lt;li&gt; Type of service (FK)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Among other things, report clients want to have a list of payments for a period, for which, the user can have the possibility to order grouping in form of payment, in form of payer’s document, in form of payments and documents, and finally, totally without grouping (in actual fact, a lot of parameters are needed for ordering, but describing the technical work of other parameters is not important). Titles and columns for all the four reports are the same, therefore, we will need one report template with two groups. Together with these groups we will be determining the table’s features.&lt;br /&gt;For creating the report 'Payers list' click menu File+New…, we move to the tab  'Template' and choose basic report BaseReport (its creation has been described in the first article) and we click the flag 'Inherit the report'. In the received report, there is already one inherited group — it will be grouped in form of payments. We again add one more group of payer’s documents. The second group will be immediately by default put inside the first. When needed, the groups can change places; drag the second group with a mouse above the first, but for our report there is no need to do this.&lt;br /&gt;Further, according to documentation (UserManual-ru, chap 3.1) compulsory requirement for a report with grouping is SQL inquiry with sorting of grouped fields.&lt;br /&gt;A ready report has the following appearance:&lt;br /&gt;&lt;img src="http://1.1.1.1/bmi/www.delphipages.com/images/articles/a2_rep1.jpg" /&gt;&lt;br /&gt;On the order form report there are two flags 'Grouping in form of payments', 'Grouping in form of payer’s document' which work independent of each other.&lt;br /&gt;&lt;img src="http://1.1.1.1/bmi/www.delphipages.com/images/articles/a2_form.jpg" /&gt;&lt;br /&gt;Activation/deactivation of visibility of the group header and group footer is done with the help of the property Visible. With the method FMainReport.FindObject we will find a pointer to the title of the group and set its property Visible in accordance with the flags on the order form .We do the same as well with group basement. Then we change the line ORDER BY in SQL text. If the user had set the flag 'Kind of payment' only, then sorting must start with the field 'Form of payment' , If set only 'Payer’s document', then with the field 'Payer’s document', but if set both flags - then sorting is needed on both fields.&lt;br /&gt;When working with inserted groups, there can arise need to exclude field from the SQL query (for example, when using GROUP BY), on which one of the groupings in the report is done. For example, the client can be interested in the overall sum of every subscriber in form of payment. Then there is need to group on the dates of payment by the subscriber, so that we can get one line if the subscriber has more than one payment in a day.&lt;br /&gt;In this case, to activate grouping, it’s not enough to just assign False the property Visible. If such a report is run, then we will get a mistake:&lt;br /&gt;&lt;img src="http://1.1.1.3/bmi/www.delphipages.com/images/articles/a2_error.jpg" /&gt;&lt;br /&gt;Setting the property Visible:= False does not change the execution of the expression described in the property Condition, but there is a call to a non-existent field in the SQL query. The mistake can be corrected if the property Condition is assigned the value of any constant, for example 1.&lt;br /&gt;For increasing the usability of the report we use one more feature of Fast Report — Dynamic groups.&lt;br /&gt;Our client has already valued the comfort ability of such an interactive report, that is, when the group opens/closes by clicking the mouse on the group title in the preview window.&lt;br /&gt;The main problem when using dynamic group arises during calculation of each group’s sum. I has used several variants of calculating sum:&lt;br /&gt;&lt;ol type="1"&gt;&lt;li&gt; The easiest variant. Nothing changes either in the header or in the footer of the dynamic group. In this case, when turning, the header and the footer will be seen. I practically don’t use this variant, because the clearness of such a report is low, in my opinion. &lt;img src="http://1.1.1.2/bmi/www.delphipages.com/images/articles/a2_rep2.jpg" /&gt;&lt;/li&gt;&lt;li&gt; The most accurate variant. Sum of a group is printed in the title of the group. In this case if no additional action is taken, and then when running the report, the sum will be equal to zero. There are two exits — create special SQL query for calculating the sum or execute the report in two passes, that is setting the property frxMainReport.ExgineOptions.DoublePass:= True. In any case, for this variant you need to change the report template. Remove group footer, that is (Visible:= False), and place sum in the group title .Am always faced with the fact that users are not always comfortable with seeing the sum in front of the group. That’s where the third variant appears.&lt;/li&gt;&lt;li&gt; Not very beautiful variant, but, strangely, it’s the one used most by the end users. When close the group, you need to hide the label 'Total per group' in the footer.&lt;pre class="delphi"&gt;&lt;br /&gt;&lt;span class="kw1"&gt;procedure&lt;/span&gt; grMainFooterOnBeforePrint&lt;span class="br0"&gt;(&lt;/span&gt;Sender: TfrxComponent&lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;&lt;span class="kw1"&gt;begin&lt;/span&gt;&lt;br /&gt; &lt;span class="kw1"&gt;if&lt;/span&gt; mdMainDetail.&lt;span class="me1"&gt;Visible&lt;/span&gt; &lt;span class="kw1"&gt;then&lt;/span&gt;&lt;br /&gt;   Memo16.&lt;span class="kw4"&gt;Text&lt;/span&gt;:= &lt;span class="st0"&gt;'Total '&lt;/span&gt;+ &lt; class="st0"&gt;'NAME_FULL'&lt;/span&gt;&gt;&lt;br /&gt; &lt;span class="kw1"&gt;else&lt;/span&gt;&lt;br /&gt;   Memo16.&lt;span class="kw4"&gt;Text&lt;/span&gt; := &lt;span class="st0"&gt;''&lt;/span&gt;;&lt;br /&gt;&lt;span class="kw1"&gt;end&lt;/span&gt;;&lt;/pre&gt; This type of report will have the following appearance (when close the groups):&lt;img src="http://1.1.1.3/bmi/www.delphipages.com/images/articles/a2_rep3.jpg" /&gt;In this variant the problem of sum per group arises. If the sum is considered in any ordinary way, SUM (&lt;frxmaindbdataset.'pl_sum'&gt;), then, when running the value will be equal to 0. In order to calculate the sum in a closed group, we need to write the following SUM (&lt;frxmaindbdataset.'pl_sum'&gt;, mdMainDetail, 1), where 1 – considering invisible mdMainDetail.&lt;/li&gt;&lt;li&gt; The most difficult variant. This combination 2 and 3, that is, when opening the group the sum will be shown in footer and hidden in the header, but when closing the group, footer completely hides and sum is shown in the header. In my practical, it is always enough to use the third variant.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;I think, using group is very comfortable and flexible, because the number of nested levels is not limited. This facility allows building several like reports with help of simple controlling of group using one template.&lt;br /&gt;          &lt;span style="font-family:Arial,Helvetica;font-size:85%;"&gt;Written by &lt;a href="http://www.delphipages.com/email.cfm?ID=30116&amp;amp;F=N" target="_top"&gt;&lt;span style="font-family:Arial,Helvetica;font-size:85%;"&gt; Irina Tsybulnikova&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1030596328209703715-5468805692604624147?l=delphizine.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://delphizine.blogspot.com/feeds/5468805692604624147/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://delphizine.blogspot.com/2009/02/fast-report-grouping.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/5468805692604624147'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/5468805692604624147'/><link rel='alternate' type='text/html' href='http://delphizine.blogspot.com/2009/02/fast-report-grouping.html' title='Fast Report. Grouping'/><author><name>Aisyah Runi</name><uri>http://www.blogger.com/profile/09754809777891988684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp3.blogger.com/_iNFxbPL4FYE/R_dMDxJPHQI/AAAAAAAAAAM/L8A99OeHoPU/S220/runi001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1030596328209703715.post-940822221043084093</id><published>2009-02-11T04:05:00.000-08:00</published><updated>2009-02-11T04:07:56.727-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='control'/><category scheme='http://www.blogger.com/atom/ns#' term='how to'/><title type='text'>How to create a non-rectangular control</title><content type='html'>&lt;p&gt;You can create any controls with any shapes....HOW? I'LL tell you...&lt;/p&gt;&lt;p&gt;First of all you should specify the shape ( better to say specify the region)&lt;/p&gt;&lt;p&gt;To do this you can use one of the  region functions, some of them are&lt;br /&gt;ordered bellow.&lt;/p&gt;&lt;p&gt;CreateEllipticRgn&lt;br /&gt;CreateEllipticRgnIndirect&lt;br /&gt;CreatePolygonRgn&lt;br /&gt;CreatePolyPolygonRgn&lt;br /&gt;CreateRectRgn&lt;br /&gt;CreateRectRgnIndirect&lt;br /&gt;CreateRoundRectRgn&lt;br /&gt;....&lt;br /&gt;....&lt;/p&gt;&lt;p&gt;after using one of these functions you have a particular region.&lt;/p&gt;&lt;p&gt;the next step is assigning this region to the control you are working on.&lt;br /&gt;This step is done using "setwindowrgn" function within the Formcreate Event.&lt;/p&gt;&lt;p&gt;This code makes a non-rectangular form for you, you can test it&lt;br /&gt;to see the result:&lt;/p&gt;&lt;p&gt;procedure TForm1.FormCreate(Sender: TObject);&lt;br /&gt;var points : array [1..5] of TPoint;&lt;br /&gt;region : hrgn;&lt;br /&gt;begin&lt;br /&gt;points [1].x:= 10;&lt;br /&gt;points [1].Y:= 10;&lt;br /&gt;points [2].x:= 100;&lt;br /&gt;points [2].y:= 50;&lt;br /&gt;points [3].x:= 50;&lt;br /&gt;points [3].y:= 80;&lt;br /&gt;points [4].x:= 10;&lt;br /&gt;points [4].y:= 200;&lt;br /&gt;points [5].x:= 10;&lt;br /&gt;points [5].Y:= 10;&lt;br /&gt;region := createpolygonrgn(points, 5, 1);&lt;br /&gt;setwindowrgn(form1.handle, region, true);&lt;br /&gt;end;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1030596328209703715-940822221043084093?l=delphizine.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://delphizine.blogspot.com/feeds/940822221043084093/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://delphizine.blogspot.com/2009/02/how-to-create-non-rectangular-control.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/940822221043084093'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/940822221043084093'/><link rel='alternate' type='text/html' href='http://delphizine.blogspot.com/2009/02/how-to-create-non-rectangular-control.html' title='How to create a non-rectangular control'/><author><name>Aisyah Runi</name><uri>http://www.blogger.com/profile/09754809777891988684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp3.blogger.com/_iNFxbPL4FYE/R_dMDxJPHQI/AAAAAAAAAAM/L8A99OeHoPU/S220/runi001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1030596328209703715.post-3257958597969685822</id><published>2009-02-11T03:23:00.000-08:00</published><updated>2009-02-11T03:37:43.525-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='progress bar'/><category scheme='http://www.blogger.com/atom/ns#' term='Async fetch'/><title type='text'>Menampilkan progress-bar saat fetch data besar</title><content type='html'>beberapa rekan banyak yg menanyakan, ada jg yg nanya via YM...&lt;br /&gt;&lt;br /&gt;iseng2 daku explore event2 milik TADOQuery --&gt; TADOConnection atau CodeGear menyebutnya DBGo pd Delphi2007 (BDS juga kali' ya)...&lt;br /&gt;&lt;br /&gt;utk menampilkan progress-bar, anda bisa memanfaatkan event &lt;span style="font-weight: bold;"&gt;OnFetchProgress&lt;/span&gt; milik TADOQuery...&lt;br /&gt;&lt;br /&gt;[pas:1:be702a67be]&lt;br /&gt;unit Unit1;&lt;br /&gt;&lt;br /&gt;interface&lt;br /&gt;&lt;br /&gt;uses&lt;br /&gt;Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,&lt;br /&gt;Dialogs, DB, ADODB, StdCtrls, ComCtrls;&lt;br /&gt;&lt;br /&gt;type&lt;br /&gt;TForm1 = class(TForm)&lt;br /&gt;ADOConnection1: TADOConnection;&lt;br /&gt;ADOQuery1: TADOQuery;&lt;br /&gt;ProgressBar1: TProgressBar;&lt;br /&gt;Label1: TLabel;&lt;br /&gt;procedure ADOQuery1FetchProgress(DataSet: TCustomADODataSet; Progress,&lt;br /&gt;MaxProgress: Integer; var EventStatus: TEventStatus);&lt;br /&gt;procedure ADOQuery1FetchComplete(DataSet: TCustomADODataSet;&lt;br /&gt;const Error: Error; var EventStatus: TEventStatus);&lt;br /&gt;private&lt;br /&gt;{ Private declarations }&lt;br /&gt;public&lt;br /&gt;{ Public declarations }&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;var&lt;br /&gt;Form1: TForm1;&lt;br /&gt;&lt;br /&gt;implementation&lt;br /&gt;&lt;br /&gt;{$R *.dfm}&lt;br /&gt;&lt;br /&gt;procedure TForm1.ADOQuery1FetchComplete(DataSet: TCustomADODataSet;&lt;br /&gt;const Error: Error; var EventStatus: TEventStatus);&lt;br /&gt;begin&lt;br /&gt;if EventStatus &lt;&gt; esOK then&lt;br /&gt;MessageDlg(Format('Source: %s%sDesc: %s', [Error.Source, #13#10, Error.Description]), mtError, [mbOK], 0);&lt;br /&gt;Close;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;procedure TForm1.ADOQuery1FetchProgress(DataSet: TCustomADODataSet; Progress,&lt;br /&gt;MaxProgress: Integer; var EventStatus: TEventStatus);&lt;br /&gt;begin&lt;br /&gt;if EventStatus = esOK then&lt;br /&gt;begin&lt;br /&gt;ProgressBar1.Max:= MaxProgress;&lt;br /&gt;ProgressBar1.Position:= Progress;&lt;br /&gt;end;&lt;br /&gt;Application.ProcessMessages;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;end.&lt;br /&gt;[/pas:1:be702a67be]&lt;br /&gt;&lt;br /&gt;btw.. bagaimana efek dari penggunaan event onFetchProgress atau sejenis.. apakah ada penurunan performance (performance penalty)? dan seberapa besar?&lt;br /&gt;saya belum mencoba hal ini di ADO, tapi hal serupa juga disediakan oleh komponen middleware yg sedag daku pake, dan terdapat penurunan performance, walaupun tidak besar.&lt;br /&gt;&lt;br /&gt;Tapi saya rasa untuk data besar, jika penalty tersebut cukup kecil, tidak mengapa, karena tujuannya lebih ke 'visual feedback'.&lt;br /&gt;&lt;br /&gt;Kalau saya sih dah tahu sejak lama......&lt;br /&gt;tapi hati2 dalam penggunaan onfetchProgress&lt;br /&gt;setahu saya untuk D7 hanya bisa digunakan pada ADODataset.&lt;br /&gt;Kemudian untuk mendapatkan progress yang bagus, dataset jangan langsung dikoneksikan dengan Grid, lebih baik saat fetching di disconect, setelah fetching selesai baru dikoneksikan lagi datasetnya ke dbgrid.&lt;br /&gt;&lt;br /&gt;Untuk mendapatkan performance yang bagus saat fetching, silahkan anda atur &lt;span style="font-weight: bold;"&gt;executeoptions&lt;/span&gt;-nya agar didapatkan fetching yang smooth&lt;br /&gt;&lt;br /&gt;benar yg dikatakan sodara @EkoIndri...&lt;br /&gt;TDataset telah menyediakan &lt;span style="font-weight: bold;"&gt;DisableControls &amp;amp; EnableControls&lt;/span&gt; utk men-disables data display in data-aware controls associated with the dataset.&lt;br /&gt;tanpa perlu secara fisik men-disconnect dataset ke data-aware (DBGrid, DBEdit dll).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1030596328209703715-3257958597969685822?l=delphizine.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://delphizine.blogspot.com/feeds/3257958597969685822/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://delphizine.blogspot.com/2009/02/menampilkan-progress-bar-saat-fetch.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/3257958597969685822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/3257958597969685822'/><link rel='alternate' type='text/html' href='http://delphizine.blogspot.com/2009/02/menampilkan-progress-bar-saat-fetch.html' title='Menampilkan progress-bar saat fetch data besar'/><author><name>Aisyah Runi</name><uri>http://www.blogger.com/profile/09754809777891988684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp3.blogger.com/_iNFxbPL4FYE/R_dMDxJPHQI/AAAAAAAAAAM/L8A99OeHoPU/S220/runi001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1030596328209703715.post-729339367451136253</id><published>2009-02-11T03:19:00.000-08:00</published><updated>2009-02-11T03:22:34.793-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Async fetch'/><title type='text'>Async fetch of a dataset</title><content type='html'>&lt;pre&gt;I'm actually using TsaBetterADODataSet, and I'm trying to do an asynchrouous&lt;br /&gt;fetch of data using  an Execute option of eoAsyncFetchNonBlocking. I'm using&lt;br /&gt;a CommandType of cmdText.  I'm trying to use the events FetchComplete, and&lt;br /&gt;FetchProgress, but they never get called.  I've also set InitialFetchSize to&lt;br /&gt;0 to&lt;br /&gt;make sure they get called even for a small data set.  I've set breakpoints&lt;br /&gt;in them, and the breakpoints never get called.  This is under Delphi 7.  Any&lt;br /&gt;help would be appreciated.&lt;br /&gt;&lt;br /&gt;-- Larry Maturo&lt;br /&gt;&lt;br /&gt;"Initial Fetch size" needs to be set after the recordset is created but before&lt;br /&gt;it opens.  AdoDataset providess an OnRecordSetCreate method to do that.&lt;br /&gt;--&lt;br /&gt;Brian Bushay&lt;br /&gt;&lt;br /&gt;Okay,  the OnRecordSetCreate event gets triggered, I set the "Initial Fetch&lt;br /&gt;size", and nothing changes.  FetchComplete and FetchProgress still don't get&lt;br /&gt;called. Any other ideas?&lt;br /&gt;&lt;br /&gt;SET ExecuteOptions to EoAsyncFetchNonblocking&lt;br /&gt;No other changes to the default properties&lt;br /&gt;write your OnfetchProgress event to monitor records returned.&lt;br /&gt;That is all there is to it&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-- Larry Maturo&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1030596328209703715-729339367451136253?l=delphizine.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://delphizine.blogspot.com/feeds/729339367451136253/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://delphizine.blogspot.com/2009/02/async-fetch-of-dataset.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/729339367451136253'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/729339367451136253'/><link rel='alternate' type='text/html' href='http://delphizine.blogspot.com/2009/02/async-fetch-of-dataset.html' title='Async fetch of a dataset'/><author><name>Aisyah Runi</name><uri>http://www.blogger.com/profile/09754809777891988684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp3.blogger.com/_iNFxbPL4FYE/R_dMDxJPHQI/AAAAAAAAAAM/L8A99OeHoPU/S220/runi001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1030596328209703715.post-1336142904989137660</id><published>2009-02-11T03:12:00.000-08:00</published><updated>2009-02-11T03:13:31.574-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Barcodes'/><title type='text'>Barcodes and Delphi</title><content type='html'>&lt;p&gt;Barcodes generally consist of a series of alternately black and white bars, of varying width. The pattern is defined by encoding the data the barcode represents, using a set of pre-defined patterns and optionally additional mathematical operations to condense the data or add a check-digit.&lt;/p&gt;&lt;p&gt;The TBits class stores a series of bits, in the smallest possible size of memory. It is an ideal object to store encoded data in one of the many barcode-formats, and use in one of many ways to generate the barcode itself. For example:&lt;br /&gt;- generate a monochrome bitmap,&lt;br /&gt;- generate HTML to display the barcode (attention, generally background-color's don't get printed, use !important or a black border-left for a white span or td)&lt;br /&gt;- generate printer-code to send to the printer directly&lt;br /&gt;...&lt;/p&gt;&lt;p&gt;I've put up source-code that demonstrates this here:&lt;/p&gt;&lt;p&gt;&lt;a href="http://yoy.be/barcode"&gt;http://yoy.be/barcode&lt;/a&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1030596328209703715-1336142904989137660?l=delphizine.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://delphizine.blogspot.com/feeds/1336142904989137660/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://delphizine.blogspot.com/2009/02/barcodes-and-delphi.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/1336142904989137660'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/1336142904989137660'/><link rel='alternate' type='text/html' href='http://delphizine.blogspot.com/2009/02/barcodes-and-delphi.html' title='Barcodes and Delphi'/><author><name>Aisyah Runi</name><uri>http://www.blogger.com/profile/09754809777891988684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp3.blogger.com/_iNFxbPL4FYE/R_dMDxJPHQI/AAAAAAAAAAM/L8A99OeHoPU/S220/runi001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1030596328209703715.post-4599512725118220530</id><published>2009-02-11T02:56:00.000-08:00</published><updated>2009-02-11T02:59:02.806-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='progress bar'/><title type='text'>Opening a Data Set &amp; Showing Progress Bar</title><content type='html'>Hallo&lt;br /&gt;I want to exec querry in asynchronous mode because i want to have a&lt;br /&gt;progressbar.&lt;br /&gt;I have done that things yet:&lt;br /&gt;ExecuteOption - eoAsynchFetch::=true&lt;br /&gt;CacheSize:=16 Mac Records:=64 (-&gt;4 step in progessbar)&lt;br /&gt;But it doesn,t work :(&lt;br /&gt;What I Have to do more ?&lt;br /&gt;Now, procedure OnFetchProgress is executed only one (not for 64/16)&lt;br /&gt;I use ADOQuery.Active:=true&lt;br /&gt;What with the rest of executeOtpions?&lt;br /&gt;When i set eoAsyncExecute on true , appliaction reach the exception&lt;br /&gt;Thanks for any help&lt;br /&gt;&lt;br /&gt;&lt;table align="center" border="0" cellpadding="2" cellspacing="0" width="600"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td colspan="2" bg style="color:#e8e4d0;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;b&gt;&lt;u&gt;Opening a Data Set &amp;amp; Showing Progress Bar&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt;  &lt;td width="18"&gt;&lt;span style="font-size:78%;"&gt;   &lt;/span&gt;&lt;/td&gt;  &lt;td width="558"&gt;        Hi,&lt;br /&gt;How can I show a progress bar and add to it's position amount while I want to open a data set?&lt;br /&gt;I don't want to get the record count at first cause it takes the same time as opening the data set.  &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;table align="center" border="0" cellpadding="2" cellspacing="0" width="600"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td width="18"&gt;&lt;br /&gt;&lt;/td&gt;  &lt;td width="558"&gt;        I've never used it before, but this was taken from the Borland Delphi Help File.&lt;br /&gt;&lt;br /&gt;It's the OnFetchProgress event of a Dataset.&lt;br /&gt;&lt;br /&gt;Occurs periodically during an asynchronous data retrieval operation.&lt;br /&gt;&lt;br /&gt;TFetchProgressEvent = procedure(DataSet: TCustomADODataSet; Progress, MaxProgress: Integer; var EventStatus: TEventStatus) of object;&lt;br /&gt;property OnFetchProgress: TfetchProgressEvent;&lt;br /&gt;&lt;br /&gt;Description&lt;br /&gt;&lt;br /&gt;Write an OnFetchProgress event handler to take specific action during an asynchronous data retrieval operation. The OnFetchProgress event fires periodically during the data retrieval to provide indications of its progress. Create a handler for this event to react to this periodic notification, such as providing the user with a visual indication of the progress of the data retrieval.&lt;br /&gt;&lt;br /&gt;DataSet is the ADO dataset component that triggered the OnFetchProgress event. This dataset component also contains the recordset in question.&lt;br /&gt;&lt;br /&gt;Progress is the number of records that have been received since the data fetching operation began.&lt;br /&gt;&lt;br /&gt;MaxProgress is the total number of records to be retrieved by the operation.&lt;br /&gt;&lt;br /&gt;Progress and MaxProgress used together to get percent complete. For example, Progress divided by MaxProgress and multiplied by 100 yields the percent completion of the data fetching.&lt;br /&gt;&lt;br /&gt;procedure TForm1.ADODataSet1FetchProgress(DataSet: TCustomADODataSet; Progress, MaxProgress: Integer; var EventStatus: TEventStatus);&lt;br /&gt;begin&lt;br /&gt; Caption := 'Percent complete: ' +&lt;br /&gt;   IntToStr(Trunc(Progress / MaxProgress * 100)) + '%';&lt;br /&gt; Application.ProcessMessages;&lt;br /&gt;end;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1030596328209703715-4599512725118220530?l=delphizine.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://delphizine.blogspot.com/feeds/4599512725118220530/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://delphizine.blogspot.com/2009/02/opening-data-set-showing-progress-bar.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/4599512725118220530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/4599512725118220530'/><link rel='alternate' type='text/html' href='http://delphizine.blogspot.com/2009/02/opening-data-set-showing-progress-bar.html' title='Opening a Data Set &amp; Showing Progress Bar'/><author><name>Aisyah Runi</name><uri>http://www.blogger.com/profile/09754809777891988684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp3.blogger.com/_iNFxbPL4FYE/R_dMDxJPHQI/AAAAAAAAAAM/L8A99OeHoPU/S220/runi001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1030596328209703715.post-1349706360964771984</id><published>2008-12-14T19:18:00.000-08:00</published><updated>2008-12-14T19:19:34.905-08:00</updated><title type='text'>Delhi &amp; DotNET</title><content type='html'>&lt;a title="View Delphi &amp;amp;amp; Dotnet document on Scribd" href="http://www.scribd.com/doc/2064563/Delphi-Dotnet" style="margin: 12px auto 6px auto; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; display: block; text-decoration: underline;"&gt;Delphi &amp;amp; Dotnet&lt;/a&gt; &lt;object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" id="doc_501064850945271" name="doc_501064850945271" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" align="middle" height="500" width="100%"&gt;  &lt;param name="movie" value="http://documents.scribd.com/ScribdViewer.swf?document_id=2064563&amp;access_key=key-22qaazhplxvpf12uc5gj&amp;page=1&amp;version=1&amp;viewMode="&gt;   &lt;param name="quality" value="high"&gt;   &lt;param name="play" value="true"&gt;  &lt;param name="loop" value="true"&gt;   &lt;param name="scale" value="showall"&gt;  &lt;param name="wmode" value="opaque"&gt;   &lt;param name="devicefont" value="false"&gt;  &lt;param name="bgcolor" value="#ffffff"&gt;   &lt;param name="menu" value="true"&gt;  &lt;param name="allowFullScreen" value="true"&gt;   &lt;param name="allowScriptAccess" value="always"&gt;   &lt;param name="salign" value=""&gt;      &lt;embed src="http://documents.scribd.com/ScribdViewer.swf?document_id=2064563&amp;access_key=key-22qaazhplxvpf12uc5gj&amp;page=1&amp;version=1&amp;viewMode=" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" play="true" loop="true" scale="showall" wmode="opaque" devicefont="false" bgcolor="#ffffff" name="doc_501064850945271_object" menu="true" allowfullscreen="true" allowscriptaccess="always" salign="" type="application/x-shockwave-flash" align="middle"  height="500" width="100%"&gt;&lt;/embed&gt; &lt;/object&gt; &lt;div style="margin: 6px auto 3px auto; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; display: block;"&gt; &lt;a href="http://www.scribd.com/upload" style="text-decoration: underline;"&gt;Publish at Scribd&lt;/a&gt; or &lt;a href="http://www.scribd.com/browse" style="text-decoration: underline;"&gt;explore&lt;/a&gt; others:    &lt;a href="http://viewer.scribd.com/browse?c=120-web-2-0" style="text-decoration: underline;"&gt;Web 2.0&lt;/a&gt;      &lt;a href="http://viewer.scribd.com/browse?c=114-technology" style="text-decoration: underline;"&gt;Technology&lt;/a&gt;       &lt;a href="http://viewer.scribd.com/tag/.net" style="text-decoration: underline;"&gt;.net&lt;/a&gt;    &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1030596328209703715-1349706360964771984?l=delphizine.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://delphizine.blogspot.com/feeds/1349706360964771984/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://delphizine.blogspot.com/2008/12/delhi-dotnet.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/1349706360964771984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/1349706360964771984'/><link rel='alternate' type='text/html' href='http://delphizine.blogspot.com/2008/12/delhi-dotnet.html' title='Delhi &amp; DotNET'/><author><name>Aisyah Runi</name><uri>http://www.blogger.com/profile/09754809777891988684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp3.blogger.com/_iNFxbPL4FYE/R_dMDxJPHQI/AAAAAAAAAAM/L8A99OeHoPU/S220/runi001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1030596328209703715.post-1913434092716354444</id><published>2008-12-14T17:52:00.000-08:00</published><updated>2008-12-14T17:56:00.943-08:00</updated><title type='text'>Pictures inside a database Seeking the start of Jpeg in the BLOB</title><content type='html'>&lt;span style="font-family:verdana, geneva, helvetica;font-size:85%;"&gt;&lt;b&gt;&lt;span style="color:#000080;"&gt;OLE object type format - take three!&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;All this leaves us with nothing but to store the picture to a disk (as an ordinary binary file) and see what's inside it.&lt;br /&gt;One nice thing with picture files (formats) is that all have some header that uniquely identifies the image. The JPG picture file starts with the, so called, SOI marker that has the value of $FFD8 hex. &lt;/span&gt;&lt;p&gt;&lt;span style="font-family:verdana, geneva, helvetica;font-size:85%;"&gt;This next line of code stores the value of the Picture field to a file (BlobImage.dat) in the working directory. Assign this code in the OnCreate event for the form, start the project and remove the code. &lt;/span&gt;&lt;/p&gt;&lt;table bgcolor="#ffffcc" border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;ADOTable1Picture.SaveToFile('BlobImage.dat');&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;span style="font-family:verdana, geneva, helvetica;font-size:85%;"&gt;Once we have the file, we can use some &lt;a href="http://delphi.about.com/cs/devutilities/index.htm"&gt;Hex editor&lt;/a&gt; to see it's content.  &lt;/span&gt;&lt;/p&gt;&lt;center&gt;&lt;span style="font-family:verdana, geneva, helvetica;font-size:85%;"&gt;&lt;img src="http://delphi.about.com/library/graphics/dbc3_5.gif" alt="Jpeg as OLE object binary file" border="1" width="321" height="250" /&gt;&lt;/span&gt;&lt;/center&gt;  &lt;p&gt;&lt;span style="font-family:verdana, geneva, helvetica;font-size:85%;"&gt;Would you believe this! MS Access stores the path of a linked OLE object as part of the object's definition in the OLE object field. Because the definition of OLE object storage is not documented (!? this is straight from MS) there is no way to know what gets written before the actual image data. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana, geneva, helvetica;font-size:85%;"&gt;Think about this twice. First: we'll need to seek to the 'FFD8' and read the image from there. Second, the 'FFD8' might not always be at the same position in the file. Conclusion: we need a function that returns the position of the SOI marker for the JPG file stored as OLE object in an Access database. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana, geneva, helvetica;font-size:85%;"&gt;  &lt;b&gt;&lt;span style="color:#000080;"&gt;The correct way - take four!&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;Provided with the Blob type field our function should return the position of the 'FFD8' string inside the ADOBlobStream. The ReadBuffer reads byte by byte from the stream. Each call to ReadBuffer moves the position of the stream by one. When two bytes together (as hex values) result in SOI marker the function returns the stream position. This is the function: &lt;/span&gt;&lt;/p&gt;&lt;table style="width: 498px; height: 458px;" bgcolor="#ffffcc" border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;&lt;b&gt;function&lt;/b&gt; JpegStartsInBlob&lt;br /&gt;        (PicField:TBlobField):integer;&lt;br /&gt;&lt;b&gt;var&lt;/b&gt;&lt;br /&gt;bS     : TADOBlobStream;&lt;br /&gt;buffer : Word;&lt;br /&gt;hx     : &lt;b&gt;string&lt;/b&gt;;&lt;br /&gt;&lt;b&gt;begin&lt;/b&gt;&lt;br /&gt;Result := -1;&lt;br /&gt;bS := TADOBlobStream.Create(PicField, bmRead);&lt;br /&gt;&lt;b&gt;try&lt;/b&gt;&lt;br /&gt; &lt;b&gt;while&lt;/b&gt; (Result = -1) &lt;b&gt;and&lt;/b&gt;&lt;br /&gt;       (bS.Position + 1 &lt;&gt;do&lt;br /&gt;&lt;b&gt; begin&lt;/b&gt;&lt;br /&gt;  bS.ReadBuffer(buffer, 1);&lt;br /&gt;  hx:=IntToHex(buffer, 2);&lt;br /&gt;  &lt;b&gt;if&lt;/b&gt; hx = 'FF' &lt;b&gt;then begin&lt;/b&gt;&lt;br /&gt;    bS.ReadBuffer(buffer, 1);&lt;br /&gt;    hx:=IntToHex(buffer, 2);&lt;br /&gt;    &lt;b&gt;if&lt;/b&gt; hx = 'D8' &lt;b&gt;then&lt;/b&gt; Result := bS.Position - 2&lt;br /&gt;    &lt;b&gt;else&lt;/b&gt; &lt;b&gt;if&lt;/b&gt; hx = 'FF' &lt;b&gt;then&lt;/b&gt;&lt;br /&gt;      bS.Position := bS.Position-1;&lt;br /&gt;  &lt;b&gt;end&lt;/b&gt;; &lt;span style="color:#000080;"&gt;&lt;i&gt;//if&lt;/i&gt;&lt;/span&gt;&lt;br /&gt; &lt;b&gt;end&lt;/b&gt;; &lt;span style="color:#000080;"&gt;&lt;i&gt;//while&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;b&gt;finally&lt;/b&gt;&lt;br /&gt; bS.Free&lt;br /&gt;&lt;b&gt;end&lt;/b&gt;;  &lt;span style="color:#000080;"&gt;&lt;i&gt;//try&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;b&gt;end&lt;/b&gt;;&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;span style="font-family:verdana, geneva, helvetica;font-size:85%;"&gt;Once we have the position of the SOI marker we use it to seek to it in the  ADOBlob stream.  &lt;/span&gt;&lt;/p&gt;&lt;table style="width: 505px; height: 391px;" bgcolor="#ffffcc" border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;&lt;b&gt;uses&lt;/b&gt; jpeg;&lt;br /&gt;...&lt;br /&gt;&lt;b&gt;procedure&lt;/b&gt; TForm1.btnShowImageClick(Sender: TObject);&lt;br /&gt;&lt;b&gt;var&lt;/b&gt;&lt;br /&gt; bS  : TADOBlobStream;&lt;br /&gt; Pic : TJpegImage;&lt;br /&gt;&lt;b&gt;begin&lt;/b&gt;&lt;br /&gt; bS := TADOBlobStream.Create&lt;br /&gt;       (AdoTable1Picture, bmRead);&lt;br /&gt; &lt;b&gt;try&lt;/b&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;    bS.Seek(JpegStartsInBlob(AdoTable1Picture),&lt;br /&gt;           soFromBeginning);&lt;/span&gt;&lt;br /&gt;   Pic:=TJpegImage.Create;&lt;br /&gt;   &lt;b&gt;try&lt;/b&gt;&lt;br /&gt;    Pic.LoadFromStream(bS);&lt;br /&gt;    ADOImage.Picture.Graphic:=Pic;&lt;br /&gt;   &lt;b&gt;finally&lt;/b&gt;&lt;br /&gt;    Pic.Free;&lt;br /&gt;   &lt;b&gt;end&lt;/b&gt;;&lt;br /&gt; &lt;b&gt;finally&lt;/b&gt;&lt;br /&gt;   bS.Free&lt;br /&gt; &lt;b&gt;end&lt;/b&gt;;&lt;br /&gt;&lt;b&gt;end&lt;/b&gt;;&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;span style="font-family:verdana, geneva, helvetica;font-size:85%;"&gt;Run the project and voila!  &lt;/span&gt;&lt;/p&gt;&lt;center&gt;&lt;span style="font-family:verdana, geneva, helvetica;font-size:85%;"&gt;&lt;img src="http://delphi.about.com/library/graphics/dbc3_6.gif" alt="JPG image from MS Access with ADO" border="0" width="300" height="350" /&gt;&lt;/span&gt;&lt;/center&gt;  &lt;p&gt;&lt;span style="font-family:verdana, geneva, helvetica;font-size:85%;"&gt;Who can now say that programming isn't FUN?  &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana, geneva, helvetica;font-size:85%;"&gt;Note: in real code application we would have the code to read and display the image from the current row in the &lt;i&gt;AfterScroll&lt;/i&gt; event of a TDataSet (that is in the ADOTable1AfterScroll event procedure). AfterScroll occurs after an application scrolls from one record to another. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana, geneva, helvetica;font-size:85%;"&gt;  &lt;b&gt;&lt;span style="color:#000080;"&gt;Take five!&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;That's it for this chapter. You can now store and display all your favorite JPG pictures. In the last page of this article I have provided you with the entire code (form1's unit); all the data assignment is placed in the OnCreate event of the form. This ensures that all three components are correctly linked - you don't need to use the Object Inspector at design-time.&lt;br /&gt;I agree, the chapter was not designed for beginners, but hey the World is cruel. Another thing: did you mentioned that at the end you don't know how to change (or add some new) picture in a table! We'll, that's whole another story! &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana, geneva, helvetica;font-size:85%;"&gt;Hm, ok I give up! Take a look at the code ... see the "SaveJpegToTable" procedure? This one does the job of placing a picture inside a database.&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1030596328209703715-1913434092716354444?l=delphizine.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://delphizine.blogspot.com/feeds/1913434092716354444/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://delphizine.blogspot.com/2008/12/pictures-inside-database-seeking-start.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/1913434092716354444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/1913434092716354444'/><link rel='alternate' type='text/html' href='http://delphizine.blogspot.com/2008/12/pictures-inside-database-seeking-start.html' title='Pictures inside a database Seeking the start of Jpeg in the BLOB'/><author><name>Aisyah Runi</name><uri>http://www.blogger.com/profile/09754809777891988684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp3.blogger.com/_iNFxbPL4FYE/R_dMDxJPHQI/AAAAAAAAAAM/L8A99OeHoPU/S220/runi001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1030596328209703715.post-7747971125857234431</id><published>2008-12-14T17:47:00.000-08:00</published><updated>2008-12-14T17:48:32.734-08:00</updated><title type='text'>Pictures inside a database Pulling the Jpeg with DBImage - the wrong way</title><content type='html'>&lt;span style="font-family:verdana, geneva, helvetica;font-size:85%;"&gt;&lt;b&gt;&lt;span style="color:#000080;"&gt;The DBImage - take one&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;The first thing I do when trying to do something new with Delphi is to "ask" Delphi Help for help. This is what the Help system replies: TDBImage (Data Controls page on the component palette) represents a graphic image from a BLOB (binary large object) field of the current record of a dataset. Use TDBImage to represent the value of graphic fields. TDBImage allows a form to display graphical data from a dataset. The DBImage is nothing more than a TImage component with some data aware properties. The two most important ones are: &lt;i&gt;DataSource&lt;/i&gt; and &lt;i&gt;Field&lt;/i&gt;. The DataSource property links the image component to a dataset. We have a DataSoure component named DataSource1 on our form that represent a dataset. The Field property indicates the field (in a table) that holds the image. &lt;/span&gt;&lt;p&gt;&lt;span style="font-family:verdana, geneva, helvetica;font-size:85%;"&gt;All clear, put a DBImage on form and leave the DBImage1 name. To actually link a DBImage with a BLOB field in a Table we simply need to do the following assignment (using the Object Inspector): &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana, geneva, helvetica;font-size:85%;"&gt;&lt;span style="color:#808080;"&gt; DBImage1.DataSource = DataSource1&lt;br /&gt;DBImage1.Field = Picture &lt;/span&gt;  &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana, geneva, helvetica;font-size:85%;"&gt;This should do the trick of displaying the JPEG image stored in the Picture field of the Applications table.  &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana, geneva, helvetica;font-size:85%;"&gt;To see whether this assignment will work the only thing we have to do is to set the Active property of the ADOTable1 component to True. We can do this at design time with the Object Inspector. Once you set it you'll get the following: &lt;/span&gt;&lt;/p&gt;&lt;center&gt;&lt;span style="font-family:verdana, geneva, helvetica;font-size:85%;"&gt;&lt;img src="http://delphi.about.com/library/graphics/dbc3_3.gif" alt="Bitmap image not supported" border="0" width="199" height="122" /&gt;&lt;/span&gt;&lt;/center&gt;  &lt;p&gt;&lt;span style="font-family:verdana, geneva, helvetica;font-size:85%;"&gt;Now what? Why does it say "Bitmap image is not valid." We have a JPEG picture not the BMP - is this the problem? Let's go back to the Help. &lt;/span&gt;&lt;/p&gt;&lt;p&gt; &lt;span style="font-family:verdana, geneva, helvetica;font-size:85%;"&gt;After a few clicks through the Help the conclusion is: to get the JPG inside a database we need to use the TJpegImage object. To display the picture we need the simple, non-data aware, version of the Image component. Even more we'll need to use streams to load a picture from a BLOB object. The Help states that we should use TADOBlobStream to access or modify the value of a BLOB or memo field in an ADO dataset. &lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1030596328209703715-7747971125857234431?l=delphizine.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://delphizine.blogspot.com/feeds/7747971125857234431/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://delphizine.blogspot.com/2008/12/pictures-inside-database-pulling-jpeg.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/7747971125857234431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/7747971125857234431'/><link rel='alternate' type='text/html' href='http://delphizine.blogspot.com/2008/12/pictures-inside-database-pulling-jpeg.html' title='Pictures inside a database Pulling the Jpeg with DBImage - the wrong way'/><author><name>Aisyah Runi</name><uri>http://www.blogger.com/profile/09754809777891988684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp3.blogger.com/_iNFxbPL4FYE/R_dMDxJPHQI/AAAAAAAAAAM/L8A99OeHoPU/S220/runi001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1030596328209703715.post-8545535223063656007</id><published>2008-12-14T17:19:00.000-08:00</published><updated>2008-12-14T17:45:00.296-08:00</updated><title type='text'>Pictures inside a database</title><content type='html'>Working with BLOBs. Storing pictures in Access.&lt;br /&gt;These days developing database applications requires more than just operating with textual or numeric data. If you are, for example, developing an Internet/intranet or multimedia based application, frequently there is a need to display pictures along with text from a database.&lt;br /&gt;&lt;br /&gt;In this third chapter of the Delphi database course, we'll see how to pull out and display the graphical data (images) inside an Access database with ADO. Don't be worried with the fact that working with images inside an Access database requires more database programming skills than this course has provided so far. Let's pretend that we know more to get more.&lt;br /&gt;&lt;br /&gt;If you have followed this course from the beginning (specially the second chapter), you know how to connect to a database and display the Applications (from our working aboutdelphi.mdb database) table in a DBGrid. Remember, we used 3 data components: DBGrid, ADOTable and DataSource to get and display the data from the Applications table.&lt;br /&gt;Back in the first chapter when we created our database, the last filed in the Applications table was left blank (after filling our database with some dummy data). The last field has the name Picture and is of the OLE object type.&lt;br /&gt;&lt;br /&gt;If you scroll right to the last column of the DBGrid you'll see something like:&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_iNFxbPL4FYE/SUW0smifMjI/AAAAAAAAABE/nlUq8GkKnHs/s1600-h/dbc3_0.gif"&gt;&lt;img style="cursor: pointer; width: 316px; height: 155px;" src="http://1.bp.blogspot.com/_iNFxbPL4FYE/SUW0smifMjI/AAAAAAAAABE/nlUq8GkKnHs/s320/dbc3_0.gif" alt="" id="BLOGGER_PHOTO_ID_5279824816514216498" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;Blob in DBGrid&lt;br /&gt;&lt;br /&gt;When using MS Access, we can store images (and other large data objects such as sound or video) in a field that has the OLE object type. This type of data is referred to as a Binary Large Object Bitmap (BLOB).&lt;br /&gt;&lt;br /&gt;Naturally when working with images, several types of picture formats are available. The most commonly used include JPEG, GIF and BMP. JPEG format has proven to be widely accepted by Web masters because of the small amount of storage required (in other words JPEGs are smaller than BMPs in bytes).&lt;br /&gt;&lt;br /&gt;Delphi, of course, has means of handling BMP, GIF and JPEG graphic formats. The rest of this article will deal with JPEG file formats.&lt;br /&gt;&lt;br /&gt;Storing pictures in Access&lt;br /&gt;Before going on to discussion about displaying the image inside a table within a Delphi form, we need to add some graphical data to our database.&lt;br /&gt;&lt;br /&gt;Start Access and open the aboutdelphi.mdb database. Open the Applications table (it should have one row of data) and select the Picture field.&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_iNFxbPL4FYE/SUW2AkAVDgI/AAAAAAAAABM/o5VJ0aSdQnA/s1600-h/dbc3_1.gif"&gt;&lt;img style="cursor: pointer; width: 300px; height: 84px;" src="http://3.bp.blogspot.com/_iNFxbPL4FYE/SUW2AkAVDgI/AAAAAAAAABM/o5VJ0aSdQnA/s320/dbc3_1.gif" alt="" id="BLOGGER_PHOTO_ID_5279826258943086082" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;A table in Access&lt;br /&gt;&lt;br /&gt;To add an image do the following:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;1. Select Insert|Object... this will display the Insert Object dialog box.&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_iNFxbPL4FYE/SUW2A8I7KyI/AAAAAAAAABU/ykp5_EuyYaE/s1600-h/dbc3_2.gif"&gt;&lt;img style="cursor: pointer; width: 320px; height: 194px;" src="http://2.bp.blogspot.com/_iNFxbPL4FYE/SUW2A8I7KyI/AAAAAAAAABU/ykp5_EuyYaE/s320/dbc3_2.gif" alt="" id="BLOGGER_PHOTO_ID_5279826265421589282" border="0" /&gt;&lt;/a&gt;MS Access...Insert Object&lt;br /&gt;&lt;br /&gt;2. Click on the Browse button, this pops up the Browse open dialog. Note: you probably have some .jpg files on your computer, so you could use those, or if you have Win 98 and newer, MS Paint will save pictures in this format, as will many other programs. Navigate to a directory where your pictures are stored and select one.&lt;br /&gt;&lt;br /&gt;Note: the text in the Picture field holds the name of an executable used to work with JPEG files on your computer. Of course you don't see the picture in a table grid. To actually see the graphics double click that field. This will load the image within the JPG type associated application.&lt;br /&gt;&lt;br /&gt;Now, when we have a picture inside a database, let's see how to display it inside a Delphi form. We already have a Delphi form with data components on it from the second chapter of this course.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1030596328209703715-8545535223063656007?l=delphizine.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://delphizine.blogspot.com/feeds/8545535223063656007/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://delphizine.blogspot.com/2008/12/pictures-inside-database.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/8545535223063656007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/8545535223063656007'/><link rel='alternate' type='text/html' href='http://delphizine.blogspot.com/2008/12/pictures-inside-database.html' title='Pictures inside a database'/><author><name>Aisyah Runi</name><uri>http://www.blogger.com/profile/09754809777891988684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp3.blogger.com/_iNFxbPL4FYE/R_dMDxJPHQI/AAAAAAAAAAM/L8A99OeHoPU/S220/runi001.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_iNFxbPL4FYE/SUW0smifMjI/AAAAAAAAABE/nlUq8GkKnHs/s72-c/dbc3_0.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1030596328209703715.post-3645700901998206217</id><published>2008-12-14T17:00:00.000-08:00</published><updated>2008-12-14T17:07:06.047-08:00</updated><title type='text'>Countering Delphi Techniques</title><content type='html'>&lt;a title="View Countering Delphi Techniques document on Scribd" href="http://www.scribd.com/doc/7690217/Countering-Delphi-Techniques" style="margin: 12px auto 6px auto; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; display: block; text-decoration: underline;"&gt;Countering Delphi Techniques&lt;/a&gt; &lt;object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" id="doc_659904734191543" name="doc_659904734191543" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" align="middle" height="500" width="100%"&gt;  &lt;param name="movie" value="http://documents.scribd.com/ScribdViewer.swf?document_id=7690217&amp;access_key=key-w49cw97h9w5krwo3p88&amp;page=1&amp;version=1&amp;viewMode="&gt;   &lt;param name="quality" value="high"&gt;   &lt;param name="play" value="true"&gt;  &lt;param name="loop" value="true"&gt;   &lt;param name="scale" value="showall"&gt;  &lt;param name="wmode" value="opaque"&gt;   &lt;param name="devicefont" value="false"&gt;  &lt;param name="bgcolor" value="#ffffff"&gt;   &lt;param name="menu" value="true"&gt;  &lt;param name="allowFullScreen" value="true"&gt;   &lt;param name="allowScriptAccess" value="always"&gt;   &lt;param name="salign" value=""&gt;      &lt;embed src="http://documents.scribd.com/ScribdViewer.swf?document_id=7690217&amp;access_key=key-w49cw97h9w5krwo3p88&amp;page=1&amp;version=1&amp;viewMode=" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" play="true" loop="true" scale="showall" wmode="opaque" devicefont="false" bgcolor="#ffffff" name="doc_659904734191543_object" menu="true" allowfullscreen="true" allowscriptaccess="always" salign="" type="application/x-shockwave-flash" align="middle"  height="500" width="100%"&gt;&lt;/embed&gt; &lt;/object&gt; &lt;div style="margin: 6px auto 3px auto; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; display: block;"&gt; &lt;a href="http://www.scribd.com/upload" style="text-decoration: underline;"&gt;Publish at Scribd&lt;/a&gt; or &lt;a href="http://www.scribd.com/browse" style="text-decoration: underline;"&gt;explore&lt;/a&gt; others:    &lt;a href="http://viewer.scribd.com/browse?c=48-activism" style="text-decoration: underline;"&gt;Activism&lt;/a&gt;      &lt;a href="http://viewer.scribd.com/browse?c=47-politics" style="text-decoration: underline;"&gt;Politics&lt;/a&gt;       &lt;a href="http://viewer.scribd.com/tag/children" style="text-decoration: underline;"&gt;children&lt;/a&gt;      &lt;a href="http://viewer.scribd.com/tag/college" style="text-decoration: underline;"&gt;college&lt;/a&gt;    &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1030596328209703715-3645700901998206217?l=delphizine.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://delphizine.blogspot.com/feeds/3645700901998206217/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://delphizine.blogspot.com/2008/12/countering-delphi-techniques.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/3645700901998206217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/3645700901998206217'/><link rel='alternate' type='text/html' href='http://delphizine.blogspot.com/2008/12/countering-delphi-techniques.html' title='Countering Delphi Techniques'/><author><name>Aisyah Runi</name><uri>http://www.blogger.com/profile/09754809777891988684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp3.blogger.com/_iNFxbPL4FYE/R_dMDxJPHQI/AAAAAAAAAAM/L8A99OeHoPU/S220/runi001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1030596328209703715.post-2090416943220711222</id><published>2008-12-11T04:08:00.000-08:00</published><updated>2009-02-11T04:28:50.856-08:00</updated><title type='text'>Displaying Macromedia Flash .SWF files in your Delphi Application</title><content type='html'>&lt;p&gt;If you have considered using your Macromedia Flash files to help add some flavor to your Delphi applications, but never knew how, this article is for you.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.delphipages.com/images/articles/flashplayer.zip"&gt;Download demo project&lt;/a&gt;&lt;/p&gt;&lt;p&gt;First of all you must find the file titled&lt;/p&gt;&lt;p&gt;"&lt;b&gt;SWFLASH.OCX&lt;/b&gt;" usually in the &lt;i&gt;C:\Windows\System\Macromed\Flash&lt;/i&gt; directory.&lt;/p&gt;&lt;p&gt;You can then in Delphi click on the menu &lt;b&gt;Component --&gt; Import ActiveX Control&lt;/b&gt;.  Choose the SWFlash.OCX file and import it.  Once you install it, you will then have the TShockWaveFlash component to drag onto your form.&lt;/p&gt;&lt;p&gt;&lt;b&gt;PROBLEM:&lt;/b&gt; The important thing to remember is that if deploy your application then they must have this OCX file or it will not run.&lt;/p&gt;&lt;p&gt;&lt;b&gt;SOLUTION:&lt;/b&gt; To keep your program simple and only have 1 file to distribute, I would suggest to create a resource file of the OCX and include in your .EXE.  Extract the file if needed and register it.  I have included some sample code on how to do this.&lt;/p&gt;&lt;p&gt;&lt;b&gt;CREATING RESOURCE FILE:&lt;/b&gt; (Skip this section if you already understand it).  Create a new Text File in Notepad.  Type the following line:&lt;/p&gt;&lt;p&gt;&lt;b&gt;Flash RCDATA "SWFLASH.OCX"&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Make sure the text file is saved as Filename.rc, I saved mine as FlashOCX.rc.  You must also have the .rc file in the same directory as the SWFLASH.OCX file in order for this to work.&lt;/p&gt;&lt;p&gt;Open your command prompt (DOS window) and find the brcc32.exe file in your bin directory wherever you installed Delphi.  Type this and execute it in DOS:&lt;/p&gt;&lt;p&gt;&lt;b&gt;Brcc32 &lt;i&gt;DirofFile&lt;/i&gt;\FlashOCX.rc&lt;/b&gt;&lt;br /&gt;Example: Brcc32 c:\windows\system\flashocx.rc&lt;/p&gt;&lt;p&gt;It should now have created a file titled "FLASHOCX.RES".  You can now include this into your application.&lt;/p&gt;&lt;p&gt;{$R *.RES}&lt;br /&gt;{$R FLASHOCX.RES}&lt;/p&gt;&lt;p&gt;The R Directive tells your program to include that Resource File.&lt;/p&gt;&lt;p&gt;&lt;b&gt;HOW TO EXTRACT AND REGISTER:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;First off we need to check to see if we can play the Flash File or not.  Click on &lt;b&gt;Project --&gt; View Source&lt;/b&gt; (in Delphi 5) and pull up the project source code.  We want to check for the EOleSysError Message when creating the first form.  If we encounter the error, then we know we must register the OCX on that particular machine.&lt;/p&gt;&lt;p&gt;uses &lt;b&gt;comobj&lt;/b&gt;&lt;/p&gt;&lt;p&gt;begin&lt;br /&gt;  Application.Initialize;&lt;br /&gt;  try&lt;br /&gt;    Application.CreateForm(TForm1, Form1);&lt;br /&gt;  except&lt;br /&gt;    On EOleSysError Do&lt;br /&gt;    begin&lt;br /&gt;       &lt;span style="color: navy;"&gt;//Register OCX File because not found.&lt;/span&gt;&lt;br /&gt;    end;&lt;br /&gt;  end;&lt;br /&gt;  Application.Run;&lt;br /&gt;end.&lt;/p&gt;&lt;p&gt;This next bit of source code that I will display will give you what is needed to extract the resource file and place into the Windows System Directory.&lt;/p&gt;&lt;p&gt;&lt;b&gt;uses&lt;/b&gt;&lt;br /&gt;windows, classes, sysutils&lt;/p&gt;&lt;p&gt;&lt;b&gt;var&lt;/b&gt;&lt;br /&gt;  aSystemDirZ : array[0..2047] of Char;&lt;br /&gt;  fSystemDir  : String;&lt;/p&gt;&lt;p&gt;...&lt;/p&gt;&lt;p&gt;GetSystemDirectory ( aSystemDirZ, 2047 );&lt;br /&gt;fSystemDir := aSystemDirZ;&lt;/p&gt;&lt;p&gt;ResStream := TResourceStream.Create(0, 'Flash', RT_RCDATA);&lt;br /&gt;try&lt;br /&gt;    FileStream := TFileStream.Create(fSystemDir+'SWFLASH.OCX', fmCreate);&lt;br /&gt;    try&lt;br /&gt;        FileStream.CopyFrom(ResStream, 0);&lt;br /&gt;    finally&lt;br /&gt;        FileStream.Free;&lt;br /&gt;    end;&lt;br /&gt;finally&lt;br /&gt;    ResStream.Free;&lt;br /&gt;end;&lt;/p&gt;&lt;p&gt;&lt;b&gt;ENTIRE CODE:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;You must still register the OCX file, and I will now display the entire code so you can see how it would all fit together.&lt;/p&gt;&lt;pre class="delphi"&gt;&lt;span class="kw1"&gt;program&lt;/span&gt; FlashPlayer;&lt;br /&gt;&lt;br /&gt;&lt;span class="kw1"&gt;uses&lt;/span&gt;&lt;br /&gt; Forms, Dialogs, comobj, windows, classes, sysutils,&lt;br /&gt; uMain &lt;span class="kw1"&gt;in&lt;/span&gt; &lt;span class="st0"&gt;'uMain.pas'&lt;/span&gt; &lt;span class="coMULTI"&gt;{Form1}&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class="coMULTI"&gt;{$R *.RES}&lt;/span&gt;&lt;br /&gt;&lt;span class="coMULTI"&gt;{$R FLASHOCX.RES}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="kw2"&gt;type&lt;/span&gt;&lt;br /&gt; TRegFunc = &lt;span class="kw1"&gt;function&lt;/span&gt; : HResult; stdcall;&lt;br /&gt;&lt;br /&gt;&lt;span class="kw1"&gt;function&lt;/span&gt; WinExecAndWait32&lt;span class="br0"&gt;(&lt;/span&gt; FileName: &lt;span class="kw4"&gt;String&lt;/span&gt;; Visibility  : &lt;span class="kw4"&gt;Integer&lt;/span&gt; &lt;span class="br0"&gt;)&lt;/span&gt; : &lt;span class="kw4"&gt;Cardinal&lt;/span&gt;;&lt;br /&gt;&lt;span class="kw2"&gt;var&lt;/span&gt; &lt;span color="blue" class="st0"&gt;&lt;/span&gt;&gt;&lt;span class="coMULTI"&gt;{ by Pat Ritchey }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;   zAppName     : &lt;span class="kw1"&gt;array&lt;/span&gt;&lt;span class="br0"&gt;[&lt;/span&gt;&lt;span class="nu0"&gt;0&lt;/span&gt;..&lt;span class="nu0"&gt;512&lt;/span&gt;&lt;span class="br0"&gt;]&lt;/span&gt; &lt;span class="kw1"&gt;of&lt;/span&gt; &lt;span class="kw4"&gt;char&lt;/span&gt;;&lt;br /&gt;   zCurDir      : &lt;span class="kw1"&gt;array&lt;/span&gt;&lt;span class="br0"&gt;[&lt;/span&gt;&lt;span class="nu0"&gt;0&lt;/span&gt;..&lt;span class="nu0"&gt;255&lt;/span&gt;&lt;span class="br0"&gt;]&lt;/span&gt; &lt;span class="kw1"&gt;of&lt;/span&gt; &lt;span class="kw4"&gt;char&lt;/span&gt;;&lt;br /&gt;   WorkDir      : &lt;span class="kw4"&gt;String&lt;/span&gt;;&lt;br /&gt;   StartupInfo  : TStartupInfo;&lt;br /&gt;   ProcessInfo  : TProcessInformation;&lt;br /&gt;&lt;span class="kw1"&gt;begin&lt;/span&gt;&lt;br /&gt;   StrPCopy&lt;span class="br0"&gt;(&lt;/span&gt; zAppName, FileName &lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;   &lt;span class="kw3"&gt;GetDir&lt;/span&gt;  &lt;span class="br0"&gt;(&lt;/span&gt; &lt;span class="nu0"&gt;0&lt;/span&gt;,        WorkDir  &lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;   StrPCopy&lt;span class="br0"&gt;(&lt;/span&gt; zCurDir,  WorkDir  &lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;   &lt;span class="kw3"&gt;FillChar&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt; StartupInfo, &lt;span class="kw3"&gt;Sizeof&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt; StartupInfo &lt;span class="br0"&gt;)&lt;/span&gt;, &lt;span class="re1"&gt;#0&lt;/span&gt; &lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;   StartupInfo.&lt;span class="me1"&gt;cb&lt;/span&gt;          := &lt;span class="kw3"&gt;Sizeof&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt; StartupInfo &lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;   StartupInfo.&lt;span class="me1"&gt;dwFlags&lt;/span&gt;     := STARTF_USESHOWWINDOW;&lt;br /&gt;   StartupInfo.&lt;span class="me1"&gt;wShowWindow&lt;/span&gt; := Visibility;&lt;br /&gt;&lt;br /&gt;   &lt;span class="kw1"&gt;if&lt;/span&gt; &lt;span class="br0"&gt;(&lt;/span&gt; &lt;span class="kw1"&gt;not&lt;/span&gt; CreateProcess&lt;span class="br0"&gt;(&lt;/span&gt; &lt;span class="kw2"&gt;nil&lt;/span&gt;,&lt;br /&gt;                           zAppName, &lt;span class="coMULTI"&gt;{ pointer to command line string }&lt;/span&gt;&lt;br /&gt;                           &lt;span class="kw2"&gt;nil&lt;/span&gt;, &lt;span class="coMULTI"&gt;{ pointer to process security attributes }&lt;/span&gt;&lt;br /&gt;                           &lt;span class="kw2"&gt;nil&lt;/span&gt;, &lt;span class="coMULTI"&gt;{ pointer to thread security attributes }&lt;/span&gt;&lt;br /&gt;                           &lt;span class="kw2"&gt;false&lt;/span&gt;, &lt;span class="coMULTI"&gt;{ handle inheritance flag }&lt;/span&gt;&lt;br /&gt;                           CREATE_NEW_CONSOLE &lt;span class="kw1"&gt;or&lt;/span&gt; &lt;span class="coMULTI"&gt;{ creation flags }&lt;/span&gt;&lt;br /&gt;                           NORMAL_PRIORITY_CLASS,&lt;br /&gt;                           &lt;span class="kw2"&gt;nil&lt;/span&gt;, &lt;span class="coMULTI"&gt;{ pointer to new environment block }&lt;/span&gt;&lt;br /&gt;                           zCurDir, &lt;span class="coMULTI"&gt;{ pointer to current directory name }&lt;/span&gt;&lt;br /&gt;                           StartupInfo, &lt;span class="coMULTI"&gt;{ pointer to STARTUPINFO }&lt;/span&gt;&lt;br /&gt;                           ProcessInfo &lt;span class="br0"&gt;)&lt;/span&gt; &lt;span class="br0"&gt;)&lt;/span&gt; &lt;span class="kw1"&gt;then&lt;/span&gt;&lt;br /&gt;   &lt;span class="kw1"&gt;begin&lt;/span&gt;&lt;br /&gt;       Result := &lt;span class="re0"&gt;$FFFFFFFF&lt;/span&gt;; &lt;span class="coMULTI"&gt;{ pointer to PROCESS_INF }&lt;/span&gt;&lt;br /&gt;       MessageBox&lt;span class="br0"&gt;(&lt;/span&gt; Application.&lt;span class="me1"&gt;Handle&lt;/span&gt;, &lt;span class="kw4"&gt;PChar&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt; SysErrorMessage&lt;span class="br0"&gt;(&lt;/span&gt; &lt;span class="kw3"&gt;GetLastError&lt;/span&gt; &lt;span class="br0"&gt;)&lt;/span&gt; &lt;span class="br0"&gt;)&lt;/span&gt;, &lt;span class="st0"&gt;'Yipes!'&lt;/span&gt;, &lt;span class="nu0"&gt;0&lt;/span&gt; &lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;   &lt;span class="kw1"&gt;end&lt;/span&gt;&lt;br /&gt;   &lt;span class="kw1"&gt;else&lt;/span&gt;&lt;br /&gt;   &lt;span class="kw1"&gt;begin&lt;/span&gt;&lt;br /&gt;       WaitforSingleObject&lt;span class="br0"&gt;(&lt;/span&gt; ProcessInfo.&lt;span class="me1"&gt;hProcess&lt;/span&gt;, INFINITE &lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;       GetExitCodeProcess &lt;span class="br0"&gt;(&lt;/span&gt; ProcessInfo.&lt;span class="me1"&gt;hProcess&lt;/span&gt;, Result   &lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;       CloseHandle        &lt;span class="br0"&gt;(&lt;/span&gt; ProcessInfo.&lt;span class="me1"&gt;hProcess&lt;/span&gt;           &lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;       CloseHandle        &lt;span class="br0"&gt;(&lt;/span&gt; ProcessInfo.&lt;span class="me1"&gt;hThread&lt;/span&gt;            &lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;   &lt;span class="kw1"&gt;end&lt;/span&gt;;&lt;br /&gt;&lt;span class="kw1"&gt;end&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class="kw2"&gt;var&lt;/span&gt;&lt;br /&gt; aSystemDirZ : &lt;span class="kw1"&gt;array&lt;/span&gt;&lt;span class="br0"&gt;[&lt;/span&gt;&lt;span class="nu0"&gt;0&lt;/span&gt;..&lt;span class="nu0"&gt;2047&lt;/span&gt;&lt;span class="br0"&gt;]&lt;/span&gt; &lt;span class="kw1"&gt;of&lt;/span&gt; &lt;span class="kw4"&gt;Char&lt;/span&gt;;&lt;br /&gt; aShortPath  : &lt;span class="kw1"&gt;array&lt;/span&gt;&lt;span class="br0"&gt;[&lt;/span&gt;&lt;span class="nu0"&gt;0&lt;/span&gt;..&lt;span class="nu0"&gt;2047&lt;/span&gt;&lt;span class="br0"&gt;]&lt;/span&gt; &lt;span class="kw1"&gt;of&lt;/span&gt; &lt;span class="kw4"&gt;Char&lt;/span&gt;;&lt;br /&gt; fSystemDir  : &lt;span class="kw4"&gt;String&lt;/span&gt;;&lt;br /&gt; aCommand    : &lt;span class="kw4"&gt;String&lt;/span&gt;;&lt;br /&gt; aHandle     : &lt;span class="kw4"&gt;Cardinal&lt;/span&gt;;&lt;br /&gt; aFunc       : TRegFunc;&lt;br /&gt; ResStream   : TResourceStream;&lt;br /&gt; FileStream  : TFileStream;&lt;br /&gt;&lt;span class="kw1"&gt;begin&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; GetSystemDirectory &lt;span class="br0"&gt;(&lt;/span&gt; aSystemDirZ, &lt;span class="nu0"&gt;2047&lt;/span&gt;      &lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt; fSystemDir := aSystemDirZ;&lt;br /&gt; Application.&lt;span class="me1"&gt;Initialize&lt;/span&gt;;&lt;br /&gt; &lt;span class="kw1"&gt;try&lt;/span&gt;&lt;br /&gt; Application.&lt;span class="me1"&gt;CreateForm&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt;TForm1, Form1&lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt; &lt;span class="kw1"&gt;except&lt;/span&gt;&lt;br /&gt;   &lt;span class="kw1"&gt;On&lt;/span&gt; EOleSysError &lt;span class="kw1"&gt;Do&lt;/span&gt;&lt;br /&gt;   &lt;span class="kw1"&gt;begin&lt;/span&gt;&lt;br /&gt;     ResStream := TResourceStream.&lt;span class="me1"&gt;Create&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="nu0"&gt;0&lt;/span&gt;, &lt;span class="st0"&gt;'Flash'&lt;/span&gt;, RT_RCDATA&lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;       &lt;span class="kw1"&gt;try&lt;/span&gt;&lt;br /&gt;         FileStream := TFileStream.&lt;span class="me1"&gt;Create&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt;fSystemDir+&lt;span class="st0"&gt;'SWFLASH.OCX'&lt;/span&gt;, fmCreate&lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;         &lt;span class="kw1"&gt;try&lt;/span&gt;&lt;br /&gt;           FileStream.&lt;span class="me1"&gt;CopyFrom&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt;ResStream, &lt;span class="nu0"&gt;0&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;         &lt;span class="kw1"&gt;finally&lt;/span&gt;&lt;br /&gt;           FileStream.&lt;span class="me1"&gt;Free&lt;/span&gt;;&lt;br /&gt;         &lt;span class="kw1"&gt;end&lt;/span&gt;;&lt;br /&gt;       &lt;span class="kw1"&gt;finally&lt;/span&gt;&lt;br /&gt;         ResStream.&lt;span class="me1"&gt;Free&lt;/span&gt;;&lt;br /&gt;       &lt;span class="kw1"&gt;end&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;     &lt;span class="kw1"&gt;try&lt;/span&gt;&lt;br /&gt;       &lt;span class="coMULTI"&gt;{Register the OCX File}&lt;/span&gt;&lt;br /&gt;       aHandle := LoadLibrary&lt;span class="br0"&gt;(&lt;/span&gt; &lt;span class="kw4"&gt;PChar&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt; fSystemDir+&lt;span class="st0"&gt;'SWFLASH.OCX'&lt;/span&gt; &lt;span class="br0"&gt;)&lt;/span&gt; &lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;       &lt;span class="kw1"&gt;if&lt;/span&gt; &lt;span class="br0"&gt;(&lt;/span&gt; aHandle &gt;= &lt;span class="nu0"&gt;32&lt;/span&gt; &lt;span class="br0"&gt;)&lt;/span&gt; &lt;span class="kw1"&gt;then&lt;/span&gt;&lt;br /&gt;       &lt;span class="kw1"&gt;begin&lt;/span&gt;&lt;br /&gt;           aFunc := GetProcAddress&lt;span class="br0"&gt;(&lt;/span&gt; aHandle, &lt;span class="st0"&gt;'DllRegisterServer'&lt;/span&gt; &lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;           &lt;span class="kw1"&gt;if&lt;/span&gt; &lt;span class="br0"&gt;(&lt;/span&gt; &lt;span class="kw3"&gt;Assigned&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt; aFunc &lt;span class="br0"&gt;)&lt;/span&gt; = &lt;span class="kw2"&gt;TRUE&lt;/span&gt; &lt;span class="br0"&gt;)&lt;/span&gt; &lt;span class="kw1"&gt;then&lt;/span&gt;&lt;br /&gt;           &lt;span class="kw1"&gt;begin&lt;/span&gt;&lt;br /&gt;               GetShortPathName&lt;span class="br0"&gt;(&lt;/span&gt; &lt;span class="kw4"&gt;PChar&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt; fSystemDir+&lt;span class="st0"&gt;'SWFLASH.OCX'&lt;/span&gt; &lt;span class="br0"&gt;)&lt;/span&gt;, aShortPath, &lt;span class="nu0"&gt;2047&lt;/span&gt; &lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;               aCommand := &lt;span class="kw3"&gt;Format&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt; &lt;span class="st0"&gt;'%s&lt;br /&gt;egsvr32.exe /s %s'&lt;/span&gt;, &lt;span class="br0"&gt;[&lt;/span&gt;fSystemDir, aShortPath&lt;span class="br0"&gt;]&lt;/span&gt; &lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;               WinExecAndWait32&lt;span class="br0"&gt;(&lt;/span&gt; aCommand, SW_HIDE &lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;           &lt;span class="kw1"&gt;end&lt;/span&gt;;&lt;br /&gt;           FreeLibrary&lt;span class="br0"&gt;(&lt;/span&gt; aHandle &lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;       &lt;span class="kw1"&gt;end&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;       &lt;span class="co1"&gt;//Try Creating the Form Again&lt;/span&gt;&lt;br /&gt;       &lt;span class="kw1"&gt;try&lt;/span&gt;&lt;br /&gt;         Application.&lt;span class="me1"&gt;CreateForm&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt;TForm1, Form1&lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;       &lt;span class="kw1"&gt;except&lt;/span&gt;&lt;br /&gt;         &lt;span class="kw3"&gt;ShowMessage&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="st0"&gt;'Unable to find Macromedia Shockwave Flash.'&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;       &lt;span class="kw1"&gt;end&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;     &lt;span class="kw1"&gt;except&lt;/span&gt;&lt;br /&gt;       &lt;span class="kw3"&gt;ShowMessage&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="st0"&gt;'Unable to register Macromedia Shockwave Flash.'&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;     &lt;span class="kw1"&gt;end&lt;/span&gt;;&lt;br /&gt;       &lt;span class="coMULTI"&gt;{End of Registering the OCX File}&lt;/span&gt;&lt;br /&gt;   &lt;span class="kw1"&gt;end&lt;/span&gt;;&lt;br /&gt; &lt;span class="kw1"&gt;end&lt;/span&gt;;&lt;br /&gt; Application.&lt;span class="me1"&gt;Run&lt;/span&gt;;&lt;br /&gt;&lt;span class="kw1"&gt;end&lt;/span&gt;.&lt;/pre&gt;&lt;p&gt;&lt;b&gt;END OF PROJECT SOURCE&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;HOW TO USE ACTIVEX CONTROL:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 15pt;"&gt;Properties&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;b&gt;ReadyState&lt;/b&gt; (get only) - 0=Loading, 1=Uninitialized, 2=Loaded, 3=Interactive, 4=Complete. &lt;/p&gt;&lt;p&gt;&lt;b&gt;TotalFrames&lt;/b&gt; (get only) - Returns the total number of frames in the movie. This is not available until the movie has loaded. Wait for ReadyState = 4. &lt;/p&gt;&lt;p&gt;&lt;b&gt;FrameNum&lt;/b&gt; (get or set) - The currently displayed frame of the movie. Setting this will advance or rewind the movie. &lt;/p&gt;&lt;p&gt;&lt;b&gt;Playing&lt;/b&gt; (get or set) - True if the movie is currently playing, false if it is paused. &lt;/p&gt;&lt;p&gt;&lt;b&gt;Quality&lt;/b&gt; (get or set) - The current rendering quality (0=Low, 1=High, 2=AutoLow, 3=AutoHigh). This is the same as the QUALITY parameter. &lt;/p&gt;&lt;p&gt;&lt;b&gt;ScaleMode&lt;/b&gt; (get or set) - Scale mode (0=ShowAll, 1= NoBorder, 2 = ExactFit). This is the same as the SCALE parameter. &lt;/p&gt;&lt;p&gt;&lt;b&gt;AlignMode&lt;/b&gt; (get or set) - The align mode consists of bit flags. (Left=+1, Right=+2, Top=+4, Bottom=+8). This is the same as the SALIGN parameter. &lt;/p&gt;&lt;p&gt;&lt;b&gt;BackgroundColor&lt;/b&gt; (get or set) - Override the background color of a movie. An integer of the form red*65536+green*256+blue use -1 for the default movie color. &lt;/p&gt;&lt;p&gt;&lt;b&gt;Loop&lt;/b&gt; (get or set) - True if the animation loops, false to play once. Same as the MOVIE parameter. &lt;/p&gt;&lt;p&gt;&lt;b&gt;Movie&lt;/b&gt; (get or set) - The URL source for the Flash Player movie file. Setting this will load a new movie into the control. Same as the MOVIE parameter. &lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 15pt;"&gt;Methods&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;b&gt;Play()&lt;/b&gt; - Start playing the animation. &lt;/p&gt;&lt;p&gt;&lt;b&gt;Stop()&lt;/b&gt; - Stop playing the animation. &lt;/p&gt;&lt;p&gt;&lt;b&gt;Back()&lt;/b&gt; - Go to the previous frame. &lt;/p&gt;&lt;p&gt;&lt;b&gt;Forward()&lt;/b&gt; - Go to the next frame. &lt;/p&gt;&lt;p&gt;&lt;b&gt;Rewind()&lt;/b&gt; - Go to the first frame. &lt;/p&gt;&lt;p&gt;&lt;b&gt;SetZoomRect(int left, int top, int right, int bottom)&lt;/b&gt; - Zoom in on a rectangular area of the movie. Note that the units of the coordinates are in twips (1440 units per inch). To calculate a rectangle in Flash, set the ruler units to Points and multiply the coordinates by 20 to get TWIPS. &lt;/p&gt;&lt;p&gt;&lt;b&gt;Zoom(int percent)&lt;/b&gt; - Zoom the view by a relative scale factor. Zoom(50) will double the size of the objects in the view. Zoom(200) will reduce the size of objects in the view by one half. &lt;/p&gt;&lt;p&gt;&lt;b&gt;Pan(int x, int y, int mode)&lt;/b&gt; - Pan a zoomed in movie. The mode can be: 0 = pixels, 1 = % of window. &lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 15pt;"&gt;Events&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;OnProgress(int percent)&lt;/b&gt; - Generated as the Flash Player movie is downloading. &lt;/p&gt;&lt;p&gt;&lt;b&gt;OnReadyStateChange(int state)&lt;/b&gt; - Generated when the ready state of the control changes. The possible states are 0=Loading, 1=Uninitialized, 2=Loaded, 3=Interactive, 4=Complete. &lt;/p&gt;&lt;p&gt;&lt;b&gt;FSCommand(string command, string args)&lt;/b&gt; - This event is generated when a GetURL action is performed in the movie with a URL and the URL starts with "FSCommand:". The portion of the URL after the : is provided in command and the target is provided in args. This can be used to create a response to a frame or button action in the Shockwave Flash movie. &lt;/p&gt;&lt;p&gt;For further information see the &lt;a href="http://www.macromedia.com/support/flash/"&gt;Macromedia Flash Website&lt;/a&gt;&lt;/p&gt;&lt;p&gt;In order to include your Flash files into your Delphi Application, just type in the directory of the .SWF file, then make "Embed Movie" = True, and it will be included in your file and not look at the Movie parameter any longer. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1030596328209703715-2090416943220711222?l=delphizine.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://delphizine.blogspot.com/feeds/2090416943220711222/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://delphizine.blogspot.com/2008/12/displaying-macromedia-flash-swf-files.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/2090416943220711222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1030596328209703715/posts/default/2090416943220711222'/><link rel='alternate' type='text/html' href='http://delphizine.blogspot.com/2008/12/displaying-macromedia-flash-swf-files.html' title='Displaying Macromedia Flash .SWF files in your Delphi Application'/><author><name>Aisyah Runi</name><uri>http://www.blogger.com/profile/09754809777891988684</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp3.blogger.com/_iNFxbPL4FYE/R_dMDxJPHQI/AAAAAAAAAAM/L8A99OeHoPU/S220/runi001.jpg'/></author><thr:total>0</thr:total></entry></feed>
