{"action":"created","issue":{"url":"https://api.github.com/repos/go-ole/go-ole/issues/102","labels_url":"https://api.github.com/repos/go-ole/go-ole/issues/102/labels{/name}","comments_url":"https://api.github.com/repos/go-ole/go-ole/issues/102/comments","events_url":"https://api.github.com/repos/go-ole/go-ole/issues/102/events","html_url":"https://github.com/go-ole/go-ole/pull/102","id":113820414,"number":102,"title":"Cannot use with IEnumVARIANT interface and _NewEnum property #99","user":{"login":"dtylman","id":5237465,"avatar_url":"https://avatars.githubusercontent.com/u/5237465?v=3","gravatar_id":"","url":"https://api.github.com/users/dtylman","html_url":"https://github.com/dtylman","followers_url":"https://api.github.com/users/dtylman/followers","following_url":"https://api.github.com/users/dtylman/following{/other_user}","gists_url":"https://api.github.com/users/dtylman/gists{/gist_id}","starred_url":"https://api.github.com/users/dtylman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dtylman/subscriptions","organizations_url":"https://api.github.com/users/dtylman/orgs","repos_url":"https://api.github.com/users/dtylman/repos","events_url":"https://api.github.com/users/dtylman/events{/privacy}","received_events_url":"https://api.github.com/users/dtylman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-10-28T13:25:23Z","updated_at":"2015-11-01T09:48:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/go-ole/go-ole/pulls/102","html_url":"https://github.com/go-ole/go-ole/pull/102","diff_url":"https://github.com/go-ole/go-ole/pull/102.diff","patch_url":"https://github.com/go-ole/go-ole/pull/102.patch"},"body":"Cannot use with IEnumVARIANT interface and _NewEnum property #99\r\n\r\nGot this working, see here:\r\n\r\n```go\r\nfunc hoho(){\r\n\truntime.LockOSThread()\r\n\tdefer runtime.UnlockOSThread()\r\n\r\n\terr := ole.CoInitializeEx(0,ole.COINIT_MULTITHREADED)\r\n\tif err != nil {\r\n\t\tcode := err.(*ole.OleError).Code()\r\n\t\tlogrus.Debugf(\"CoInitializeEx returned with %v\", err)\r\n\t\tif code == 0x00000001 { // The COM library is already initialized on this thread.\r\n\r\n\t\t} else {\r\n\t\t\tpanic(err)\r\n\t\t}\r\n\t}else {\r\n\t\tdefer ole.CoUninitialize()\r\n\t}\r\n\r\n\tcomserver, err := oleutil.CreateObject(\"WbemScripting.SWbemLocator\")\r\n\tif err != nil {\r\n\t\tlogrus.Errorf(\"CreateObject WbemScripting.SWbemLocator returned with %v\", err)\r\n\t\tpanic(err)\r\n\t}\r\n\tdefer comserver.Release()\r\n\r\n\tdispatch,err:= comserver.QueryInterface(ole.IID_IDispatch)\r\n\tif err != nil {\r\n\t\tlogrus.Errorf(\"context.iunknown.QueryInterface returned with %v\", err)\r\n\t\tpanic(err)\r\n\t}\r\n\tdefer dispatch.Release()\r\n\twbemServices := oleutil.MustCallMethod(dispatch, \"ConnectServer\")\r\n\tdefer wbemServices.Clear()\r\n\twbemServices_dispatch:= wbemServices.ToIDispatch()\r\n\tdefer wbemServices_dispatch.Release()\r\n\r\n\tobjectset:= oleutil.MustCallMethod(wbemServices_dispatch,\"ExecQuery\",\"SELECT * FROM WIN32_Process\")\r\n\tobjectset_dispatch:= objectset.ToIDispatch()\r\n\tif objectset_dispatch==nil{\r\n\t\tpanic(\"nil\")\r\n\t}\r\n\tos_enum:=oleutil.MustGetProperty(objectset_dispatch,\"_NewEnum\").ToIEnumVARIANT()\r\n\tfor tmp,l,err:=os_enum.Next(1);l>0;tmp,l,err=os_enum.Next(1){\r\n\t\tif err!=nil{\r\n\t\t\tpanic(err)\r\n\t\t}\r\n\t\ttmp_dispatch := tmp.ToIDispatch()\r\n\t\tdefer tmp_dispatch.Release()\r\n\t\tprops:=oleutil.MustGetProperty(tmp_dispatch,\"Properties_\")\r\n\t\tprops_dispatch:=props.ToIDispatch()\r\n\t\tdefer props_dispatch.Release()\r\n\t\tprops_enum:=oleutil.MustGetProperty(props_dispatch,\"_NewEnum\").ToIEnumVARIANT()\r\n\t\tprops_enum.Release()\r\n\t\tclass:=oleutil.MustGetProperty(tmp_dispatch,\"Name\").ToString()\r\n\t\tlogrus.Infof(\"Got %v\", class)\r\n\t}\r\n```"},"comment":{"url":"https://api.github.com/repos/go-ole/go-ole/issues/comments/152807774","html_url":"https://github.com/go-ole/go-ole/pull/102#issuecomment-152807774","issue_url":"https://api.github.com/repos/go-ole/go-ole/issues/102","id":152807774,"user":{"login":"dtylman","id":5237465,"avatar_url":"https://avatars.githubusercontent.com/u/5237465?v=3","gravatar_id":"","url":"https://api.github.com/users/dtylman","html_url":"https://github.com/dtylman","followers_url":"https://api.github.com/users/dtylman/followers","following_url":"https://api.github.com/users/dtylman/following{/other_user}","gists_url":"https://api.github.com/users/dtylman/gists{/gist_id}","starred_url":"https://api.github.com/users/dtylman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dtylman/subscriptions","organizations_url":"https://api.github.com/users/dtylman/orgs","repos_url":"https://api.github.com/users/dtylman/repos","events_url":"https://api.github.com/users/dtylman/events{/privacy}","received_events_url":"https://api.github.com/users/dtylman/received_events","type":"User","site_admin":false},"created_at":"2015-11-01T09:48:52Z","updated_at":"2015-11-01T09:48:52Z","body":"Pull the fix from master and it is working great.\r\n\r\nThanks !!"}}