Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#615: added TYPEFLAGS constants for TYPEATTR in ITypeInfo.GetTypeAttr() #619

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions contrib/msoffice/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry combineaccessrules="false" kind="src" path="/com.sun.jna"/>
<classpathentry combineaccessrules="false" kind="src" path="/com.sun.jna.platform"/>
<classpathentry combineaccessrules="false" kind="src" path="/platform"/>
<classpathentry combineaccessrules="false" kind="src" path="/jnalib"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ public void testMSWord() {
if (msWord != null) {
msWord.Quit();
}
if (null != factory) {
factory.getComThread().terminate(500);
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this is correct with regard to fixing the compile error, the example lacks proper COM initialization (the automatic init was removed together with the threading). (a Ole32.INSTANCE.CoInitializeEx/Ole32.INSTANCE.CoUninitialize() pair is missing)

At this point factory.disposeAll should be called to dispose all COM objects (I'm not sure how COM reacts to programm shutdown, but in any case a clean shutdown is preferred).

}
}
2 changes: 1 addition & 1 deletion contrib/native_window_msg/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/jnalib"/>
<classpathentry kind="lib" path="C:/GitHub/jna-3.5.1.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/platform"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,21 @@

package com.sun.jna.platform.win32;

import com.sun.jna.WString;
import com.sun.jna.platform.win32.DBT;
import com.sun.jna.platform.win32.DBT.DEV_BROADCAST_DEVICEINTERFACE;
import com.sun.jna.platform.win32.DBT.DEV_BROADCAST_HANDLE;
import com.sun.jna.platform.win32.DBT.DEV_BROADCAST_HDR;
import com.sun.jna.platform.win32.DBT.DEV_BROADCAST_OEM;
import com.sun.jna.platform.win32.DBT.DEV_BROADCAST_PORT;
import com.sun.jna.platform.win32.DBT.DEV_BROADCAST_VOLUME;
import com.sun.jna.platform.win32.Kernel32;
import com.sun.jna.platform.win32.User32;
import com.sun.jna.platform.win32.WinDef.HMODULE;
import com.sun.jna.platform.win32.WinDef.HWND;
import com.sun.jna.platform.win32.WinDef.LPARAM;
import com.sun.jna.platform.win32.WinDef.LRESULT;
import com.sun.jna.platform.win32.WinDef.WPARAM;
import com.sun.jna.platform.win32.WinUser;
import com.sun.jna.platform.win32.WinUser.HDEVNOTIFY;
import com.sun.jna.platform.win32.WinUser.MSG;
import com.sun.jna.platform.win32.WinUser.WNDCLASSEX;
import com.sun.jna.platform.win32.WinUser.WindowProc;
import com.sun.jna.platform.win32.Wtsapi32;

// TODO: Auto-generated Javadoc
/**
Expand All @@ -46,7 +40,7 @@ public class Win32WindowDemo implements WindowProc {
*/
public Win32WindowDemo() {
// define new window class
WString windowClass = new WString("MyWindowClass");
String windowClass = new String("MyWindowClass");
HMODULE hInst = Kernel32.INSTANCE.GetModuleHandle("");

WNDCLASSEX wClass = new WNDCLASSEX();
Expand Down
2 changes: 1 addition & 1 deletion contrib/platform/.project
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.sun.jna.platform</name>
<name>platform</name>
<comment></comment>
<projects>
</projects>
Expand Down
83 changes: 83 additions & 0 deletions contrib/platform/src/com/sun/jna/platform/win32/OaIdl.java
Original file line number Diff line number Diff line change
Expand Up @@ -1458,6 +1458,7 @@ public static class ByReference extends TYPEATTR implements
public WORD cImplTypes;
public WORD cbSizeVft;
public WORD cbAlignment;
// The type flags. See TYPEFLAGS_...
public WORD wTypeFlags;
public WORD wMajorVerNum;
public WORD wMinorVerNum;
Expand All @@ -1479,5 +1480,87 @@ public TYPEATTR(Pointer pointer) {
protected List<String> getFieldOrder() {
return FIELDS;
}

/**
* A type description that describes an Application object.
*/
public final static int TYPEFLAGS_FAPPOBJECT = 0x1;

/**
* Instances of the type can be created by ITypeInfo::CreateInstance.
*/
public final static int TYPEFLAGS_FCANCREATE = 0x2;

/**
* The type is licensed.
*/
public final static int TYPEFLAGS_FLICENSED = 0x4;

/**
* The type is predefined. The client application should automatically create a single instance of the object
* that has this attribute. The name of the variable that points to the object is the same as the class name of
* the object.
*/
public final static int TYPEFLAGS_FPREDECLID = 0x8;

/**
* The type should not be displayed to browsers.
*/
public final static int TYPEFLAGS_FHIDDEN = 0x10;

/**
* The type is a control from which other types will be derived, and should not be displayed to users.
*/
public final static int TYPEFLAGS_FCONTROL = 0x20;

/**
* The interface supplies both IDispatch and VTBL binding.
*/
public final static int TYPEFLAGS_FDUAL = 0x40;

/**
* The interface cannot add members at run time.
*/
public final static int TYPEFLAGS_FNONEXTENSIBLE = 0x80;

/**
* The types used in the interface are fully compatible with Automation, including VTBL binding support. Setting
* dual on an interface sets this flag in addition to TYPEFLAG_FDUAL. Not allowed on dispinterfaces.
*/
public final static int TYPEFLAGS_FOLEAUTOMATION = 0x100;

/**
* Should not be accessible from macro languages. This flag is intended for system-level types or types that
* type browsers should not display.
*/
public final static int TYPEFLAGS_FRESTRICTED = 0x200;

/**
* The class supports aggregation.
*/
public final static int TYPEFLAGS_FAGGREGATABLE = 0x400;

/**
* The type is replaceable.
*/
public final static int TYPEFLAGS_FREPLACEABLE = 0x800;

/**
* Indicates that the interface derives from IDispatch, either directly or indirectly. This flag is computed.
* There is no Object Description Language for the flag.
*/
public final static int TYPEFLAGS_FDISPATCHABLE = 0x1000;

/**
* The type has reverse binding.
*/
public final static int TYPEFLAGS_FREVERSEBIND = 0x2000;

/**
* Interfaces can be marked with this flag to indicate that they will be using a proxy/stub dynamic link
* library. This flag specifies that the typelib proxy should not be unregistered when the typelib is
* unregistered.
*/
public final static int TYPEFLAGS_FPROXY = 0x4000;
}
}
14 changes: 8 additions & 6 deletions contrib/w32printing/.classpath
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry combineaccessrules="false" kind="src" path="/platform"/>
<classpathentry combineaccessrules="false" kind="src" path="/jnalib"/>
<classpathentry kind="output" path="bin"/>
</classpath>