dispatchptrgitthread.java

来自「java 调用windows的api」· Java 代码 · 共 51 行

JAVA
51
字号
/*
 * DispatchPtrGITThread.java -
 *
 * This file is part of the Jawin Project: http://jawinproject.sourceforge.net/
 * 
 * Please consult the LICENSE file in the project root directory,
 * or at the project site before using this software.
 */

/* $Id: DispatchPtrGITThread.java,v 1.1 2004/07/18 15:12:35 arosii_moa Exp $ */

package org.jawin.perf;

import org.jawin.AbstractGITThread;
import org.jawin.COMException;
import org.jawin.COMTestBase;
import org.jawin.DispatchPtr;
import org.jawin.win32.COINIT;
import org.jawin.win32.Ole32;

/**
 *
 * @version     $Revision: 1.1 $
 * @author      Morten Andersen, arosii_moa (at) users.sourceforge.net
 */
class DispatchPtrGITThread extends AbstractGITThread {

	private DispatchPtr directDisp;
	private DispatchPtr gitDisp;

	protected void createReference() throws COMException {
		Ole32.CoInitialize(COINIT.MULTITHREADED);
		directDisp = new DispatchPtr(COMTestBase.DUAL_TEST_CLSID);
		gitDisp = (DispatchPtr)directDisp.createGITRef();
	}

	protected void closeReference() throws COMException {
		if (gitDisp != null) {
			gitDisp.close();
		}
		if (directDisp != null) {
			directDisp.close();
		}
		Ole32.CoUninitialize();
	}

	DispatchPtr getGitDisp() {
		return gitDisp;
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?