TellUsbD101.cpp: Ported r53 (bugfix when returning a string) from trunk.

This commit is contained in:
Micke Prag 2008-03-02 11:23:29 +00:00
parent 1a1b386c21
commit 9a594d4c1c

View file

@ -139,6 +139,7 @@ char * __stdcall devGetName(int intDeviceId){
try{ try{
TelldusSettings ts; TelldusSettings ts;
strReturn = ts.getName(intDeviceId); strReturn = ts.getName(intDeviceId);
strReturn = (char *)SysAllocStringByteLen (strReturn, lstrlen(strReturn));
} }
catch(exception e){ catch(exception e){
strReturn = ""; strReturn = "";
@ -165,6 +166,7 @@ char* __stdcall devGetVendor(int intDeviceId){
try{ try{
TelldusSettings ts; TelldusSettings ts;
strReturn = ts.getVendor(intDeviceId); strReturn = ts.getVendor(intDeviceId);
strReturn = (char *)SysAllocStringByteLen (strReturn, lstrlen(strReturn));
} }
catch(exception e){ catch(exception e){
strReturn = ""; strReturn = "";
@ -191,6 +193,7 @@ bool __stdcall devSetVendor(int intDeviceId, char* strVendor){
try{ try{
TelldusSettings ts; TelldusSettings ts;
strReturn = ts.getModel(intDeviceId); strReturn = ts.getModel(intDeviceId);
strReturn = (char *)SysAllocStringByteLen (strReturn, lstrlen(strReturn));
} }
catch(exception e){ catch(exception e){
strReturn = ""; strReturn = "";