Read More......
Name:
Location: tugu, jakarta utara, Indonesia

empty

Monday, 3 October 2011

Install Delphi 7 di Windows Vista

hmmm..pertama2 untuk menginstall delphi di vista aku ingin memaparkan sejarahnya dulu. kebetulan aku menjadi assisten program terstruktur dengan menggunakan delphi sebagai bahasa pemrogramannya.biasanya untuk membuatnya aku menggunakan PC karena PCq menggunakan OS XP 3.sementara notebook saya pakai vista. Kebetulan akhir2 ini ada project buat komunikasi rs232 ke delphi, so aku mencoba untuk install Delphi 8 ke vista.Untuk install Delphi 8 ke Vista maka kita harus menginstall Microsoft NEt Framework dulu. silahkan download di situs punya microsoft milik Bill Gates, setelha itu silahkan install Delphi 8nya. mudah bukan?

namun setelah di install di vista.aku merasa nggak familiar dengan delphi 8 ini. maka aku uninstall program ini dan menginstall delphi 7 saja. kata teman2 ku delphi 7 ntu nggak bisa di vista. maka aku pikir aku downgrade aja pa ya?kalo aku downgrade maka progrtam originalq ilang semua, mulai dari NOD32,IDM,Office,dsb. maka aku putuskan untuk tetap memakai vista dan nekad.LAngkahnya sebagai berikut:
-Klik kanan install.exe dan run as Administrator
-Begitu program jalan cari direktory sesuai selera kita
-hilangkan tanda centang pada cobra/visibroker
-next
-untuk interbase 6.5 nggak usah di install
-dan selesai
-mudah bukan?siap buat tempur visual vs VB
untuk di vista nggak harus Delphi 7 kok…
mau lihat hasil runtestnya?
interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ComCtrls, CWView, DsgnIntf, Menus, dbTables, DB, Commctrl;

type
TFMViewer = class(TForm)
TreeView: TTreeView;
PopupMenu1: TPopupMenu;
Delete1: TMenuItem;
ImageList: TImageList;
Animate: TAnimate;
procedure TreeViewClick(Sender: TObject);
procedure TreeViewChange(Sender: TObject; Node: TTreeNode);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure PopupMenu1Popup(Sender: TObject);
procedure PopupEditClick(Sender: TObject);
procedure Delete1Click(Sender: TObject);
private
{ Private-Deklarationen }
CWViewer: TCWViewer;
Editor : TComponentEditor;
CompList: TStrings;
DemoCount: Integer;
public
{ Public-Deklarationen }
constructor Create(AOwner:TComponent);override;
destructor Destroy;override;
procedure MakeTree(Clear,CWScreen,ISParent: Boolean; Comp: TComponent);
function GetNode(Comp: TComponent): TTreeNode;
function SetComps(CL: TStrings;IL:TImageList;C:TComponent):Integer;
function GetInstance(IL: TImageList;Name: String): THandle ;
end;

var
FMViewer: TFMViewer;
FormDesigner : TFormDesigner;

procedure ViewEdit(Viewer: TCWViewer; Designer: TFormDesigner);

implementation

uses USearch;

{$R *.DFM}

procedure ViewEdit(Viewer: TCWViewer; Designer: TFormDesigner);
begin
if Assigned(Viewer.Editor) then
begin
TFMViewer(Viewer.Editor).bringtoFront;
TFMViewer(Viewer.Editor).MakeTree(True,Viewer.Screen,true,Viewer);
exit;
end;
FMViewer := TFMViewer.create(Application);
FMViewer.CWViewer := Viewer;
Viewer.Editor := TComponent(FMViewer);
FMViewer.Show;
FMViewer.MakeTree(True,Viewer.Screen,true,Viewer);
FormDesigner := Designer;
end;

constructor TFMViewer.Create(AOwner:TComponent);
begin
inherited;
DemoCount:=0;
CompList := TStringList.create;
end;

destructor TFMViewer.Destroy;
begin
TreeView.Visible := false;
CompList.free;
inherited;
end;

