MaxSDK::Util Namespace Reference

Namespaces

 DebugHelpers
 
 TextFile
 

Classes

class  AutoPtr
 Old AutoPtr class, maintained to support backwards compatibility. More...
 
class  BinaryStream
 Represent an abstract binary stream of data. More...
 
class  BinaryStreamMemory
 Holds binary data in memory only. More...
 
class  Char
 Represents a single Unicode character. More...
 
class  CharAccumulator
 Character accumulator. More...
 
class  CharIterator
 Iterate intelligently inside a string. More...
 
class  Exception
 Base exception class for 3ds Max. More...
 
class  IBailOutBusyProcessManager
 An interface of bailing out the busy processing functions by pressing the 'Esc' key. More...
 
class  IDlgShowingStatusForPolyObj
 A pure virtual interface for Poly Object's UI as dialog Showing Status. More...
 
class  ITipSystem
 An interface of giving users a tip . More...
 
class  MaxString
 Stores all the strings inside CStr and WStr. More...
 
class  MaxStringCast
 A MaxStringCast is used when casting a MaxString to a type. More...
 
class  MaxStringCastCP
 A Utility class for helping to convert to a specified code page. More...
 
class  MaxStringCastUTF8
 A Utility class for helping to convert to UTF8. More...
 
class  Noncopyable
 Noncopyable is a handy utility mix-in base class that makes any class derived from it non-copyable. More...
 
class  NullDereferenceException
 Thrown when a null pointer is dereferenced. More...
 
class  OutOfRangeException
 Thrown when an out of bounds index is detected. More...
 
class  Path
 Path type - adds path-operation richness over symbol strings. More...
 
class  RunTimeException
 General multi-purpose exception for runtime errors. More...
 
class  ScopedTrace
 A diagnostic class used for tracing. More...
 
struct  StaticAssert
 An assert that works at compile time. More...
 
struct  StaticAssert< true >
 
class  StopWatch
 A basic timer tool. More...
 
class  TabOutOfRangeException
 Thrown when an invalid index is passed into Tab::operator[] or Tab::Addr. More...
 

Enumerations

enum  BinaryStreamMode {
  BINARYSTREAM_MODE_READ = 1 << 0, BINARYSTREAM_MODE_WRITE = 1 << 1, BINARYSTREAM_MODE_APPEND = 1 << 2, BINARYSTREAM_MODE_TRUNCATE = 1 << 3,
  BINARYSTREAM_MODE_CREATE = 1 << 4, BINARYSTREAM_MODE_TEXT = 1 << 5, BINARYSTREAM_MODE_BINARY = 1 << 6, BINARYSTREAM_MODE_EXCLUSIVE = 1 << 7,
  BINARYSTREAM_MODE_COMMIT = 1 << 8, BINARYSTREAM_MODE_TEMPORARY = 1 << 9, BINARYSTREAM_MODE_DELETE = 1 << 10, BINARYSTREAM_MODE_SEQUENTIAL_SCAN = 1 << 11,
  BINARYSTREAM_MODE_RANDOM_ACCESS = 1 << 12
}
 Enum describing file open mode options. More...
 
enum  MaxStringDataEncoding { MSDE_CP_UTF16 = 65012, MSDE_CP_ASCII = 65013, MSDE_CP_UCS4 = 65014, MSDE_CP_MASK = 0x0fffffff }
 String encodings used in the MaxString class. More...
 

Functions

UtilExport MaxString VariantToString (const PROPVARIANT *, UINT encoding=CP_ACP, USHORT flags=0)
 Convert a variant into a string. More...
 
UtilExport bool VariantIsString (const PROPVARIANT *)
 Determine if a variant is already a string. More...
 
UtilExport bool VariantIsStringVector (const PROPVARIANT *)
 Determine if a variant is a vector of string. More...
 
template<typename T >
size_t VariantToStringVector (const PROPVARIANT *, std::vector< T > &, UINT encoding=CP_ACP)
 Convert a variant into a std::vector. More...
 
template UtilExport size_t VariantToStringVector< MaxString > (const PROPVARIANT *, std::vector< MaxString > &, UINT encoding)
 
