| 1 | /* |
| 2 | * $Id: Automation.java,v 1.2 2004/05/25 00:25:46 adamp Exp $ |
| 3 | * |
| 4 | * (c) Copyright, Moebius Solutions, Inc., 2004 |
| 5 | * |
| 6 | * All Rights Reserved |
| 7 | * |
| 8 | * This material may be reproduced by or for the U. S. Government |
| 9 | * pursuant to the copyright license under the clause at |
| 10 | * DFARS 252.227-7014 (OCT 2001). |
| 11 | */ |
| 12 | |
| 13 | package com.moesol.bindings.platform_sdk.component_services; |
| 14 | |
| 15 | /** |
| 16 | * @author robret |
| 17 | * |
| 18 | * To change the template for this generated type comment go to |
| 19 | * Window>Preferences>Java>Code Generation>Code and Comments |
| 20 | */ |
| 21 | public class Automation { |
| 22 | |
| 23 | public static IUnknown getActiveObject(GUID clsid) { |
| 24 | IUnknown out_unk = new IUnknown.Jni(); |
| 25 | int hr = jni_getActiveObject(clsid._getStructureBytes(), out_unk); |
| 26 | if (HRESULT.FAILED(hr)) { |
| 27 | throw new COMException(hr); |
| 28 | } |
| 29 | return out_unk; |
| 30 | } |
| 31 | private native static int jni_getActiveObject(byte[] clsid, IUnknown out_unk); |
| 32 | } |