Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Retaining type short for COM interop

COM IDFs sometimes declare API elements as having type short. However, most .NET APIs are favor type int  (i.e., Int32).  You will generally use an integer in a .NET API where you used a short in a COM API.  Consequently, the default IDF files prepared by gmBasic will Integer instead of Short.  

However, if you are planning to use interop as the upgrade strategy for a COM API, you will need to retain type Short in your IDF so it that short will be used in the translations.  Retaining a short in an IDF is done by passing TypeInteger=short on the command line when you generate the IDFs for those particular COM files.    The IDF generation process is mostly automated, but you can find the command line string for generating an IDF in the gmStudio application settings, gmStudio.cfg, file.  It is the variable IdlToXmlCmd:

Default (short in the IDL to an Integer in the IDF)
IdlToXmlCmd = "cmd.exe /C pushd '%IdfFromIdlFolder%' && '%TranToolExe%' '%SrcIdlPath%' >> '%LogPath%' ...
 
Modified (short in the IDL to an Short in the IDF)
IdlToXmlCmd = "cmd.exe /C pushd '%IdfFromIdlFolder%' && '%TranToolExe%' '%SrcIdlPath%' TypeInteger=short >> '%LogPath%' ...



  • No labels