template UtilExport size_t VariantToStringVector< CStr > (const PROPVARIANT *, std::vector< CStr > &, UINT encoding)
 
template UtilExport size_t VariantToStringVector< WStr > (const PROPVARIANT *, std::vector< WStr > &, UINT encoding)
 
UtilExport bool SetStringToVariant (PROPVARIANT *, const char *str, bool clear=true)
 Sets a string inside a variant. More...
 
UtilExport bool SetStringToVariant (PROPVARIANT *, const wchar_t *str, bool clear=true)
 Sets a string inside a variant. More...
 
UtilExport bool VariantAddToVector (PROPVARIANT *v, const char *, UINT encoding=CP_ACP)
 Add a string entry at the end of a variant vector. More...
 
UtilExport bool VariantAddToVector (PROPVARIANT *v, const wchar_t *, UINT encoding=CP_ACP)
 Add a string entry at the end of a variant vector. More...
 
UtilExport bool VariantAddToVector (PROPVARIANT *v, const PROPVARIANT *, bool give=false, UINT encoding=CP_ACP)
 Add an entry at the end of a variant vector. More...
 
UtilExport bool DoesVariantContainWideChars (const PROPVARIANT *variant)
 Determine if a variant contains wide-chars. More...
 
UtilExport bool VariantConvertToUTF16 (PROPVARIANT *destVar, const PROPVARIANT *sourceVar, UINT codePage=CP_ACP)
 Convert a variant to UTF16. More...
 
UtilExport bool VariantConvertToMBCS (PROPVARIANT *destVar, const PROPVARIANT *sourceVar, UINT codePage=CP_ACP)
 Convert a variant to MBCS. More...
 
MaxString VariantToString (const VARIANT *v, UINT encoding=CP_ACP, USHORT flags=0)
 
MaxString VariantToString (const PROPVARIANT &v, UINT encoding=CP_ACP, USHORT flags=0)
 
MaxString VariantToString (const VARIANT &v, UINT encoding=CP_ACP, USHORT flags=0)
 
bool VariantIsStringVector (const VARIANT *v)
 
bool VariantIsStringVector (const PROPVARIANT &v)
 
bool VariantIsStringVector (const VARIANT &v)
 
size_t VariantToStringVector (const VARIANT *v, std::vector< MaxString > &ov, UINT encoding=CP_ACP)
 
size_t VariantToStringVector (const PROPVARIANT &v, std::vector< MaxString > &ov, UINT encoding=CP_ACP)
 
size_t VariantToStringVector (const VARIANT &v, std::vector< MaxString > &ov, UINT encoding=CP_ACP)
 
UtilExport void UseLanguagePackLocale (HMODULE hMyModule=reinterpret_cast< HMODULE >(&__ImageBase))
 Sets the locale for a DLL or thread to match that of the language pack being used at 3ds Max start up. More...
 
UtilExport WORD GetLanguageID ()
 Returns the identifier of the language used by 3ds Max. More...
 
UtilExport LANGID GetLocaleValue ()
 Returns the locale ID value that is being used by 3ds Max, as set by the language pack being used at runtime. More...
 
UtilExport const MCHARGetLocaleValueAsHexString ()
 Returns the locale ID value that is being used by 3ds Max, as set by the language pack being used at runtime. More...
 
UtilExport const MCHARGetLanguageTLA ()
 Returns the "three letter acronym" (TLA) of the language used by 3ds Max. More...
 
UtilExport const MCHARGetLanguagePackDirName ()
 Returns the two-two (eg "en-US" or "ja-JP") language pack directory for the language pack in use by 3ds Max. More...
 
UtilExport UINT CodePageForLanguage (LANGID)
 Returns the code page corresponding to the specified locale value. More...
 
UtilExport bool CopyToClipBoard (const MCHAR *text, HWND hwnd)
 copies a string to the system wide clipboard More...
 
UtilExport bool ScanDirectoryTree (const MCHAR *treeroot, const MCHAR *filename, MSTR &targetpath)
 
