分类: C/C++
2008-07-14 14:08:05
private import tango.io.Stdout;
private import dwin.sys.win32.com.Core;
pragma(lib, "dwin.lib");
void main()
{
int hr;
Guid id = { 0x000209ff, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 };
wchar[20] dpid ;
wchar * lpid = dpid.ptr;
IMalloc lpmalloc;
hr = ProgIDFromCLSID ( id, lpid );
for ( int i = 0; i < 20; ++i )
Stdout ( lpid[ i ] );
CoGetMalloc ( 1, lpmalloc);
if ( SUCCEEDED(hr) )
{
lpmalloc.Free( &lpid ); // ProgID
lpmalloc.Release(); // IMalloc
}
CoUninitialize();
}