function TFMViewer.GetInstance(IL: TImageList;Name: String): THandle;
var
LibModule: PLibModule;

function GetInstRes(Instance: THandle; ResType: TResType;
Name: string; Width: Integer; LoadFlags: TLoadResources; MaskColor: TColor):
THandle;
const
ResMap: array [TResType] of Integer = (IMAGE_BITMAP, IMAGE_CURSOR, IMAGE_ICON);
var
hImage: HImageList;
Flags: Integer;
begin
Flags := 0;
if lrDefaultColor in LoadFlags then Flags := Flags or LR_DEFAULTCOLOR;
if lrDefaultSize in LoadFlags then Flags := Flags or LR_DEFAULTSIZE;
if lrFromFile in LoadFlags then Flags := Flags or LR_LOADFROMFILE;
if lrMap3DColors in LoadFlags then Flags := Flags or LR_LOADMAP3DCOLORS;
if lrTransparent in LoadFlags then Flags := Flags or LR_LOADTRANSPARENT;
if lrMonoChrome in LoadFlags then Flags := Flags or LR_MONOCHROME;
hImage := ImageList_LoadImage(Instance, PChar(Name), Width, IL.AllocBy,
MaskColor, ResMap[ResType], Flags);
if hImage 0 then
begin
Result := Instance;
ImageList_Destroy(hImage);
end
else Result := -1;
end;

begin
Result := GetInstRes(MainInstance, rtBitmap, Name, IL.Width, [], clNone) ;
if Result = -1 then
begin
LibModule := LibModuleList;
while LibModule nil do
with LibModule^ do
begin
Result := GetInstRes(ResInstance, rtBitmap, Name, IL.Width, [], clNone);
if (Result = -1) and (Instance ResInstance) then
Result := GetInstRes(Instance, rtBitmap, Name, IL.Width, [], clNone);
if not(Result = -1) then Exit;
LibModule := LibModule.Next;
end;
end;
end;

function TFMViewer.SetComps(CL: TStrings;IL:TImageList;C:TComponent):Integer;
var Index:Integer;
SName: String;
B:TBitmap;
Inst: THandle;

begin
B:=TBitmap.create;
try
if not assigned(C) then SName := ‘DEFAULT’ else SName := C.Classname;
Index := CL.IndexOf(SName);
If Index = -1 then
begin
B.Handle := LoadBitmap(GetInstance(ImageList,SName),PChar(SName));
if B.Handle 0 then
begin
B.Canvas.StretchDraw(Rect(0,0,ImageList.Width,ImageList.Height),B);
IL.AddMasked(B,B.TransparentColor);
CL.Add(SName);
end;
end;
Result := CL.IndexOf(SName);
if Result = -1 then Result := CL.IndexOf(‘DEFAULT’);
finally
B.free;
end;
end;

procedure TFMViewer.MakeTree(Clear,CWScreen,IsParent: Boolean; Comp: TComponent);
var
I,J,CompIndex: Integer;
Node,TmpNode: TTreeNode;
Dataset: TDataset;
ParentComp: TComponent;
SName: String;

begin

if clear then
begin
if CWViewer.ImageWidth >0 then ImageList.Width := CWViewer.ImageWidth;
if CWViewer.ImageHeight>0 then ImageList.Height := CWViewer.ImageHeight;
ImageList.Clear;
CompList.Clear;
Animate.Active := true;
TreeView.Items.BeginUpdate;
TreeView.Items.clear;
TreeView.Visible := false;
SetComps(CompList,ImageList,Nil);
end;
try

// Screen —————————————————————
if CWScreen then
begin
for I := 0 to Screen.ComponentCount -1 do MakeTree(false,false,false,Screen.Components[I]);
for I := 0 to Screen.CustomFormCount – 1 do MakeTree(false,false,false,Screen.CustomForms[I]);
for I := 0 to Screen.DataModuleCount – 1 do MakeTree(false,false,false,Screen.DataModules[I]);
exit;
end;
ParentComp := Comp;
if IsParent then while ParentComp.Owner Nil do ParentComp := ParentComp.Owner;
begin