UtilExport MSTR CaptureCallStack (int skipFirstNStackLevels=3, int maxStackLevels=-1)
 
UtilExport IBailOutBusyProcessManagerGetBailOutManager ()
 
UtilExport IDlgShowingStatusForPolyObjGetDlgShowingStatusForPolyObj ()
 
UtilExport BOOL WritePrivateProfileString (LPCTSTR lpAppName, LPCTSTR lpKeyName, LPCTSTR lpString, LPCTSTR lpFileName)
 These service should replace every occurrence of the standard WIN32 implementation. More...
 
UtilExport BOOL WritePrivateProfileStruct (LPCTSTR lpszSection, LPCTSTR lpszKey, LPVOID lpStruct, UINT uSizeStruct, LPCTSTR lpFileName)
 Copies data into a key in the specified section of an initialization file. More...
 
UtilExport BOOL WritePrivateProfileSection (LPCTSTR lpAppName, LPCTSTR lpString, LPCTSTR lpFileName)
 Replaces the keys and values for the specified section in an initialization file. More...
 
TipSystemExport ITipSystemGetTipSystem ()
 

Enumeration Type Documentation

Enum describing file open mode options.

Enumerator
BINARYSTREAM_MODE_READ 

Allow reading from a stream.

BINARYSTREAM_MODE_WRITE 

Allow writing to a stream.

BINARYSTREAM_MODE_APPEND 

When opened, a stream is positioned at the end.

BINARYSTREAM_MODE_TRUNCATE 

When opened, the stream is truncated.

BINARYSTREAM_MODE_CREATE 

If the underlying file doesn't exist, it will create it.

BINARYSTREAM_MODE_TEXT 

Specify that the underlying data should be interpreted as text.

Technically, BinaryStream doesn't do anything with that flag. It's was made to use in conjunction with TextFile::Reader and TextFile::Writer.

BINARYSTREAM_MODE_BINARY 

Specify that the underlying data should be considered binary.

BINARYSTREAM_MODE_EXCLUSIVE 

By default, when a file is opened, another process always have the possibility to open the same file concurrently for reading.

When this flag is present, it will prevent another process to to open it.

BINARYSTREAM_MODE_COMMIT 

Write operations will not go through any intermediate cache, they will go directly to disk.

BINARYSTREAM_MODE_TEMPORARY 

The file is being used for temporary storage.

BINARYSTREAM_MODE_DELETE 

The file is to be deleted immediately after all of its handles are closed.

BINARYSTREAM_MODE_SEQUENTIAL_SCAN 

Access is intended to be sequential from beginning to end.

BINARYSTREAM_MODE_RANDOM_ACCESS 

Access is intended to be random.

27 {
29  BINARYSTREAM_MODE_READ = 1 << 0,
30 
32  BINARYSTREAM_MODE_WRITE = 1 << 1,
33 
35  BINARYSTREAM_MODE_APPEND = 1 << 2,
36 
39 
41  BINARYSTREAM_MODE_CREATE = 1 << 4,
42 
49  BINARYSTREAM_MODE_TEXT = 1 << 5,
50 
52  BINARYSTREAM_MODE_BINARY = 1 << 6,
53 
61 
63  BINARYSTREAM_MODE_COMMIT = 1 << 8,
64 
67 
69  BINARYSTREAM_MODE_DELETE = 1 << 10,
70 
73 
76 };
The file is being used for temporary storage.
Definition: maxbinarystream.h:66
Specify that the underlying data should be interpreted as text.
Definition: maxbinarystream.h:49
By default, when a file is opened, another process always have the possibility to open the same file ...
Definition: maxbinarystream.h:60
Allow reading from a stream.
Definition: maxbinarystream.h:29
When opened, a stream is positioned at the end.
Definition: maxbinarystream.h:35
When opened, the stream is truncated.
Definition: maxbinarystream.h:38
Access is intended to be random.
Definition: maxbinarystream.h:75
The file is to be deleted immediately after all of its handles are closed.
Definition: maxbinarystream.h:69
Allow writing to a stream.
Definition: maxbinarystream.h:32
If the underlying file doesn't exist, it will create it.
Definition: maxbinarystream.h:41
Write operations will not go through any intermediate cache, they will go directly to disk...
Definition: maxbinarystream.h:63
Access is intended to be sequential from beginning to end.
Definition: maxbinarystream.h:72
Specify that the underlying data should be considered binary.
Definition: maxbinarystream.h:52

