COM Standard Library
Gui, +LastFound +Resize Gui, Show, Hide pwb:=COM_AtlAxCreateControl( WinExist(), xls_directory "\Book1.xls" ) pxl:=pwb.document.application Gui, Show, w500 h500 center, SpreadSheet GUI return GuiClose: Gui, Destroy ExitAppCan this be done without creating a .xls file first? I've gotten this to work using the OWC.Spreadsheet as the second param in COM_AtlAxCreateControl(), though it isn't consistent with different computers. I also tried using Excel.Sheet, which creates a new Excel Process, but doesn't seem to load it into the GUI. Any advice would be appreciated .
Since some time Autohotkey_L is merged with Autohotkey32/64 - therefore it offers native COM-support.
Questions in this context:
* Is COM_L-Library still needed for latest Autohotkey(_L) versions?
* If yes:
* What benefit has the library over built-in functions?
* Is there some additional/missing functionality within COM_L-Library, comparing to latest Autohotkey_L?
Perhaps it makes sense to update to initial message in this thread with this information ....
You can do most COM - related things without the library. I think there are one or two functions not covered internally yet, but I didn't have to use them yet.
Can you point out, what's not covered?
Is it possible to use COM-Objects without the IDispatch interface without the library? (as Lexikos suggested here: http://www.autohotke...p=425107#425107)
The code that Lexikos mentioned in that post is valid, but not very convenient to use. I tried porting such code to x64 once, but failed because I got some addresses wrong. I think I have only used COM objects which support IDispatch (Shell.Application, Schedule.Service, ...)
**SIGH** There are so many issues to consider with COM and the topic I've chosen, I cannot find a good/any entry point yet. I think I have to go all the long way down from basics of COM to solve my problem ...
Allowing Function Pointer in DllCall: ComCall via DllCall
I'm having a question: The library contains a COM_SafeArrayDestroy() function, but not a COM_SafeArrayCreate() function. Why?
I know I could do this with ComObjArray() in AHK_L, but I still would like to support basic if possible.
Could I use SafeArrayCreate or is this just impossible because basic has no built-in array support?
And just to be sure:
I would have to pass a result of ComObjArray() or similar for this parameter, true?
A pointer to an array of THUMBBUTTON structures.
Visit me on github
Win7 HP SP1 64bit | AHK_L U 64bit
Before the built-in SafeArray support of AHK_L, it wasn't really worth-while to directly manipulate a safearray. If you needed to create one, it was much easer to create and return a vbs array using the ScriptControl object. However, here's a post on how to manually build a SafeArray. Also, you may be interested in this thread.
The library contains a COM_SafeArrayDestroy() function, but not a COM_SafeArrayCreate() function. Why?
Encouraged by this post, I tried to incorporate COM into AHK myself. It was my first coding in C++, so there could be many I missed/got wrong. It's based on (UNICODE) AutoHotkey_L45 and I also included the altered/new files in the zip.
The new functions are:ComObjActive(ProgId/CLSID [/pdisp/ComObject]) ; <-> COM_GetActiveObject() [/COM_Enwrap()/COM_Unwrap()] ComObjCreate(ProgId/CLSID) ; <-> COM_CreateObject() ComObjGet(name) ; <-> COM_GetObject() ComObjConnect(ComObject [ , prefix]) ; <-> COM_ConnectObject()/COM_DisconnectObject()Not all in COM.ahk were translated yet like COM_Parameter/missing params. And instead of producing MsgBox, Invoke will assign its HRESULT to A_LastError, so an user can handle the error himself.
The most notable syntax change was on Enumerate and Connect to event. Now I'd like to demonstrate only about Enumerate, and later for others.
Example: EnumerateoSet := ComObjGet("winmgmts:").ExecQuery("SELECT * FROM Win32_PhysicalMemory") oEnum := oSet._NewEnum While oEnum[color=red][[/color]obj[color=red]][/color] MsgBox, % obj.GetObjectText_