Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*******************************************************************************
* Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.swt.internal.ole.win32;
import org.eclipse.swt.internal.win32.OS;
public class ITypeInfo extends IUnknown
{
public ITypeInfo(int /*long*/ address) {
super(address);
}
public int GetDocumentation(int index, String[] name, String[] docString, int[] pdwHelpContext, String[] helpFile ) {
int /*long*/[] pBstrName = null;
if (name != null) pBstrName = new int /*long*/[1];
int /*long*/[] pBstrDocString = null;
if (docString != null) pBstrDocString = new int /*long*/[1];
int /*long*/[] pBstrHelpFile = null;
if (helpFile != null) pBstrHelpFile = new int /*long*/[1];
int rc = COM.VtblCall(12, address, index, pBstrName, pBstrDocString, pdwHelpContext, pBstrHelpFile);
if (name != null && pBstrName[0] != 0) {
int size = COM.SysStringByteLen(pBstrName[0]);
if (size > 0){
// get the unicode character array from the global memory and create a String
char[] buffer = new char[(size + 1) /2]; // add one to avoid rounding errors
COM.MoveMemory(buffer, pBstrName[0], size);
name[0] = new String(buffer);
int subindex = name[0].indexOf("\0");
if (subindex > 0)
name[0] = name[0].substring(0, subindex);
}
COM.SysFreeString(pBstrName[0]);
}
if (docString != null && pBstrDocString[0] != 0) {
int size = COM.SysStringByteLen(pBstrDocString[0]);
if (size > 0){
// get the unicode character array from the global memory and create a String
char[] buffer = new char[(size + 1) /2]; // add one to avoid rounding errors
COM.MoveMemory(buffer, pBstrDocString[0], size);
docString[0] = new String(buffer);
int subindex = docString[0].indexOf("\0");
if (subindex > 0)
docString[0] = docString[0].substring(0, subindex);
}
COM.SysFreeString(pBstrDocString[0]);
}
if (helpFile != null && pBstrHelpFile[0] != 0) {
int size = COM.SysStringByteLen(pBstrHelpFile[0]);
if (size > 0){
// get the unicode character array from the global memory and create a String
char[] buffer = new char[(size + 1) /2]; // add one to avoid rounding errors
COM.MoveMemory(buffer, pBstrHelpFile[0], size);
helpFile[0] = new String(buffer);
int subindex = helpFile[0].indexOf("\0");
if (subindex > 0)
helpFile[0] = helpFile[0].substring(0, subindex);
}
COM.SysFreeString(pBstrHelpFile[0]);
}
return rc;
}
public int GetFuncDesc(int index, int /*long*/[] ppFuncDesc) {
return COM.VtblCall(5, address, index, ppFuncDesc);
}
public int GetIDsOfNames(String[] rgszNames, int cNames, int[] pMemId) {
char[] buffer;
int size = rgszNames.length;
// create an array to hold the addresses
int /*long*/ hHeap = OS.GetProcessHeap();
int /*long*/ ppNames = OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, size * OS.PTR_SIZEOF);
int /*long*/[] memTracker = new int /*long*/[size];
try {
// add the address of each string to the array
for (int i=0; i 0){
// get the unicode character array from the global memory and create a String
char[] buffer = new char[(size + 1) /2]; // add one to avoid rounding errors
COM.MoveMemory(buffer, rgBstrNames[i], size);
names[i] = new String(buffer);
int subindex = names[i].indexOf("\0");
if (subindex > 0)
names[i] = names[i].substring(0, subindex);
}
COM.SysFreeString(rgBstrNames[i]);
}
}
return rc;
}
public int GetRefTypeInfo(int hRefType, int /*long*/[] ppTInfo) {
return COM.VtblCall(14, address, hRefType, ppTInfo);
}
public int GetRefTypeOfImplType(int index, int[] pRefType) {
return COM.VtblCall(8, address, index, pRefType);
}
public int GetTypeAttr(int /*long*/[] ppTypeAttr) {
return COM.VtblCall(3, address, ppTypeAttr);
}
public int GetVarDesc(int index, int /*long*/[] ppVarDesc ) {
return COM.VtblCall(6, address, index, ppVarDesc);
}
public int ReleaseFuncDesc(int /*long*/ pFuncDesc ) {
return COM.VtblCall(20, address, pFuncDesc);
}
public int ReleaseTypeAttr(int /*long*/ pTypeAttr) {
return COM.VtblCall(19, address, pTypeAttr);
}
public int ReleaseVarDesc(int /*long*/ pVarDesc ) {
return COM.VtblCall(21, address, pVarDesc);
}
}