String encodings used in the MaxString class.

In addition to the standard Windows constants like CP_ACP, CP_UTF8, etc... The following constants can also be used as encoding.

Enumerator
MSDE_CP_UTF16 

Encoding for UTF16.

This is 2 - 4 bytes per character.

MSDE_CP_ASCII 

Encoding for windows code pages with 1 byte per character.

This encoding only recognizes characters up to 127.

MSDE_CP_UCS4 

Encoding up to 4 bytes per character.

MSDE_CP_MASK 

Mask for use in testing encoding.

34  {
35  MSDE_CP_UTF16 = 65012,
36  MSDE_CP_ASCII = 65013,
37  MSDE_CP_UCS4 = 65014,
38  MSDE_CP_MASK = 0x0fffffff,
39 };
Mask for use in testing encoding.
Definition: maxstring.h:38
Encoding up to 4 bytes per character.
Definition: maxstring.h:37
Encoding for windows code pages with 1 byte per character.
Definition: maxstring.h:36
Encoding for UTF16.
Definition: maxstring.h:35

Function Documentation

UtilExport MaxString MaxSDK::Util::VariantToString ( const PROPVARIANT *  ,
UINT  encoding = CP_ACP,
USHORT  flags = 0 
)

Convert a variant into a string.

For flags, see VariantConvertType inside MSDN for a list of possible values.

UtilExport bool MaxSDK::Util::VariantIsString ( const PROPVARIANT *  )

Determine if a variant is already a string.

UtilExport bool MaxSDK::Util::VariantIsStringVector ( const PROPVARIANT *  )

Determine if a variant is a vector of string.

size_t MaxSDK::Util::VariantToStringVector ( const PROPVARIANT *  ,
std::vector< T > &  ,
UINT  encoding = CP_ACP 
)

Convert a variant into a std::vector.

template UtilExport size_t MaxSDK::Util::VariantToStringVector< MaxString > ( const PROPVARIANT *  ,
std::vector< MaxString > &  ,
UINT  encoding 
)
template UtilExport size_t MaxSDK::Util::VariantToStringVector< CStr > ( const PROPVARIANT *  ,
std::vector< CStr > &  ,
UINT  encoding 
)
template UtilExport size_t MaxSDK::Util::VariantToStringVector< WStr > ( const PROPVARIANT *  ,
std::vector< WStr > &  ,
UINT  encoding 
)
UtilExport bool MaxSDK::Util::SetStringToVariant ( PROPVARIANT *  ,
const char *  str,
bool  clear = true 
)

Sets a string inside a variant.

Parameters
strString. Copied inside this object.
clearIf true, will perform a VariantClear on the variant.
UtilExport bool MaxSDK::Util::SetStringToVariant ( PROPVARIANT *  ,
const wchar_t *  str,
bool  clear = true 
)

Sets a string inside a variant.

Parameters
strString. Copied inside this object.
clearIf true, will perform a VariantClear on the variant.
UtilExport bool MaxSDK::Util::VariantAddToVector ( PROPVARIANT *  v,
const char *  ,
UINT  encoding = CP_ACP 
)

Add a string entry at the end of a variant vector.

Supported variant types are:

  • VT_VECTOR | VT_LPSTR
  • VT_VECTOR | VT_LPWSTR
  • VT_VECTOR | VT_VARIANT
UtilExport bool MaxSDK::Util::VariantAddToVector ( PROPVARIANT *  v,
const wchar_t *  ,
UINT  encoding = CP_ACP 
)

Add a string entry at the end of a variant vector.

Supported variant types are:

  • VT_VECTOR | VT_LPSTR
  • VT_VECTOR | VT_LPWSTR
  • VT_VECTOR | VT_VARIANT
