#VerifyLicense
always success in trial version.
$e2t->VerifyLicense("4747457", "345srwr242342423");
#Set the output text file's column width, the default value is 20.
$e2t->SetColumnWidth("40");
#Convert excel file
to text file
print
$e2t->Convert ("c:\test\test1.xls", "c:\box\test1.txt"). "<br>";
print $e2t->Convert ("c:\test\test2.xls", "c:\box\test2.txt"). "<br>";
print $e2t->Convert2Mem ("c:\test\test3.xls", 50000). "<br>";
#Release
excel to text object.
$e2t = null;
?>
Go back to
top
Example in ColdFusion:
<cfobject type="COM"
action="Create"
name="e2t"
class="E2TServer.E2T">
<cfset strName="4747457">
<cfset strKey="345srwr242342423">
<cfset nWidth="40">
<cfset result = e2t.VerifyLicense(strName, strKey)>
<cfset result = e2t.SetColumnWidth(nWidth)>
<cfset strExcelName="C:\test\test1.xls">
<cfset strTXTName="C:\test\test1.txt">
<cfset result=e2t.Convert(strExcelName, strTXTName)>
<cfset result=e2t.Convert2Mem(strExcelName, 50000)>
Go back to
top
Example in VC:
You need generate wrapper class of Excel to text converter use class wizard first.
"ClassWizard->ActiveX Events->Add Class->From a type lib..."
////////////////////////////////
IE2T e2t;
if(e2t.CreateDispatch("E2TServer.E2T"))
{
e2t.VerifyLicense("34234","234234");
CString strRslt = e2t.Convert("C:\\test\\test1.xls","c:\\test\\test1.txt");
MessageBox(LPCTSTR(strRslt));
strRslt = e2t.Convert2Mem("C:\\test\\test2.xls",5000);
MessageBox(LPCTSTR(strRslt));
}
/////////////////////////////////
Go back to top
Example in VB:
You need to add the reference of Excel Text Converter to the project
"Project->References..." Make sure "E2TServer Type Library" was selected
there.
'''''''''''''''''''''''''''''''''''''''''''''''''
Dim myE2T As E2TSERVERLib.E2T
Dim strRslt As String
'Create the Excel to text object
Set myE2T = New E2T
'Verify the
license information of Excel to text Converter.
myE2T.VerifyLicense "234234", "23423432"
'Convert
Excel file to Text File.
strRslt = myE2T.Convert(C:\test\test1.xls","c:\test\test1.txt")
MsgBox strRslt
strRslt = myE2T.Convert2Mem(C:\test\test2.xls",5000)
MsgBox strRslt
'''''''''''''''''''''''''''''''''''''''''''''''''
Go back to top
Any comments or question, Send email to
support@retsinasoftware.com with "E2TCOM" in subject.
COM Interface
There's 5 methods exposed
///////////////////////////////////////////////////////
1. HRESULT VerifyLicense(
[in] BSTR bstrName,
[in] BSTR bstrKey,
[out, retval] long* pbRetVal);
VerifyLicense is the method must be called before all other methods.
It's to verify the run time license information.
@param BSTR bstrName: The register name
@param BSTR bstrKey: The register key code.
@param long* pbRetVal: 1 If verify license cuccessfully.
0 If something wrong with the name/key
This variable always be set to 1 in trial version
@return S_OK
///////////////////////////////////////////////////////
2. HRESULT GetVersion([out, retval] BSTR* pbstrVersion);
Return the
version information.
@param BSTR*
pbstrVersion: The current version information was returned in this buffer.
@return S_OK
///////////////////////////////////////////////////////
3. HRESULT Convert(
[in] BSTR bstrExcel,
[in] BSTR bstrTXT,
[out, retval] BSTR* pbstrRetVal);
@param BSTR bstrExcel: The absolute path and file name of the excel file
you
want to convert.
@param BSTR bstrTXT: The absolute path and file name of the text file
you
want to convert to.
@param BSTR* pbstrRetVal: The result and any warning/error
information
will return by this pointer
@return S_OK: Process the excel file successfully. Check *pbstrRetVal
for detail
information.
Go back to top