ptrex Posted March 15, 2012 Share Posted March 15, 2012 (edited) RegFreeCOM Example - Part IISince my first attempt to distribute 2007, life got harder to accomplish this. Because since Vista, Microsoft has changed the way how it was done.But since the existance of AutoiITOO trancexx ( _AutoItObject_ObjCreateEx ) opened a new possibiltity to do this in a very simple way, by just calling the CLSID of the COM Object.Now he/she implemented this feature in native AU3 since the last Beta 3.3.9.1 thanks for that Here is an Example that shows you how to use it.I choose KixForms.dll as an example.Because it had nearly no examples posted here in AU3, and because the syntax is very simular to AU3.You can download v2.46 here together with an nice HELP chm file.expandcollapse popup#AutoIt3Wrapper_UseX64=N Global $hActiveX ; Load the COM server module $hActiveX = DllOpen(@ScriptDir & "kixforms.dll") ; Object identifiers Global Const $sCLSIDApp = "{18F66832-6A94-4D70-B7EA-C51ACA6092A4}" Global Const $sIIDApp = Default ; "{04E9D874-6E55-4DAB-A7EC-77F803A15E70}" Global Const $sCLSIDSystem = "{FEEC1680-5609-4A96-847D-4585CEB24ED4}" Global Const $sIIDSystem = Default Global Const $sCLSIDForm = "{F89DF848-618A-46F9-8A1C-396EA442BDD3}" Global Const $sIIDForm = Default Global Const $sCLSIDDialog = "{C9A8E0D2-1D16-4EA4-9EA4-54F08D9C0D17}" Global Const $sIIDDialog = Default ; Error monitoring Global $oError = ObjEvent("AutoIt.Error", "_ErrFunc") Func _ErrFunc() ConsoleWrite("! COM Error ! Number: 0x" & Hex($oError.number, 8) & " ScriptLine: " & $oError.scriptline & " - " & $oError.windescription & @CRLF) Return EndFunc ;==>_ErrFunc $KixSystem = ObjCreate($sCLSIDSystem,$sIIDSystem,$hActiveX) ;$KixSystem = ObjCreate("KiXtart.System") If $KixSystem = 0 Then MsgBox(16,"Error", "Could not create the object, Common problem ActiveX not registered.") Global $Form = $KixSystem.Form Global $Exit = $Form.ToolButton With $Form .FontName = "Tahoma" .FontSize = 10 EndWith Global $SmallIcon = $Form.ToolButton With $SmallIcon .Location = $KixSystem.Point(10, 10) .Width = 23 .Icon = 40 ;.OnClick = "$ListView.View = 1" .OnClick = "ListView_View(1)" .FlatStyle = 1 EndWith Global $LargeIcon = $Form.ToolButton With $LargeIcon .Location = $KixSystem.Point($SmallIcon.Right + 5, 10) .Width = 23 .Icon = 38 ;.OnClick = "$ListView.View = 0" .OnClick = "ListView_View(0)" .FlatStyle = 1 EndWith Global $ListIcon = $Form.ToolButton With $ListIcon .Location = $KixSystem.Point($LargeIcon.Right + 5, 10) .Width = 23 .Icon = 39 ;.OnClick = "$ListView.View = 2" .OnClick = "ListView_View(2)" .FlatStyle = 1 EndWith Global $DetailsIcon = $Form.ToolButton With $DetailsIcon .Location = $KixSystem.Point($ListIcon.Right + 5, 10) .Width = 23 .Icon = 41 ;.OnClick = "$ListView.View = 3" .OnClick = "ListView_View(3)" .FlatStyle = 1 EndWith Global $ListView = $Form.ListView With $ListView .Location = $KixSystem.Point(10, $SmallIcon.Bottom + 10) .Right = $Form.ClientWidth - 10 .Bottom = $Form.ClientHeight - 35 .Columns.Count = 1 .SmallImageList = $Form.SmallImageList .OnClick = "ListView_Click()" .View = 0 EndWith $LargeImageList = $Form.ImageList With $LargeImageList .ImageSize = $KixSystem.Size(32, 32) For $i = 0 To $Form.SmallImageList.Images.Count .Images.Add($Form.SmallImageList.Images($i)) Next EndWith $ListView.largeImageList = $LargeImageList Func ListView_View($x) $ListView.View = $x ;ConsoleWrite($x & @CRLF) EndFunc Func ListView_Click() $Exit.Icon = $ListView.SmallImageList.Images($ListView.FocusedItem.Text) EndFunc For $i = 0 To $ListView.SmallImageList.Images.Count $Item = $ListView.Items.Add($i,$i) Next With $Exit .Center() .Top = $ListView.Bottom + 10 .Text = "Exit" .Icon = 37 .OnClick = "Quit()" EndWith $Form.Center() $Form.Show() While $Form.Visible Execute($Form.DoEvents) Wend Exit 1Enjoy !ptrex Edited March 15, 2012 by ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
ValeryVal Posted March 16, 2012 Share Posted March 16, 2012 @ptrex:Thank you. I had problem to view the KiXforms_246.chm content.Recompiled KiXforms_246_fixed_by_VI.chm is workin help for KixForm, though.You can download it from my autoitgroup:http://tech.groups.yahoo.com/group/autoitgroup/message/141 The point of world view Link to comment Share on other sites More sharing options...
ptrex Posted March 16, 2012 Author Share Posted March 16, 2012 @ValeryVal Mostlike this is not a problem with the CHM file but it is your security setting on the machine. If opening the CHM file you don't see the content, right click it go to security and say ALLOW -> fixed. This is standand windows behaviour for untrusted CHM files. Rgds ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
ValeryVal Posted March 16, 2012 Share Posted March 16, 2012 Mostlike this is not a problem with the CHM file but it is your security setting on the machine.Maybe. However this is a first untrusted CHM file and it would be better recompile it into trusted one. The point of world view Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now