Intialize, Termination function LTCustomizer21 for AutoCAD LT reference manual

ActiveX
    Function init([cad_ver As String = "0"]) As Integer
    Function term() As Boolean
C/C++
    int WINAPI LTC_init(const wchar_t *cad_ver=L"0");
    int WINAPI LTC_term();

parameter
cad_ver:specifies type of CAD or version.  "0" means AutoCAD LT.  if you want to specify plural CADs, enclose by comma(,). If you want to communicate with AutoCAD, specify number that is corresponding to each AutoCAD version.
Example of AutoCAD version number:
19:AutoCAD 2014
15:AutoCAD2000/200i/2002
16:AutoCAD2004/2005

ex:init("0,19")
Above example is evaluated from left side in parameter. In short LTCustomizer21 attempt to communicate with AutoCAD LT ,AutoCAD 2014.

To get number corresponded to each AutoCAD, check using DDE spy utility in Microsoft Visual Studio. Then, you can get service name like "AutoCAD.r[number].DDE". The "number" of service name become a parameter of  AutoCAD you want to communicate with in init().


In case of using OEM version AutoCAD

In case of communicating together OEM version of AutoCAD, you need to know DDE service name of the CAD beforehand using DDE SPY utility (Includes Visual Studio,etc) because DDE service name of OEM version is different from pure AutoCAD. Then using 'o' identifier, you communicate together OEM version of AutoCAD. 'o' is also generalized identifier. So you can initialize AutoCAD or AutoCAD LT using 'o' identifier, too.

Following example is an example to communicate with AutoCAD LT using 'o' identifier
init ("o'AutoCAD LT.DDE'")

A first string which is delimited using single quotation marks is DDE service name.  


Explanation

init() initializes LTCustomizer21. At first, call init() always when you use LTCustomizer21. Call LTC_term() always when LTCustomizer21 is used as DLL of C/C++ to terminate.

Format of LTC21.cfg

LTC21.cfg is read when init() is executed. This file is used to describe running of specific CAD with LTCustomizer21 application.
Format to run specific AutoCAD LT  

1:RUN=fullpath of AutoCAD LT or 2:RUN=CLSID or 3:RUN=HKEY.. CLSID is unique number string that is corresponds to application. HKEY means full registry path.

example
RUN=C:\Program Files\Autodesk\AutoCAD 2014\acad.exe
RUN={6A221957-2D85-42A7-8E19-BE33950D1DEB}
RUN=HKEY_CLASSES_ROOT\AutoCAD.Drawing.19\protocol\StdFileEditing\server

Above example indicates all AutoCAD2014

To find CLSID that correspond to specific ACAD, find HKEY_CLASSES_ROOT\AutoCADLT.Drawing\CLSID (AutoCAD LT) or HKEY_CLASSES_ROOT\AutoCAD.Drawing\CLSID (AutoCAD) using regedit.exe 

Caution

1:LTC21.cfg must exist in the same path as LTCustomizer21 Application (.exe file).
2:Code of LTC21.cfg is UNICODE(UTF-16LE).
3:When you use "RUN=" format in LTC21.cfg, number of "RUN=" must be same number of initializing CADs in init().
4:LTCustomizer21 does not read 64bit registry because LTCustomizer21 is 32bit DLL. So LTCustomizer21 does not read CLSID of AutoCAD LT 64bit Edition.
To solve this problem, use another registry path that indicates path of AutoCAD LT using 32bit regedit.exe. 32bit regedit.exe exists in C:\Windows\Wow64 if installed path of Windows is C:\Windows. For example, to run AutoCAD2014, write "RUN=HKEY_CLASSES_ROOT\AutoCAD.Drawing.19\protocol\StdFileEditing\server" in LTC21.CFG.
5. Never insert extra space in LTC21.cfg.