Thread overview | |||||
---|---|---|---|---|---|
|
February 08, 2014 BSTR to string? | ||||
---|---|---|---|---|
| ||||
Hi, I have an IHTMLElement and want the tag name. HRESULT get_tagName(ref BSTR); IHTMLElement htmlElement; BSTR tagName; ... htmlElement.get_tagName(tagName); writeln(to!string(*tagName)); I tried different combinations but the result is an number or a single character instead of the tag name. How to do the conversion correct? Kind regards André |
February 08, 2014 Re: BSTR to string? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andre | On Saturday, 8 February 2014 at 12:34:44 UTC, Andre wrote:
> Hi,
>
> I have an IHTMLElement and want the tag name.
> HRESULT get_tagName(ref BSTR);
>
>
> IHTMLElement htmlElement;
> BSTR tagName;
> ...
> htmlElement.get_tagName(tagName);
> writeln(to!string(*tagName));
>
> I tried different combinations but the result is an number
> or a single character instead of the tag name.
>
> How to do the conversion correct?
>
> Kind regards
> André
writeln(to!string(tagName[0 .. SysStringLen(tagName)]));
SysFreeString(tagName);
|
February 08, 2014 Re: BSTR to string? | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Chapman | Thanks a lot, this works great!
Kind regards
André
Am 08.02.2014 13:46, schrieb John Chapman:
> On Saturday, 8 February 2014 at 12:34:44 UTC, Andre wrote:
>> Hi,
>>
>> I have an IHTMLElement and want the tag name.
>> HRESULT get_tagName(ref BSTR);
>>
>>
>> IHTMLElement htmlElement;
>> BSTR tagName;
>> ...
>> htmlElement.get_tagName(tagName);
>> writeln(to!string(*tagName));
>>
>> I tried different combinations but the result is an number
>> or a single character instead of the tag name.
>>
>> How to do the conversion correct?
>>
>> Kind regards
>> André
>
> writeln(to!string(tagName[0 .. SysStringLen(tagName)]));
> SysFreeString(tagName);
|
Copyright © 1999-2021 by the D Language Foundation