ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

wcsncpy error in AutoCAD2013'ARX and X64

3 REPLIES 3
Reply
Message 1 of 4
cutechun
420 Views, 3 Replies

wcsncpy error in AutoCAD2013'ARX and X64

int schdim(resbuf *rb)
{
 TCHAR dimn[5], bname[30],chang[30];

 wcscpy(bname, _T("dimn50"));
 ads_printf(_T("\nbname=%s\n"), bname);

 wcscpy(dimn, _T("abcd"));
 ads_printf(_T("\ndimn=%s\n"), dimn);

 wcsncpy(bname, dimn, 4);
 ads_printf(_T("\nbname=%s\n"), bname);

}

 

the sample code above , but the result of "bname" is error!!

 

result list:

bname=dimn50
dimn=abcd
bname=abcd

 

I'm waiting for any suggestion, thank you.

3 REPLIES 3
Message 2 of 4
owenwengerd
in reply to: cutechun

What exactly is the problem?

--
Owen Wengerd
ManuSoft
Message 3 of 4
cutechun
in reply to: cutechun

Execute the Code:

 

        wcsncpy(bname, dimn, 4);

 

The correct result is: "abcd50"
Message 4 of 4
Balaji_Ram
in reply to: cutechun

Hi,

 

Your query is still not clear.

I have attached the output of the code snippet when I tried it with AutoCAD 2013.

It is the same as what you are expecting.



Balaji
Developer Technical Services
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost