KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > swt > internal > ole > win32 > IOleObject


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.swt.internal.ole.win32;
12
13 import org.eclipse.swt.internal.win32.*;
14
15 public class IOleObject extends IUnknown
16 {
17 public IOleObject(int /*long*/ address) {
18     super(address);
19 }
20 public int Advise(int /*long*/ pAdvSink, int[] pdwConnection) {
21     return COM.VtblCall(19, address, pAdvSink, pdwConnection);
22 }
23 public int Close(int dwSaveOption) {
24     return COM.VtblCall(6, address, dwSaveOption);
25 }
26 public int DoVerb(int iVerb, MSG lpmsg, int /*long*/ pActiveSite, int lindex, int /*long*/ hwndParent, RECT lprcPosRect) {
27     return COM.VtblCall(11, address, iVerb, lpmsg, pActiveSite, lindex, hwndParent, lprcPosRect);
28 }
29 public int GetExtent(int dwDrawAspect, SIZE pSizel) {
30     return COM.VtblCall(18, address, dwDrawAspect, pSizel);
31 }
32 public int SetClientSite(int /*long*/ pClientSite) {
33     return COM.VtblCall(3, address, pClientSite);
34 }
35 public int SetExtent(int dwDrawAspect, SIZE pSizel) {
36     return COM.VtblCall(17, address, dwDrawAspect, pSizel);
37 }
38 public int SetHostNames(String JavaDoc szContainerApp, String JavaDoc szContainerObj) {
39
40     // create a null terminated array of char
41
char[] buffer1 = null;
42     if (szContainerApp != null) {
43         int count1 = szContainerApp.length();
44         buffer1 = new char[count1 + 1];
45         szContainerApp.getChars(0, count1, buffer1, 0);
46     }
47
48     // create a null terminated array of char
49
char[] buffer2 = null;
50     if (szContainerObj != null) {
51         int count2 = szContainerObj.length();
52         buffer2 = new char[count2 + 1];
53         szContainerObj.getChars(0, count2, buffer2, 0);
54     }
55     return COM.VtblCall(5, address, buffer1, buffer2);
56 }
57 public int Update() {
58     return COM.VtblCall(13, address);
59 }
60 }
61
Popular Tags