UtilExport bool MaxSDK::Util::VariantAddToVector ( PROPVARIANT *  v,
const PROPVARIANT *  ,
bool  give = false,
UINT  encoding = CP_ACP 
)

Add an entry at the end of a variant vector.

Supported variant types are:

  • VT_VECTOR | VT_LPSTR
  • VT_VECTOR | VT_LPWSTR
  • VT_VECTOR | VT_VARIANT
UtilExport bool MaxSDK::Util::DoesVariantContainWideChars ( const PROPVARIANT *  variant)

Determine if a variant contains wide-chars.

UtilExport bool MaxSDK::Util::VariantConvertToUTF16 ( PROPVARIANT *  destVar,
const PROPVARIANT *  sourceVar,
UINT  codePage = CP_ACP 
)

Convert a variant to UTF16.

No matter what happens, the source variant is left intact. And you have the responsability to free the destination variant.

Parameters
destVarThe destination variant.
sourceVarThe source variant.
codePageAny data stored in "sourceVar" is considered in that codepage.
UtilExport bool MaxSDK::Util::VariantConvertToMBCS ( PROPVARIANT *  destVar,
const PROPVARIANT *  sourceVar,
UINT  codePage = CP_ACP 
)

Convert a variant to MBCS.

No matter what happens, the source variant is left intact. And you have the responsability to free the destination variant.

Parameters
destVarThe destination variant.
sourceVarThe source variant.
codePageAny data stored in "sourceVar" is considered to be in ACP. Codepage serves as a destination codepage. All ACP data will be converted to that codepage.
MaxString MaxSDK::Util::VariantToString ( const VARIANT *  v,
UINT  encoding = CP_ACP,
USHORT  flags = 0 
)
inline
125 { return VariantToString((PROPVARIANT*)v, encoding, flags); }
MaxString VariantToString(const VARIANT &v, UINT encoding=CP_ACP, USHORT flags=0)
Definition: maxvariant.h:127
MaxString MaxSDK::Util::VariantToString ( const PROPVARIANT &  v,
UINT  encoding = CP_ACP,
USHORT  flags = 0 
)
inline
126 { return VariantToString(&v, encoding, flags); }
MaxString VariantToString(const VARIANT &v, UINT encoding=CP_ACP, USHORT flags=0)
Definition: maxvariant.h:127
MaxString MaxSDK::Util::VariantToString ( const VARIANT &  v,
UINT  encoding = CP_ACP,
USHORT  flags = 0 
)
inline
127 { return VariantToString((PROPVARIANT*)&v, encoding, flags); }
MaxString VariantToString(const VARIANT &v, UINT encoding=CP_ACP, USHORT flags=0)
Definition: maxvariant.h:127
bool MaxSDK::Util::VariantIsStringVector ( const VARIANT *  v)
inline
129 { return VariantIsStringVector((PROPVARIANT*)v); }
bool VariantIsStringVector(const VARIANT &v)
Definition: maxvariant.h:131
bool MaxSDK::Util::VariantIsStringVector ( const PROPVARIANT &  v)
inline
130 { return VariantIsStringVector(&v); }
bool VariantIsStringVector(const VARIANT &v)
Definition: maxvariant.h:131
bool MaxSDK::Util::VariantIsStringVector ( const VARIANT &  v)
inline
131 { return VariantIsStringVector((PROPVARIANT*)&v); }
bool VariantIsStringVector(const VARIANT &v)
Definition: maxvariant.h:131
size_t MaxSDK::Util::VariantToStringVector ( const VARIANT *  v,
std::vector< MaxString > &  ov,
UINT  encoding = CP_ACP 
)
inline
133 { return VariantToStringVector((PROPVARIANT*)v, ov, encoding); }
size_t VariantToStringVector(const VARIANT &v, std::vector< MaxString > &ov, UINT encoding=CP_ACP)
Definition: maxvariant.h:135
size_t MaxSDK::Util::VariantToStringVector ( const PROPVARIANT &  v,
std::vector< MaxString > &  ov,
UINT  encoding = CP_ACP 
)
inline
134 { return VariantToStringVector(&v, ov, encoding); }
size_t VariantToStringVector(const VARIANT &v, std::vector< MaxString > &ov, UINT encoding=CP_ACP)
Definition: maxvariant.h:135
size_t MaxSDK::Util::VariantToStringVector ( const VARIANT &  v,
std::vector< MaxString > &  ov,
UINT  encoding = CP_ACP 
)
inline
135 { return VariantToStringVector((PROPVARIANT*)&v, ov, encoding); }
size_t VariantToStringVector(const VARIANT &v, std::vector< MaxString > &ov, UINT encoding=CP_ACP)
Definition: maxvariant.h:135
UtilExport void MaxSDK::Util::UseLanguagePackLocale ( HMODULE  hMyModule = reinterpret_cast< HMODULE >(&__ImageBase))