if (length(ParentComp.Name) = 0) then
SName := ParentComp.Classname+’-Unknown’
else
SName := ParentComp.Name;

CompIndex := SetComps(CompList,ImageList,ParentComp);

TmpNode := TreeView.Items.AddObject(Nil,SName,ParentComp);
TmpNode.ImageIndex := CompIndex;
TmpNode.SelectedIndex := CompIndex;

for I := 0 to ParentComp.ComponentCount – 1 do
begin
Node := GetNode(ParentComp.Components[I]);
if Assigned(Node) then
begin

if (length(ParentComp.Components[I].Name) = 0) then
SName := ParentComp.Components[I].Classname+’-Unknown’
else
SName := ParentComp.Components[I].Name;

CompIndex := SetComps(CompList,ImageList,ParentComp.Components[I]);

TmpNode := TreeView.Items.AddChildObject(Node,SName,ParentComp.Components[I]);
TmpNode.ImageIndex := CompIndex;
TmpNode.SelectedIndex := CompIndex;

{ if ParentComp.Components[I] is TDataset then
begin
Dataset := TDataset(ParentComp.Components[I]);
for J := 0 to Dataset.FieldCount -1 do
begin
Node := GetNode(Dataset.Fields[J]);
if Assigned(Node) then
begin

if (length(Dataset.Fields[J].Name) = 0) then
SName := Dataset.Fields[J].Classname+’-Unknown’
else
SName := Dataset.Fields[J].Name;

TreeView.Items.AddChildObject(Node,SName,Dataset.Fields[J]);
Node := Nil;
end;
end;
end; }
Node := Nil;
end;
//MakeTree(false,CWScreen,false,ParentComp.Components[I]);
end;
end;
finally
if clear then
begin
TreeView.AlphaSort;
TreeView.Items.EndUpdate;
TreeView.Visible := true;
Animate.Active := false;
end;
end;
end;

function TFMViewer.GetNode(Comp: TComponent): TTreeNode;
var TmpNode: TTreeNode;
CompIndex: Integer;

function GetTmpNode(Node: TTreeNode; Value: String): TTreeNode;
begin
Result := Nil;
if not Assigned(Node) then exit;
if CompareText(Node.Text,Value)=0 then
begin
Result := Node ;
Exit;
end else
if Assigned(Node.GetNextChild(Node)) then
Result := GetTmpNode(Node.GetNextChild(Node),Value) else
Result := GetTmpNode(Node.GetNext,Value);
end;

function GetParentNode(Node: TTreeNode; cComp: TComponent): TTreeNode;
begin
Result := Nil;
if not Assigned(Node) then exit;
if not Assigned(cComp) then exit;
if (Node.Data = cComp.Owner) or ((cComp is TField) and (Node.Data = TField(cComp).Dataset)) then
begin
Result := Node ;
Exit;
end else
if Assigned(Node.GetNextChild(Node)) then
Result := GetParentNode(Node.GetNextChild(Node),cComp) else
Result := GetParentNode(Node.GetNext,cComp);
end;

begin
Result := GetTmpNode(TreeView.Items.GetFirstNode,Comp.ClassName);
if not Assigned(Result) then
begin
Result := GetParentNode(TreeView.Items.GetFirstNode,Comp);
if CWViewer.ShowParentClass then
begin
if not Assigned(Result) then
TmpNode := TreeView.Items.AddChild(TreeView.Items.GetFirstNode,Comp.ClassName) else
TmpNode := TreeView.Items.AddChild(Result,Comp.ClassName) ;

CompIndex := SetComps(CompList,ImageList,Comp);
TmpNode.ImageIndex := CompIndex;
TmpNode.SelectedIndex := CompIndex;

Result := TmpNode;
end;
end;
end;

