Jump to content

_µ_

Members
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral

About _µ_

  • Rank
    Newbrie
  1. In the PluginAPI.h file (no version id in the file) the plgName function is declared as returning the type LPCTSTR (long pointer to const T string). As a convenience for porting, the placeholder "T" changes for ANSI, Multibyte, and Unicode builds according to preprocessor definitions. So, the recommended (and common) way to code plgName is this: PLUGIN_API LPCTSTR plgName( void ) { // called by gui thread - sim thread not running return TEXT("MySbPlugin"); // app.Name(); } Unfortunately, that results in the plugin name appearing as the single character "M". I assume this is because the IDE isn't expecting a unicode string, and interprets the second byte returned ('0x0') as an end of string. I tried altering my implementation of plgName to: PLUGIN_API LPCTSTR plgName( void ) { // called by gui thread - sim thread not running return (LPCTSTR)"MySbPlugin"; // app.Name(); } This works fine, and the full name of the plugin appears. The bad news is, at least in unicode builds, that's a bad cast. Basically, if the API isn't expecting unicode strings it shouldn't be using the "T" preprocessor definitions. Thanks, µ
  2. How large is the buffer that is provided in the plgSave callback? I'd like to avoid blowing it out.
  3. Is the support for templates documented somewhere? I'm a long-time C++ developer and somewhat uninterested in going back to pure C; a strong addition to metaprogramming with templates being one of the reasons.
×