Board index » delphi » TComObject (IActiveDesktop)

TComObject (IActiveDesktop)

how do i create and use an iactivedesktop class?
i think i have to use a TComObject and the
CreateFromFactory method, but i have no idea how...
Here is the c++ version from msdn:

HRESULT hr;
IActiveDesktop *pActiveDesktop;

hr = CoCreateInstance(CLSID_ActiveDesktop, NULL, CLSCTX_INPROC_SERVER,
            IID_IActiveDesktop, (void**)&pActiveDesktop);

pActiveDesktop->Release();

 

Re:TComObject (IActiveDesktop)


Hello,

You can do the exact same CoCreateInstance call as in C++ or you can do
something like:

uses
  ComObj;
var
  pActiveDesktop : IActiveDesktop;
begin
  pActiveDesktop := CreateComObject (CLSID_ActiveDesktop) as IActiveDesktop;
end;

have fun,

--
Binh Ly
Brickhouse Data Systems, Inc.
http://www.brickhouse.com

Quote
Alex T wrote in message <6rvg2n$i7...@forums.borland.com>...
>how do i create and use an iactivedesktop class?
>i think i have to use a TComObject and the
>CreateFromFactory method, but i have no idea how...
>Here is the c++ version from msdn:

>HRESULT hr;
>IActiveDesktop *pActiveDesktop;

>hr = CoCreateInstance(CLSID_ActiveDesktop, NULL, CLSCTX_INPROC_SERVER,
>            IID_IActiveDesktop, (void**)&pActiveDesktop);

>pActiveDesktop->Release();

Other Threads