yoy.be "Why-o-Why"

2006 ...

januari (6) februari (3) maart april (2) mei (15) juni (7) juli (4) augustus september (1) oktober (3) november (6) december (15)

Delphi: "number" of parties enganged in due diligence

2006-06-01 11:23  i635  delphi  [permalink]

Borland cuts hit overseas ops | The Register

is dat dan goed nieuws? voor Delphi dan? Ik veronderstel toch dat die in de 'Tools department' zitten... (Delphi maar een tool, phah!)

of zoals het hier schitterend omschreven staat:

And the users of Delphi replied, saying: Excellent thinking. We've long been worried that the corporate tool business would damage the reputation of your compilers.

And the Sons of Kahn spake, saying: You don't understand. We're ditching the compilers. And you. Bye.

And the users of Delphi were flabbergasted, saying: Uh?


Create a shortcut from code.

2006-06-08 10:04  i650  delphi  [permalink]

I've worked with the Shell COM interfaces before, and always thought it shouldn't be that hard to create a ShortCut from code, but I never got round to actually trying to do it... Until now, this is what it could look like:

uses ComObj, ActiveX, ShlObj;
 
type
  IPersistFile = interface(IPersist)
    ['{0000010B-0000-0000-C000-000000000046}']
    function IsDirty: HResult; stdcall;
    function Load(pszFileName: PWideChar; dwMode: LongWord): HResult; stdcall;
    function Save(pszFileName: PWideChar; fRemember: Integer): HResult; stdcall;
    function SaveCompleted(pszFileName: PWideChar): HResult; stdcall;
    function GetCurFile(out ppszFileName: PWideChar): HResult; stdcall;
  end;
 
var
  ln:IShellLink;
begin
  ln:=CreateComObject(CLSID_ShellLink) as IShellLink;
  OleCheck(ln.SetDescription(PChar('test')));
  OleCheck(ln.SetPath(PChar('C:\somefolder\somefile.exe')));
  (ln as IPersistFile).Save('test.lnk',0);
end;

Oddly enough, I got the IPersistFile definition from MSDASC_TLB (a TypeLibrary to create/edit database/datasource connections with) and didn't find a default Delphi6 unit that defines it.

IShellLink also provides access to other properties of the ShortCut:


Windows XP: Turn Off AutoPlay

2006-06-09 13:55  i651  computers  [permalink]

pff eindelijk! en ik maar zoeken:

Disable CD autoplay in Windows XP Pro

die 'GPEdit.msc' blijf ik vergeten, zitten nog fun dingen in!


run COM from an NT-Service

2006-06-13 18:47  r455  delphi  [permalink]

run COM from an NT-Service

ho-ho! look what I found here:
http://qc.borland.com/qc/wc/qcmain.aspx?d=4722

run COM from an NT-Service

2006-06-13 20:58  r456  delphi  [permalink]

run COM from an NT-Service

And that appears to be it! Though "Windows 2003 isn't supported in D7, let alone Delphi 6.", all you need to do (at least in Delphi6 this works) is move the "Application.Initialize;" from the dpr to the TService.OnStart event handler. If you don't have one, create one by double clicking the OnStart field in the Object Inspector when viewing the TService datamodule kind of thing.

Odo

2006-06-14 19:38  r457  freeware  [permalink]

Odo

http://blog.zog.org/2006/01/schart-schart.html

Reading 'locked' files with TFileStream fails.

2006-06-15 13:55  i656  delphi  [permalink]

On some files, the system keeps a 'read lock' for the time the file is in use (e.g. an executable that is running). This prevents making changes to the file, but reading is still possible.

Except when using TFileStream.Create('...',fmOpenRead);

Apparently, the fmOpenRead flag, does require full access to the file, even if you won't be writing to the file over the stream...

To let the system know you won't be writing (or you want to allow writing), specify the fmShareDenyWrite (or fmShareDenyNone) flag also: TFileStream.Create('...',fmOpenRead or fmShareDenyNone);.