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; } |