COM Widestring Value Issue
Question:
I need to do myobject.myproperty= "hello as a wide string"
lpwstr is used once in the doc. Is that a winbatch limitation or is there a turn around?
Answer:
All strings passed to COM objects and methods are converted to Unicode stings by WinBatch
and they have been since WinBatch first added OLE support. If you see object documentation
that references LPWSTR, it is possibly referring to dual interfaces. Dual interface objects
can be early bound using a byte compiled language like c/c++ or VB or they can be late bound
using the Dispatch interface. WB is a scripting language like VBS or Perl and supports late
binding. If you have an object with a dual interface or just the Dispatch interface, LPWSTRs
are dealt with automagically. However, if you have an object that only supports early binding,
you can not use it directly in WB or VBS or almost any other scripting language so support for
LPWSTRs is a non-issue.
Article ID: W17088
File Created: 2007:07:03:14:28:16
Last Updated: 2007:07:03:14:28:16