Comparison of MapX in OCX import classes of VC and C ++ builder.

Source: Internet
Author: User
The following is a comparison between VC ++ and CB's OCX import class. We can see how troublesome it is to use OCX for CB. It seems that using CB for MapX is an incorrect choice.
Declared return value: tautoargs <0> _ ARGs, while VC uses double result;
Proxy method: olepropertyget (_ dispid, _ ARGs); While VC uses getproperty (0x5, vt_r8, (void *) & result );
Return: Return _ args. getretvariant (); While VC uses return result;

C ++ Builder VC ++
extract content from ocx_h
interface cmapxrectangle: Public tdispwrapper
{....
double/* [vt_r8: 0] */_ fastcall get_height ()
{< br> _ tdispid _ dispid (/* height */dispid (5);
tautoargs <0> _ ARGs;
olepropertyget (_ dispid, _ ARGs);
return _ args. getretvariant ();
}< br>...
}< br> lib_h excerpt:
template void _ fastcall
cmapxrectangledispt :: set_height (double/* [vt_r8: 0] */value)
{< br> _ tdispid _ dispid (* This, oletext ("height "), dispid (5);
tautoargs <1> _ ARGs;
_ ARGs [1] = value;
olepropertyput (_ dispid, _ ARGs );
}
double ccmapxrectangle: getheight ()
{< br> double result;
getproperty (0x5, vt_r8, (void *) & result );
return result;
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.