Code Monkey home page Code Monkey logo

com-classes's People

Contributors

hoppfrosch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

com-classes's Issues

finish CF class

finish CF class. The most important thing: implement CF.GetWindowsVersion().

Structure padding

Check out structure padding and correct all structure classes to obey it. This may solve #27.

base class for enum classes

What

There should possibly be a base class for enum classes.

Advantages ๐Ÿ‘

This allows them to

  • inherit _CCF_Error_Handler_ (important if there are methods, e.g. as in CF)
  • define a constructor similar to CCFramework

Disadvantages ๐Ÿ‘Ž

  • one more class requirement

fix GUID handling

There are still a lot of places where Unknown._GUID() is used. Fix that!

Allow raw GUID pointers

Raw memory pointers should be allowed for each place where a GUID or a pointer to it is needed.
This includes support in struct classes.

Related

maybe the memory can be copied (for structures) ?

add ShellLinkA

Add _ShellLinkA_ class (should be easy as _ShellLinkW_ is already wrapped). This is a split-off from #17.

msdn links

add msdn doc links for each class (comments)

TaskbarList3 example does not work correctly on Win7 64bit.

Hello maul.esel

your latest change on TaskbarList3 (c3517c8) breaks example2 (at least on my machine):

  • Only the first thumbbar-button contains an icon - all others are shown as borders only (i.e. no icon is shown, only border)
  • Unless there should be 6 icons actually are only 5 drawn (1 real icon - and four border-only icons (it seems one border-only icon is missing))
  • Hovering over the first (correct rendered) button almost shows up the expected tooltip (expected: "This is button #1" - actually shown: "is button #1") All other (border-only) icons do NOT show any tooltip
  • Clicking on the first icon brings up the following msgbox as expected: "The ThumbBar button with the id "1" was clicked!". Clicking on the other items also pop up a msgbox - but the shown ID is wrong: 2nd button shows id 47, 3rd button shows id 84 ...

