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

COM: TYPEFLAGS constants missing?! #615

Closed
SevenOf9Sleeper opened this issue Mar 8, 2016 · 9 comments
Closed

COM: TYPEFLAGS constants missing?! #615

SevenOf9Sleeper opened this issue Mar 8, 2016 · 9 comments

Comments

@SevenOf9Sleeper
Copy link
Contributor

Hi there, in the type TYPEATTR is the attribute wTypeFlags. I have not found a declaration of these constants?! (info based on jna 4.2.1)
After reading the msdn library this would be my suggestion:

public class TYPEFLAGS {
    private TYPEFLAGS() {
        /* do not instantiate */ }

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

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

    /**
     * The type is licensed.
     */
    public final static int 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 FPREDECLID = 0x8;

    /**
     * The type should not be displayed to browsers.
     */
    public final static int 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 FCONTROL = 0x20;

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

    /**
     * The interface cannot add members at run time.
     */
    public final static int 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 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 FRESTRICTED = 0x200;

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

    /**
     * The type is replaceable.
     */
    public final static int 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 FDISPATCHABLE = 0x1000;

    /**
     * The type has reverse binding.
     */
    public final static int 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 FPROXY = 0x4000;
}

@dblock
Copy link
Member

dblock commented Mar 9, 2016

@SevenOf9Sleeper
Copy link
Contributor Author

I will try... but first I fear that I need some excercises in git... :-]

@twall
Copy link
Contributor

twall commented Mar 9, 2016

These might be better defined within an interface rather than a class.

On Mar 8, 2016, at 6:59 PM, Mathias Mehrmann [email protected] wrote:

Hi there, in the type TYPEATTR is the attribute wTypeFlags. I have not found a declaration of these constants?! (info based on jna 4.2.1)
After reading the msdn library this would be my suggestion:

public class TYPEFLAGS {
private TYPEFLAGS() {
/* do not instantiate */ }

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

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

/**
 * The type is licensed.
 */
public final static int 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 FPREDECLID = 0x8;

/**
 * The type should not be displayed to browsers.
 */
public final static int 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 FCONTROL = 0x20;

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

/**
 * The interface cannot add members at run time.
 */
public final static int 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 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 FRESTRICTED = 0x200;

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

/**
 * The type is replaceable.
 */
public final static int 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 FDISPATCHABLE = 0x1000;

/**
 * The type has reverse binding.
 */
public final static int 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 FPROXY = 0x4000;

}


Reply to this email directly or view it on GitHub.

@SevenOf9Sleeper
Copy link
Contributor Author

Oh... ok... I thought that is dealt as antipattern? (Effective Java, Item 19). On the job we try to avoid the constants in interface-pattern. Or are there some special architectural specialties in jna I don't know yet?

@twall
Copy link
Contributor

twall commented Mar 9, 2016

Kind of preachy, that.

That item actually recommends adding constants to the class or interface to which they are tightly bound. In this case, that'd probably be the Structure that uses them.

On Mar 8, 2016, at 9:13 PM, Mathias Mehrmann [email protected] wrote:

Oh... ok... I thought that is dealt as antipattern? (Effective Java, Item 19). On the job we try to avoid the constants in interface-pattern. Or are there some special architectural specialties in jna I don't know yet?


Reply to this email directly or view it on GitHub.

@SevenOf9Sleeper
Copy link
Contributor Author

Yeah, perhaps you are right (with the "preachy").
In this case I must admit that the constants are better of direct in the class TYPEATTR where the attribute wTypeFlags is defined. So... if I get my git started I will try the contribution thing...

SevenOf9Sleeper added a commit to SevenOf9Sleeper/jna that referenced this issue Mar 14, 2016
@SevenOf9Sleeper
Copy link
Contributor Author

#619 pull request created... I have corrected compile errors in the contribution projects as well and have adapted the .project- and .classpath-files for eclipse

@SevenOf9Sleeper
Copy link
Contributor Author

#619 closed and created new pull request #621

dblock added a commit that referenced this issue Mar 27, 2016
#615: added TYPEFLAGS constants for TYPEATTR in ITypeInfo.GetTypeAttr()
@matthiasblaesing
Copy link
Member

Closing this as #621 was merged by @dblock.

mstyura pushed a commit to mstyura/jna that referenced this issue Sep 9, 2024
Motivation:

We should be able to support connection migration the server side. This
can be tested via quiche:

```
cargo run --bin quiche-client -- --no-verify --perform-migration https://127.0.0.1:9999/`
```

Modifications:

Be able to support migrations by offering the remote peer connection ids
to use.

Result:

Be able to do connection migration in all cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants