#FEATURE
authorClaus Gittinger <cg@exept.de>
Wed, 30 Mar 2016 03:29:32 +0200
changeset 1378 9f3b1678697b
parent 1377 c68053a15d26
child 1379 b287b40bb60f
#FEATURE class: RegressionTests::Win32OLETests added: #test03_CreateInstance
RegressionTests__Win32OLETests.st
--- a/RegressionTests__Win32OLETests.st	Wed Mar 30 02:28:36 2016 +0200
+++ b/RegressionTests__Win32OLETests.st	Wed Mar 30 03:29:32 2016 +0200
@@ -104,6 +104,43 @@
     "
 
     "Modified: / 30-03-2016 / 02:28:15 / cg"
+!
+
+test03_CreateInstance
+    |guid iDispatch iWebBrowser iWebBrowserApp iWebBrowser2|
+
+    guid := (GUID clsidFromProgID:'InternetExplorer.Application'). 
+    self assert:(guid notNil).
+    self assert:(guid printString = '{0002DF01-0000-0000-C000-000000000046}').
+
+    iDispatch := IClassFactory 
+                createInstance:guid
+                iid: (OLEInterface oleConstantAt:'IID_IDispatch')
+                controllingUnknown:nil
+                context:(OLEInterface oleConstantAt:'CLSCTX_ALL').
+    self assert:(iDispatch notNil).
+
+    self assert:(iDispatch hasTypeInfo).
+    iWebBrowser := iDispatch queryInterface: IWebBrowser iid.
+    self assert:(iWebBrowser notNil).
+    iDispatch release.
+
+    iWebBrowserApp := iWebBrowser queryInterface: IWebBrowserApp iid.
+    self assert:(iWebBrowserApp notNil).
+    iWebBrowser release.
+
+    iWebBrowser2 := iWebBrowserApp queryInterface: IWebBrowser2 iid.
+    self assert:(iWebBrowser2 notNil).
+    iWebBrowserApp release.
+
+self halt.
+    iWebBrowser2 release.
+
+    "
+     self new test03_CreateInstance
+    "
+
+    "Created: / 30-03-2016 / 02:29:19 / cg"
 ! !
 
 !Win32OLETests class methodsFor:'documentation'!