Sets the locale for a DLL or thread to match that of the language pack being used at 3ds Max start up.

This method must be called as soon as possible in the start up sequence of any DLL that may use localized resources, that is, in the DllMain() call in the DLL_PROCESS_ATTACH execution block.

As for threads, this method must be called as early as possible in the routine indicated in _beginthread() or _beginthreadex()'s start address parameter. Other thread launch calls most likely allow the thread to inherit the value set in DllMain(), but it would be a good precaution to not rely on this mechanism and instead call the method, as there is no harm in calling it more than once.

Calling this method is required in the cases above in order that 3ds Max loads files and Win32 resources from a satellite DLL installed by a language pack that may not match the locale of the OS when running in Vista or higher. Otherwise, the product might run with localized resources retrieved from different satellite DLL sets, resulting in a mix of different languages and/or different locale settings.

However, if localized resources are not handled by the binary in question, or the binary is unilingual (ie usually that means 'English only'), then this call is probably not required. This call is meant to be used with Microsoft's MUI technology, but not exclusively.

This method complements the other locale and language retrieval functions in the MaxSDK.

The hMyModule param is used internally for tracking the loading of dlls for debugging purposes, and should not be specified.

UtilExport WORD MaxSDK::Util::GetLanguageID ( )

Returns the identifier of the language used by 3ds Max.

This method complements MaxSDK::Util::GetLanguageTLA.

The language identifier is made up of a primary language identifier and a sublanguage identifier, both of which are from a set pre-defined identifiers that are part of the Windows Platform SDK.

For more information on language identifiers see National Language Support (on MSDN)

UtilExport LANGID MaxSDK::Util::GetLocaleValue ( )

Returns the locale ID value that is being used by 3ds Max, as set by the language pack being used at runtime.

It is returned as a LANGID (WORD). Ex: 409 (in hex) is what it will return for English-United States.

UtilExport const MCHAR* MaxSDK::Util::GetLocaleValueAsHexString ( )

Returns the locale ID value that is being used by 3ds Max, as set by the language pack being used at runtime.

It is returned as a string. Ex: "409" (without the quotes) is what it will return for English-United States.

UtilExport const MCHAR* MaxSDK::Util::GetLanguageTLA ( )

Returns the "three letter acronym" (TLA) of the language used by 3ds Max.

This method complements MaxSDK::Util::GetLanguageID. For more information on TLA see List of Windows XP's Three Letter Acronyms for Languages

Returns
The TLA of the language used by 3ds Max.
UtilExport const MCHAR* MaxSDK::Util::GetLanguagePackDirName ( )

Returns the two-two (eg "en-US" or "ja-JP") language pack directory for the language pack in use by 3ds Max.

This method complements MaxSDK::Util::GetLanguageID.

Returns
The Language Pack directory name of the language used by 3ds Max.
UtilExport UINT MaxSDK::Util::CodePageForLanguage ( LANGID  )

Returns the code page corresponding to the specified locale value.

Returns code page for GetLanguageID() if the locale value is not valid. To get the locale value for the code page use GetLocaleValue()

Returns
Code page for the given locale value
UtilExport bool MaxSDK::Util::CopyToClipBoard ( const MCHAR text,
HWND  hwnd 
)

copies a string to the system wide clipboard

