/AutoHotkey.docset/Contents/Resources/Documents/commands/ComObjCreate.htm

https://gitlab.com/ahkscript/Autohotkey.docset · HTML · 44 lines · 35 code · 9 blank · 0 comment · 0 complexity · fb703c63b0e62e0c738682e12810982c MD5 · raw file

  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <title>ComObjCreate()</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <link href="../static/theme.css" rel="stylesheet" type="text/css" />
  8. <script src="../static/content.js" type="text/javascript"></script>
  9. </head>
  10. <body>
  11. <h1>ComObjCreate() <span class="ver">[AHK_L 53+]</span></h1>
  12. <p>Creates a COM object.</p>
  13. <pre class="Syntax">ComObject := ComObjCreate(CLSID [, IID])</pre>
  14. <h3>Parameters</h3>
  15. <dl>
  16. <dt>CLSID</dt>
  17. <dd><p>CLSID or human-readable Prog ID of the COM object to create.</p></dd>
  18. <dt>IID</dt>
  19. <dd><p><span class="ver">[v1.0.96.00+]:</span> The identifier of an interface the object supports.</p></dd>
  20. </dl>
  21. <h3>Return Value</h3>
  22. <p>If an error occurs, an empty string is returned.</p>
  23. <p>If an IID is specified, an interface pointer is returned. The script must typically call <a href="ObjAddRef.htm">ObjRelease</a> when it is finished with the pointer.</p>
  24. <p>Otherwise, a wrapper object usable by script is returned. See <a href="../Objects.htm#Usage_Objects">object syntax</a>.</p>
  25. <h3>Related</h3>
  26. <a href="ComObjGet.htm">ComObjGet</a>, <a href="ComObjActive.htm">ComObjActive</a>, <a href="ComObjConnect.htm">ComObjConnect</a>, <a href="ComObjArray.htm">ComObjArray</a>, <a href="ComObjError.htm">ComObjError</a>, <a href="ComObjQuery.htm">ComObjQuery</a>, <a href="http://msdn.microsoft.com/en-us/library/dcw63t7z.aspx">CreateObject (MSDN)</a>
  27. <h3>Examples</h3>
  28. <p>For a constantly growing list of examples, see the following forum topic: <a href="http://www.autohotkey.com/forum/topic61509.html">http://www.autohotkey.com/forum/topic61509.html</a>.</p>
  29. <pre class="NoIndent">
  30. ie := <b>ComObjCreate</b>("InternetExplorer.Application")
  31. ie.Visible := true <em>; This is known to work incorrectly on IE7.</em>
  32. ie.Navigate("https://autohotkey.com/")
  33. </pre>
  34. </body>
  35. </html>