Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 898935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:07:57+00:00 2026-05-15T15:07:57+00:00

Acoording to documentation , this property gives me a TCHAR, but when I see

  • 0

Acoording to documentation, this property gives me a TCHAR, but when I see the source code, this is the declaration:

    [DispId(1011)]
    ushort fontName { get; }

Anyway, I don’t know how to neither get a TCHAR from a ushort or get a string from a TCHAR. Anyone?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T15:07:57+00:00Added an answer on May 15, 2026 at 3:07 pm

    I see it, you’ve got a problem. The IDL declaration is

    [propget, id(DISPID_IHTMLCOMPUTEDSTYLE_FONTNAME)] HRESULT fontName([retval, out] TCHAR * p);
    

    Well, that’s technically possible, the caller would have to pass a pointer to a buffer of TCHAR that’s large enough to store the returned string. That is massively odd though, strings are almost always handled as BSTR in COM interfaces. TCHAR* would be an accident waiting to happen when the caller doesn’t pass a buffer that’s large enough. And TCHAR will be just plain wrong when the client program is compiled without UNICODE in effect.

    This has to be a bug, it should have been BSTR*. Or TCHAR**, a bit of a long shot. Another thing that’s really odd is that they assigned DispIDs to the methods but didn’t inherit the interface from IDispatch. That’s just plain pointless. I don’t think this was written by a MSFT programmer that knew what he was doing.

    The type library importer would indeed have no choice but to pick ushort as the return type, there is no way for it to guess that it is actually an array of characters. There’s is no MIDL attribute on the argument that says it is an array, another thing that’s really odd and hinting that the argument really is a BSTR*. Patching the import library is technically possible, you’d have to decompile it, edit the .il and put it back together with ilasm.exe. Of course, you cannot really do this to the standard PIA, you’d have to give up on that.

    No happy answers here, this is just plain wrong. Perhaps you can ping connect.microsoft.com to see what they think about it. Although they are liable to close it as “external”, in which case Microsoft Support is your only real recourse.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In order to achieve spriting by compass according to the documentation I wrote this:
According to the documentation for -[UIView setNeedsLayout] : Because this method does not force
According to the documentation for the datepicker, the yearRange property determines the range shown
I'm trying to do something like this... <Style x:Key="MyBorderStyle" TargetType="Border"> <Setter Property="Padding" Value="{TemplateBinding Padding}"
According to the MSDN documentation ( http://msdn.microsoft.com/en-us/library/ms172987.aspx ), the My.Application.Log property is used to
according to this post and from OpenCV documentation, I can initialize and access each
According to documentation , UIWebView delegate property needs to be set to nil before
From the ExtJS documentation: flex : Number This configuration option is to be applied
I posted this question on the Qt forum, but got no answers. That's why
I made a UserControl that has a Property of type RotateFlipType , this control

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.