use of com.sun.jna.platform.win32.WinNT.HRESULT in project jna by java-native-access.
the class RunningObjectTable_Test method Revoke.
@Test
public void Revoke() {
PointerByReference pprot = new PointerByReference();
HRESULT hr = Ole32.INSTANCE.GetRunningObjectTable(new DWORD(0), pprot);
COMUtils.checkRC(hr);
IRunningObjectTable rot = new RunningObjectTable(pprot.getValue());
//Can't yet be tested as IMoniker is not fully implemented,
// so we can't register an object, and hence can't get a registration key to Revoke one
//rot.Revoke(dwRegister);
}
use of com.sun.jna.platform.win32.WinNT.HRESULT in project jna by java-native-access.
the class RunningObjectTable_Test method before.
@Before
public void before() {
HRESULT hr = Ole32.INSTANCE.CoInitialize(null);
COMUtils.checkRC(hr);
}
use of com.sun.jna.platform.win32.WinNT.HRESULT in project jna by java-native-access.
the class Shell32Test method testCurrentProcessExplicitAppUserModelID.
public void testCurrentProcessExplicitAppUserModelID() {
String appUserModelID = "com.sun.jna.platform.win32.Shell32Test";
HRESULT r1 = Shell32.INSTANCE.SetCurrentProcessExplicitAppUserModelID(new WString(appUserModelID));
assertEquals(WinError.S_OK, r1);
PointerByReference ppszAppID = new PointerByReference();
HRESULT r2 = Shell32.INSTANCE.GetCurrentProcessExplicitAppUserModelID(ppszAppID);
assertEquals(WinError.S_OK, r2);
assertEquals(appUserModelID, ppszAppID.getValue().getWideString(0));
Ole32.INSTANCE.CoTaskMemFree(ppszAppID.getValue());
}
use of com.sun.jna.platform.win32.WinNT.HRESULT in project jna by java-native-access.
the class VariantTest method testVariantClear.
public void testVariantClear() {
VARIANT variant = new VARIANT(new SHORT(33333));
HRESULT hr = OleAuto.INSTANCE.VariantClear(variant);
assertTrue("hr: " + hr.intValue(), hr.intValue() == 0);
}
use of com.sun.jna.platform.win32.WinNT.HRESULT in project jna by java-native-access.
the class VariantTest method testVariantCopyShort.
public void testVariantCopyShort() {
VARIANT variantSource = new VARIANT(new SHORT(33333));
VARIANT variantDest = new VARIANT();
//System.out.println(variantSource.toString(true));
HRESULT hr = OleAuto.INSTANCE.VariantCopy(variantDest.getPointer(), variantSource);
assertTrue("hr: " + hr.intValue(), hr.intValue() == 0);
}
Aggregations