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: Graham Fawcett
Subject: Re: [Chicken-users] Win32 COM with Chicken?
Date: Tue, 3 May 2005 16:31:15 -0400

On 5/3/05, felix winkelmann <address@hidden> wrote:
> 
> There is now reason not to use C++, though.

I've started on a little Chicken/OLE example, and have been able to
get quite far with just C, except for one thing: any idea how to
create a BSTR value from a Chicken string value?

For example, I've been able to get enough code together to make this
foreign-lambda work:

;; given a pointer to an OLE Automation object, make it Visible.
(define make-object-visible
  (foreign-lambda* void ((c-pointer object_ptr)) #<<END
                   BSTR property_name = L"Visible";
                   VARIANT value = int_variant(1);    // true
                   set_property(object_ptr, property_name, value);
END
))

But note the literal L"Visible" (which identifies a string constant as
a BSTR). I'd like to make a generic (set-property) that lets me pass
in "Visible" as an argument, but can't find a conversion
function(!)...

Maybe the answer is "use C++" ;-) but I'm curious to know if you have
any other ideas.

-- Graham




reply via email to

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