chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Win32 COM with Chicken?


From: felix winkelmann
Subject: Re: [Chicken-users] Win32 COM with Chicken?
Date: Thu, 5 May 2005 23:05:59 +0200

On 5/4/05, Graham Fawcett <address@hidden> wrote:
> 
> To answer my own question:
> 
> BSTR schemeStringToBstr(char *scheme_string) {
>   // don't forget to SysFreeString(retval)!
>   int count = strlen(scheme_string);
>   BSTR retval = SysAllocStringLen(NULL, count);
>   MultiByteToWideChar(CP_UTF8, 0, scheme_string, count, retval, count);
>   return(retval);
> }
> 
> (Sorry for adding noise to the list.)
> 

No need to be sorry at all. Actually, I'd love to help as much as I can
with this project. If you can wait for a few days, I can provide a small
utility library for COM things (BSTRs, GUIDs, registry access, etc.).
BTW, couldn't BSTRs be allocated in the Scheme heap, using (for example)
u16vectors? That would remove the need for doing all the SysAlloc/SysFree
stuff.


cheers,
elix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]