- Details
- Written by: Stanko Milosev
- Category: Delphi
- Hits: 4478
I will not explain how to create component templates, since all is already described here.
You will need file, in WinXP:
%userprofile%\Application Data\Borland\BDS\5.0\bds.dct
To modify existing template, you do same thing, except when you click on create template, you give it same name.
- Details
- Written by: Stanko Milosev
- Category: Delphi
- Hits: 4332
Yesterday, while I was reinstalling a components, my Delphi 2007 suddennly looked like Delphi 7, with undocked IDE, I don't know what happened, but I was able to change like it is described here, I just clicked Embedded designer check box, restarted Delphi, then again, clickedĂ Embedded designer check box and restarted Delphi, now everything is back to normal.
Update: today this happened again. Since upper link is not working anymore I will write here (for D2009):
Tools->Options->VCL Designer -> Embedded designer
- Details
- Written by: Stanko Milosev
- Category: Delphi
- Hits: 4872
You need to access computer which is not in a domain?
No problem
Here is the code:
var token: Cardinal;
dwResult: DWORD;
nr: TNETRESOURCE;
sl: TStringList;
begin
nr.dwType := RESOURCETYPE_DISK;
nr.lpProvider := nil;
nr.lpLocalName := nil;
nr.lpRemoteName := '\\computername\sharedfolder';
//\\computername\sharedfolder\ will not work - just with ExcludeTrailingPathDelimiter
\\also will not work \\computername\d$\folder\ - we need just \\computername\d$
dwResult := WNetAddConnection2(nr, 'password', 'user', 0); //watchout username and pass are on strange positions, at least for me
if (dwResult = NO_ERROR) or (dwResult = ERROR_ALREADY_ASSIGNED) or (dwResult = ERROR_SESSION_CREDENTIAL_CONFLICT) then
begin
sl := TStringList.Create;
sl.LoadFromFile('\\computername\sharedfolder\file.txt');
ShowMessage(sl.Strings[1]);
FreeAndNil(sl);
end;
end;
Taken from here.
- Details
- Written by: Stanko Milosev
- Category: Delphi
- Hits: 4843
I you receive compiler warning like:
[DCC Warning] uGC88.pas(24): W1010 Method 'Txt2Db' hides virtual method of base type 'TGC88'
Then just use reintroduce keyword.
Like:
TGC88 = class
procedure Txt2Db;virtual;abstract;
end;
type
TGC88Pdf = class(TGC88)
procedure Txt2Db;reintroduce;
end;