procedure TFMViewer.TreeViewClick(Sender: TObject);
var Comp: tComponent;
begin
if Assigned(TreeView.Selected) and Assigned(TreeView.Selected.Data)
and Assigned(FormDesigner) then
try
DemoCount := DemoCount +1;
{IfDef Demo}
if DemoCount =4 then begin democount := 0;
ShowMessage(‘Remember this a Trial Version. ‘+#13#10+’Register it from http://www.cordaware.com.’);end;
{end if}
FormDesigner.SelectComponent(TComponent(TreeView.Selected.Data));
except
ShowMessage(‘Component ‘+ TreeView.Selected.Text +’ is not assigned !’);
end;
end;

procedure TFMViewer.TreeViewChange(Sender: TObject; Node: TTreeNode);
begin
if TreeView.Visible then TreeViewClick(Sender);
end;

procedure TFMViewer.FormClose(Sender: TObject; var Action: TCloseAction);
begin
TreeView.Selected := Nil;
if assigned(Formdesigner) then FormDesigner.SelectComponent(CWViewer);
Action := caFree;
CWViewer.Editor := Nil;
end;

procedure TFMViewer.PopupMenu1Popup(Sender: TObject);
var
I: Integer;
NewItem: TMenuItem;
begin
Editor.free;
Editor := Nil;
for I := TPopUpMenu(Sender).Items.Count – 1 downto 1 do TPopupMenu(Sender).Items[I].Free;
if Assigned(TreeView.Selected) and Assigned(TreeView.Selected.Data)
and Assigned(FormDesigner) then
begin
Editor := GetComponentEditor(TComponent(TreeView.Selected.Data),FormDesigner);
if Editor.GetVerbCount > 0 then
begin
// ———————————————————-
NewItem := TMenuItem.Create(self);
NewItem.Caption := ‘-’;
TPopupMenu(Sender).Items.Add(NewItem);
//————————————————————-
end;
for I := 0 to Editor.GetVerbCount – 1 do
begin
NewItem := TMenuItem.Create(self);
NewItem.Caption := Editor.GetVerb(I);
NewItem.Tag := I;
NewItem.onClick := PopupEditClick;
TPopupMenu(Sender).Items.Add(NewItem);
end;
end;
end;

procedure TFMViewer.PopupEditClick(Sender: TObject);
begin
if Assigned(Editor) then Editor.ExecuteVerb(TComponent(Sender).Tag);
end;

procedure TFMViewer.Delete1Click(Sender: TObject);
var Node: TTreeNode;
begin
if Assigned(TreeView.Selected) and Assigned(TreeView.Selected.Data) then
begin
TComponent(TreeView.Selected.Data).free;
TreeView.Selected.DeleteChildren;
Node := TreeView.Selected.Parent;
TreeView.Selected.Delete;
if Assigned(Node) and not(Assigned(Node.Data)) and not(Node.HasChildren) then
Node.Delete;
end;
end;

end.

egistering Borland Developer Studio 2006 / Delphi 7 on Windows Vista

Abstract: Registering Borland Developer Studio 2006 / Delphi 7 on Windows Vista

* Product Name: Borland Delphi 7, Borland Delphi 2005, Borland Developer Studio 2006, Borland C#Builder 2006, Borland C++Builder 2006, Turbo C++, Turbo C#, Turbo Delphi, Turbo Delphi.NET, CodeGear Delphi for PHP
* Product Component: Registration Wizard
* Platform/OS Version: Windows Vista

Description:

This article shows how to register the above products on Windows Vista.

Resolution:

The above products are not officially supported or certified for use on Vista, therefore CodeGear recommends, that customers wait until a certified version of the above products becomes available, however, the following steps can be followed if you need to run the above products on Windows Vista.

In order to register the above products on Windows Vista, execute the following command in an Administrator command prompt window (Ensure the caption of your window matches what you see in the image below, otherwise, it is not an Administrator command prompt even if it is launched from an Administrator account) before registering it:

netsh interface tcp set global autotuninglevel=disabled

Hide image


Click to see full-sized image

After completing the registration wizard successfully, execute the following command:

netsh interface tcp set global autotuninglevel=normal
Author: Chee Wee Chua

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home