tag:blogger.com,1999:blog-284600789737488130.post2570687575167493586..comments2024-02-07T02:22:20.642-05:00Comments on Ruby on Windows: From VB to Ruby - Creating Objects via COMDavid Mullethttp://www.blogger.com/profile/05597492688893461137noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-284600789737488130.post-50348975393759189022010-10-30T07:51:03.452-05:002010-10-30T07:51:03.452-05:00strHost = "."
Const HKLM = &H8000000...strHost = "."<br />Const HKLM = &H80000002<br />Set objReg = GetObject("winmgmts://" & strHost & _<br /> "/root/default:StdRegProv")<br />Const strBaseKey = _<br /> "Software\Microsoft\Windows\CurrentVersion\Uninstall\"<br />objReg.EnumKey HKLM, strBaseKey, arrSubKeys<br /> <br />For Each strSubKey In arrSubKeys<br /> intRet = objReg.GetStringValue(HKLM, strBaseKey & strSubKey, _<br /> "DisplayName", strValue)<br /> If intRet <> 0 Then<br /> intRet = objReg.GetStringValue(HKLM, strBaseKey & strSubKey, _<br /> "QuietDisplayName", strValue)<br /> End If<br /> If (strValue <> "") and (intRet = 0) Then<br /> WScript.Echo strValue<br /> End If<br />Next<br /><br /><br />How to convert this VB script to ruby???Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-284600789737488130.post-74040364368160325332007-04-11T09:07:00.000-05:002007-04-11T09:07:00.000-05:00Good post again.The other post "Simple Output to E...Good post again.<BR/><BR/>The other post "Simple Output to Excel-compatible files" is a good idea too, to speed up the writes.<BR/><BR/>>Let me know if there's anything in particular you'd like to see.<BR/><BR/>Could you please post some about using Word with Ruby via OLE?<BR/><BR/>Great stuff ... I'll blog about your blog, also tell my friends about it ...<BR/><BR/>Vasudev Ram<BR/>Site: http://www.dancingbison.com<BR/>Blog: http://jugad.livejournal.comVasudev Ramhttps://www.blogger.com/profile/13568740634188042591noreply@blogger.comtag:blogger.com,1999:blog-284600789737488130.post-51297644445895340052007-02-23T22:36:00.000-05:002007-02-23T22:36:00.000-05:00Ruby's garbage collection usually does a good job ...Ruby's garbage collection usually does a good job cleaning up COM objects. Beyond simple scripts, though, I prefer to explicitly release the COM objects (xl = nil). In object hierarchies such as Excel, you'll want to release objects in reverse of the order created.David Mullethttps://www.blogger.com/profile/05597492688893461137noreply@blogger.comtag:blogger.com,1999:blog-284600789737488130.post-91486426939482504002007-02-23T10:23:00.000-05:002007-02-23T10:23:00.000-05:00Excellent example. Do you have to release the COM...Excellent example. Do you have to release the COM object when you're done with it? Or will the memory get cleaned up automatically?Unknownhttps://www.blogger.com/profile/00913860820521809825noreply@blogger.com