PutData to create empty file (General questions)
Hi,
I am trying to use PutData to create empty file on FTP server.
Code is like this (VC++):
VARIANT var;
var.vt = VT_BSTR;
var.bstrVal = SysAllocString(_T( /test.txt ));
SFtp->PutData(_T( ), var);
But COleDispatchException occured.
What I am doing wrong?
Re: PutData to create empty file
Oleg,
that exception should contain some message or error number. Can you tell me what it is?
Kreso
Re: PutData to create empty file
I get message:
Unhandled exception at 0x7675b09e in Appname.exe: Microsoft C++ exception: COleDispatchException at memory location 0x02d0dc28..
Re: PutData to create empty file
Oleg,
are you sure that
SFtp->PutData(_T( ), var);
first argument is also BSTR? This looks to me like invalid argument issue, which in C++ gives you results like you experienced it..
Kreso
Re: PutData to create empty file
Solved it.
Error was that I put SetBlocking(TRUE) before CreateDispatch.
After fixing exception disappeared.
And replace
var.bstrVal = SysAllocString(_T( /test.txt ))
with
var.bstrVal = _T( /test.txt )
It work
Thank you