InitSession Example for C++ 5.0 and later

ILEADRasterTwain * pltRasTwain; 
HWND hWnd; 

pltRasTwain->put_ManName (CString("LEAD Technologies, Inc.").AllocSysString ());
pltRasTwain->put_ProdFamily (CString("LEAD Twain COM Object").AllocSysString ());
pltRasTwain->put_Version (CString("Version 14.5").AllocSysString ());
pltRasTwain->put_AppName (CString("LEADTools Twain test sample").AllocSysString ());

short iRet = pltRasTwain-> InitSession ((long)hWnd); 
if (iRet != 0) 
   MessageBox (TEXT("Error Initializing Twain"));