Parameters
text- The string to copy
hwnd- The Window that owns the original information to be copied
UtilExport bool MaxSDK::Util::ScanDirectoryTree ( const MCHAR treeroot,
const MCHAR filename,
MSTR targetpath 
)
UtilExport MSTR MaxSDK::Util::CaptureCallStack ( int  skipFirstNStackLevels = 3,
int  maxStackLevels = -1 
)
UtilExport IBailOutBusyProcessManager* MaxSDK::Util::GetBailOutManager ( )
UtilExport IDlgShowingStatusForPolyObj* MaxSDK::Util::GetDlgShowingStatusForPolyObj ( )
UtilExport BOOL MaxSDK::Util::WritePrivateProfileString ( LPCTSTR  lpAppName,
LPCTSTR  lpKeyName,
LPCTSTR  lpString,
LPCTSTR  lpFileName 
)

These service should replace every occurrence of the standard WIN32 implementation.

The WIN32 implementation specifies that when the file name contains UNICODE character, the file will be created with a UNICODE BOM. This is ABSOLUTLY INCORRECT!!! In order to properly save UNICODE INI file, we need to enforce that every INI file has a BOM token. Copies a string into the specified section of an initialization file. This service will create the new INI file with a UTF-16LE and delegate to WIN32 implementation to actually write the new key value pair. If the INI file exist and is not a UNICODE file, it will be re-created as a UTF-16LE and the key|value pair will be written in the proper section.

Parameters
lpAppNameThe name of the section to which the string will be copied. If the section does not exist, it is created. The name of the section is case-independent; the string can be any combination of uppercase and lowercase letters.
lpKeyNameThe name of the key to be associated with a string. If the key does not exist in the specified section, it is created. If this parameter is NULL, the entire section, including all entries within the section, is deleted.
lpStringA null-terminated string to be written to the file. If this parameter is NULL, the key pointed to by the lpKeyName parameter is deleted.
lpFileNameThe name of the initialization file.
Returns
If the function successfully copies the string to the initialization file, the return value is nonzero. If the file was created using Unicode characters, the function writes Unicode characters to the file. Otherwise, the function writes ANSI characters.
UtilExport BOOL MaxSDK::Util::WritePrivateProfileStruct ( LPCTSTR  lpszSection,
LPCTSTR  lpszKey,
LPVOID  lpStruct,
UINT  uSizeStruct,
LPCTSTR  lpFileName 
)

Copies data into a key in the specified section of an initialization file.

As it copies the data, the function calculates a checksum and appends it to the end of the data.

Parameters
lpszSectionThe name of the section to which the string will be copied. If the section does not exist, it is created. The name of the section is case independent, the string can be any combination of uppercase and lowercase letters.
lpszKeyThe name of the key to be associated with a string. If the key does not exist in the specified section, it is created. If this parameter is NULL, the entire section, including all keys and entries within the section, is deleted.
lpStructThe data to be copied. If this parameter is NULL, the key is deleted.
uSizeStructThe size of the buffer pointed to by the lpStruct parameter, in bytes.
lpFileNameThe name of the initialization file.
Returns
If the function successfully copies the string to the initialization file, the return value is nonzero. If the function fails, or if it flushes the cached version of the most recently accessed initialization file, the return value is zero. To get extended error information, call GetLastError.
UtilExport BOOL MaxSDK::Util::WritePrivateProfileSection ( LPCTSTR  lpAppName,
LPCTSTR  lpString,
LPCTSTR  lpFileName 
)

Replaces the keys and values for the specified section in an initialization file.

Parameters
lpAppNameThe name of the section in which data is written. This section name is typically the name of the calling application.
lpStringThe new key names and associated values that are to be written to the named section. This string is limited to 65,535 bytes.
lpFileNameThe name of the initialization file. If this parameter does not contain a full path for the file, the function searches the Windows directory for the file. If the file does not exist and lpFileName does not contain a full path, the function creates the file in the Windows directory. If the file exists and was created using Unicode characters, the function writes Unicode characters to the file. Otherwise, the function creates a file using ANSI characters.
Returns
If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.
TipSystemExport ITipSystem* MaxSDK::Util::GetTipSystem ( )