Hi, I was going to modify the TaskScheduler#save method to take an optional file name. But, I need to convert a Ruby string to an OLE string. I thought I could use this: http://msdn.microsoft.com/en-us/library/ms692615(VS.85).aspx But, it only appears to accept literal string constants. Any other suggestions? Thanks, Dan
Hi Dan, I haven''t had to do this in many years, but when I did the _bstr_t routines were what I used: http://msdn.microsoft.com/en-us/library/aa278285(VS.60).aspx An OLE string is really a BSTR isn''t it? Anyway, this is all from memory, so I hope it''s appropriate for what you''re trying to do. Take care, Wayne On Sun, May 11, 2008 at 12:23 PM, Daniel Berger <djberg96 at gmail.com> wrote:> Hi, > > I was going to modify the TaskScheduler#save method to take an optional > file name. But, I need to convert a Ruby string to an OLE string. I thought > I could use this: > > http://msdn.microsoft.com/en-us/library/ms692615(VS.85).aspx > > But, it only appears to accept literal string constants. > > Any other suggestions? > > Thanks, > > Dan > > _______________________________________________ > win32utils-devel mailing list > win32utils-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/win32utils-devel >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/win32utils-devel/attachments/20080511/7ef4e3c2/attachment.html>
Wayne Vucenic wrote:> Hi Dan, > > I haven''t had to do this in many years, but when I did the _bstr_t > routines were what I used: > > http://msdn.microsoft.com/en-us/library/aa278285(VS.60).aspx > > An OLE string is really a BSTR isn''t it? Anyway, this is all from > memory, so I hope it''s appropriate for what you''re trying to do.Thanks, that worked! For the record I had to add comutil.h to the included header files, and add both comsupp.lib and comsuppwd.lib to $LIBS in the extconf.rb file. Regards, Dan
Great. Glad it worked! Working with OLE strings was a real pain until I found _bstr_t, which made it pretty easy. Take care, Wayne On Sun, May 11, 2008 at 2:40 PM, Daniel Berger <djberg96 at gmail.com> wrote:> Wayne Vucenic wrote: > > > Hi Dan, > > I haven''t had to do this in many years, but when I did the _bstr_t > > routines were what I used: > > http://msdn.microsoft.com/en-us/library/aa278285(VS.60).aspx > > An OLE string is really a BSTR isn''t it? Anyway, this is all from > > memory, so I hope it''s appropriate for what you''re trying to do. > > > > Thanks, that worked! > > For the record I had to add comutil.h to the included header files, and > add both comsupp.lib and comsuppwd.lib to $LIBS in the extconf.rb file. > > Regards, > > > Dan > _______________________________________________ > win32utils-devel mailing list > win32utils-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/win32utils-devel >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/win32utils-devel/attachments/20080511/800ad629/attachment.html>