maul-esel / com-classes Goto Github PK
View Code? Open in Web Editor NEWAHK classes that implement COM interfaces
AHK classes that implement COM interfaces
finish CF class. The most important thing: implement CF.GetWindowsVersion()
.
Check out structure padding and correct all structure classes to obey it. This may solve #27.
There should possibly be a base class for enum classes.
This allows them to
_CCF_Error_Handler_
(important if there are methods, e.g. as in CF
)CCFramework
There are still a lot of places where Unknown._GUID()
is used. Fix that!
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.
maybe the memory can be copied (for structures) ?
Add _ShellLinkA_ class (should be easy as _ShellLinkW_ is already wrapped). This is a split-off from #17.
add msdn doc links for each class (comments)
Hello maul.esel
your latest change on TaskbarList3 (c3517c8) breaks example2 (at least on my machine):
(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)
Achieve less dependencies for each class by
IImageList2::SetCallback
/ IImageList2::GetCallback
Add "header" files, similar to CCF.ahk, but only for parts of CCF. Examples would be:
add a short description to the top of each example
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.
The same for all those calls to NumGet()
retrieving the method adresses.
Rethink the directory structure. Especially: the different types of helper classes should be separated.
Make local variables in _all_ methods in _all_ classes explicitly local (declare them).
To avoid overriding super-global variables
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 ...
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
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()
.
StructBase.GetOriginalPointer()
StructBase.ReleaseOriginalPointer()
FromStructPtr()
to store the pointerCCFramework.AllocateMemory()
, not VarSetCapacity()
.The file spec.markdown (on the gh-pages branch) contains the beginnings of an explicit specification of requirements for CFF classes.
Whenever structs are created in a class and memory must be allocated for that, use the struct's GetRequiredSize()
method for that.
IUIAutomation: http://msdn.microsoft.com/en-us/library/windows/desktop/ee671406(v=VS.85).aspx
bewildr using IUIAutomation in ironruby: http://www.natontesting.com/2010/07/20/announcing-bewildr-test-your-wpf-ui-apps-with-ironruby/
https://github.com/GraemeF/Fluid
http://www.autoitscript.com/forum/topic/128406-interface-autoitobject-iuiautomation/
Edit: removed request for IAccessible as it already inherits from IDispatch
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).
BINDPTR
is not a structure but a union.In any case where a structure class has a constructor, it must not require a parameter (optional parameters are OK).
Add more information to the documentation comments. For examples see this thread.
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.
Add more documentation to helper classes, such as Requirements, license and so on.
There should be a documentation on CCF that includes general information, i.e. a more noob-friendly version of the spec.
Add the CLSCTX
enum class. Also include "combined" values such as CLSCTX_ALL
.
Correct the (DllCall-) types used. Especially: HWND must be Ptr
instead of UInt
.
Loop, Parse
instead of LoopParse
_ToUnicode(str)
method, but it is not yet working.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()
.
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.
Wrap TOM (text object model) interfaces to allow efficient work with RichEdit controls & the RichEditOLE class.
For easier use of the PropertyStore class, some new features might be added:
PropertyStore.FromHWND()
(see here)Show the full power of CCF, and verify methods work as intended. Right now, many methods (and entire classes) are untested _!_
Wrap IEnumSTATSTG
(used with Storage
class)
IShellLink::GetIDList
/ IShellLink::SetIDList
and IShellLink::GetHotkey
/ IShellLink::SetHotkey
.The methods
IPropertyStore::GetValue
IPropertyStore::SetValue
IPropertyStoreCache::GetValueAndState
andIPropertyStoreCache::SetValueAndState
need some handling for PROPVARIANT structures. This may must be done as a structure class or similar to the .VARIANT
handling
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.