(used for test: pre-change AHK_L 1.1 version <-> post change AHK2 version. Therefore I'm not quite sure which of the described problems already occur with pre-change AHK_2 version ...)

Can't figure it out how to fix it myself - else I did it already ....

EDIT: Initial assumption that bug was introduced with latest version seems not to be correct. The bug seems to exist since ever (using AHK2 variant on Win7 64bit OS)

minimize dependencies

Minimize dependencies

Achieve less dependencies for each class by

  • ensuring every function that accepts another instance of a COM class can also handle a raw pointer
  • the same for struct classes
  • ensuring every function that returns an instance of a COM class (or retrieves it via byRef) returns a raw pointer if the class is not available
  • the same for struct class fields
  • document this

finish ImageList & ImageList2

  • investigate on and implement IImageList2::SetCallback / IImageList2::GetCallback
  • add an example
  • fix methods marked as "NOT WORKING" in ImageList

Add partial "header" files

Add "header" files, similar to CCF.ahk, but only for parts of CCF. Examples would be:

  • Base classes, TaskbarList - TaskbarList4 & helper classes
  • Base classes, UIAutomation classes
  • Base classes, Type information classes + Helper classes

explicitly specify types

return types

Change all COM methods to explicitly specify their return type (most of the time "UInt") to ensure the code doesn't break on a possible future change in AHK.

method & NumGet()

The same for all those calls to NumGet() retrieving the method adresses.

change directory structure

Rethink the directory structure. Especially: the different types of helper classes should be separated.

use explicitly local variables

What

Make local variables in _all_ methods in _all_ classes explicitly local (declare them).

Why

To avoid overriding super-global variables

CCF (V2) and ObjTree makes AHK V2 crash ...

After the bugfix (http://www.autohotkey.com/forum/viewtopic.php?p=517398#517398) , which allows using ObjTree (http://http://www.autohotkey.com/forum/viewtopic.php?t=69756) to display objects from CCF, still one fatal error exists:

At the end of the following example program, AHK2 crashes and pops up a window (german OS): "Autohotkey_L funktioniert nicht mehr".

#SingleInstance
#include ..\..\_CCF_Error_Handler_.ahk
#include ..\..\CCFramework.ahk
#Include ..\..\Unknown\Unknown.ahk
#Include ..\..\ShellItem\ShellItem.ahk
#Include ..\..\Constant Classes\SIGDN.ahk
#Include ..\..\Constant Classes\SFGAO.ahk
#Include ..\..\Constant Classes\KNOWNFOLDERID.ahk


; #############################################
; Explicit filepath
shItem := ShellItem.FromAbsolutePath(A_AhkPath)

ObjTree(shItem)

; display a few names
MsgBox % "NORMALDISPLAY: <" shItem.GetDisplayName() ">`nFILESYSPATH: <" shItem.GetDisplayName(SIGDN.FILESYSPATH) ">`nDESKTOPABSOLUTEEDITING: <" shItem.GetDisplayName(SIGDN.DESKTOPABSOLUTEEDITING) ">`nPARENTRELATIVEFORADDRESSBAR: <" shItem.GetDisplayName(SIGDN.PARENTRELATIVEFORADDRESSBAR) ">"

; checking some attributes
ret := shItem.GetAttributes((SFGAO.HASPROPSHEET | SFGAO.ENCRYPTED | SFGAO.FOLDER | SFGAO.BROWSABLE), bits)
; to display wheter the flag is set or not, we use Utility function - or some bitwise operations
MsgBox % "HASPROPSHEET: <" CCFramework.HasEnumFlag(bits, SFGAO.HASPROPSHEET) ">`nENCRYPTED: <" CCFramework.HasEnumFlag(bits,SFGAO.ENCRYPTED) ">`nFOLDER: <" ((bits & SFGAO.FOLDER) > 0) ">`nBROWSABLE: <" ((bits & SFGAO.BROWSABLE) > 0) ">" 

I'm not quite sure, who's the culprit (either CCF, ObjTree, or AHK itself) - but it's beyond my capability to identify it ...

Allocate non-persistent memory for GUIDs

I many cases where memory is allocated for a GUID, it does not need to be persistent. Therefore VarSetCapacity() should be used in favor of AllocateMemory(). This should shorten the code and improve performance

request interface: ITypeLib2

Wrap ITypeLib2. This might be needed in ComGenerator & belongs to the other type information classes (include it in the specific header)..

Helper classes have already been wrapped (see #10 and others).

allocate persistent memory for structs

Memory allocated for structs returned to the user should be allocated in a way that it's persistent after the method returns.

To do so, allocate the memory using the "Heap functions" (CCFramework.AllocateMemory()). Also add a new method to structs: GetOriginalPointer(), which, if the instance was created by FromStructPtr(), returns the pointer it was created from (which only makes sense if it's still valid).

The user is responsible for releasing the memory (add a ReleaseOriginalPointer() method). In case of the TypeInfo structs, this allows struct instances to be passed to those Release*() methods, e.g. ITypeInfo::ReleaseFuncDesc().

Summary:

  • Add:
    • StructBase.GetOriginalPointer()
    • StructBase.ReleaseOriginalPointer()
  • Modify:
    • Struct classes & StructBase: FromStructPtr() to store the pointer
    • COM methods: allocate memory with CCFramework.AllocateMemory(), not VarSetCapacity().
  • Check:
    • How far this affects nested structures...

Write specification

What

The file spec.markdown (on the gh-pages branch) contains the beginnings of an explicit specification of requirements for CFF classes.

Todo:

  • transfer wiki information to the spec
  • extend it, e.g.
    • how to handle struct arrays?
    • should methods / structures accept string pointers?
    • provide standard functions / "macros", or a class containing those?
      • for example GUID<->string conversion, struct array conversion (?), ...

use GetRequiredSize() for memory allocation

What

Whenever structs are created in a class and memory must be allocated for that, use the struct's GetRequiredSize() method for that.

Affected classes

  • all "interface classes" that use structs

request interface: ITypeInfo2

Wrap ITypeInfo2 and required helper classes. This might be needed in ComGenerator & belongs to the other type information classes (include it in the specific header).

request interface: ITypeComp

Wrap ITypeComp. This might be needed by ComGenerator & belongs to the other type information classes (include it in the specific header). The required helper classes have to be wrapped, too (see issue #10).

update CCF header

The CCF header file is quite out-of -date and incomplete. All new interface classes + all helper classes must be #included here. #42 should be done before.

finish IRichEditOLE

  • Continue work on IRichEditOLE
  • add a working example
  • also implement TOM (text object model) classes to make efficient work with RichEdits easier

add helper class documentation

What

Add more documentation to helper classes, such as Requirements, license and so on.

Affected classes

  • all helper classes, especially struct classes

Related

  • Issue #6

general CCF documentation

There should be a documentation on CCF that includes general information, i.e. a more noob-friendly version of the spec.

request enum: CLSCTX

Add the CLSCTX enum class. Also include "combined" values such as CLSCTX_ALL.

correct types

Correct the (DllCall-) types used. Especially: HWND must be Ptr instead of UInt.

porting back to AHK_Lv1.1

Todo:

  • push changes to branch AHK_Lv1.1

  • correct parameter default values
  • use Loop, Parse instead of LoopParse
  • convert ANSI / Unicode:
    • Unknown has the _ToUnicode(str) method, but it is not yet working.
    • What encoding to use for libraries & demos _?_
    • possibly separate into AHKv1.1_U and AHKv1.1_A branches?

IDispatch wrapper

Adding a wrapper for IDispatch enables the user to simply create an instance with
instance := new Dispatch(ComObjUnwrap(myobj)).
Then he can easily call its methods, e.g. IDispatch::GetTypeInfo().

fix potential memory leaks

All structure class must not call CCFramework.AllocateMemory() directly, except when they also release the memory immediately. Otherwise, they should call this.Allocate() as all memory allocated this way is freed when the class instance is released.

A new method FreeAllMemory() should be added to StructBase.

It must be documented that all structure pointers are only valid as long as the class instance exists.

TOM interfaces

Wrap TOM (text object model) interfaces to allow efficient work with RichEdit controls & the RichEditOLE class.

Tests & examples

Write tests and usage examples!

Show the full power of CCF, and verify methods work as intended. Right now, many methods (and entire classes) are untested _!_

Finish ShellLink

  • implement IShellLink::GetIDList / IShellLink::SetIDList and IShellLink::GetHotkey / IShellLink::SetHotkey.
  • add ShellLinkA class

add PROPVARIANT handling

The methods

  • IPropertyStore::GetValue
  • IPropertyStore::SetValue
  • IPropertyStoreCache::GetValueAndState and
  • IPropertyStoreCache::SetValueAndState

need some handling for PROPVARIANT structures. This may must be done as a structure class or similar to the VARIANT handling.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.