--- In [email protected], "Sheri" <sheri...@...> wrote:
> Works now. Bravo! > > > > > Meanwhile, what about strings returned as results of methods or > > get? One possible route: strings are always returned from COM > > operations as WCHAR* (BSTR, same thing). Until now always > > converted to ANSI. > > > > Instead I can inspect WCHAR* string for any WCHAR > 255, which > > can't be stored in a CHAR* string. If any found, return a handle > > to a unicode string instead (providing user has unicode plugin > > installed). No user control, it's just done. > > > > Whatya think? > > > I need to give this some thought. Checking for WCHAR > 255 sounds good, but > possibly (usually?) adds unnessary overhead. Maybe the behavior should > continue to default to existing ANSI/string conversion. If the user wants it > in unicode, could the user somehow provide a unicode handle? Something > similar to what we do to get a vector filled by the regex plugin? I agree, not ideal, adds some overhead (but only cost of scanning a returned string, and the scan is simple: strlen probably has about the same overhead, and I use that without thinking). The problem with relevant services (method, etc) is that there isn't a limit on number of arguments user can provide (except the inbuilt PowerPro max args simit), ao no way to add a another parameter meaning "do this with unicode". Can use the typed variants of method, etc, but then you lose the cleverness Bruce allows of handle.op (which has to work through method service, not method_typed: you can only register one service as the handler for han.op). For same reason a set of services (methodu, getu, etc) would be possible, but couldn't be used with syntactic sugar. Okay, other topic. Whenever I retrun an object (com handle) from method, get, I set com_type to "object". It could be, instead, the name I retrieve from GetDocumentation One step further: at the moment don;t set com_type for create_object, get_object. I could, filling it with same name (I've tried it, object name is nothing like the "Scripting.FileSystemObject" monikers used to access object). Don't think the same possible for get_interface.
