前田稔(Maeda Minoru)の超初心者のプログラム入門
// strsafe Program File #include <windows.h> //LPSTR #include <strsafe.h> void main() { LPSTR sou = "LPSTR 12345"; char des[12]; if (StringCbCopy(des, 12, sou) != 0) MessageBox(NULL,"Cb Copy Error","Error",MB_OK); else MessageBox(NULL,des,"Copy",MB_OK); } |
// strsafe Program Sample #include <windows.h> //MessageBox #include <strsafe.h> void main() { char des[40] = "char[] 12345\r\n"; if (StringCbCat(des, 40, "abc\r\n") != 0) MessageBox(NULL,"CbCat Error","Error",MB_OK); else MessageBox(NULL,des,"CbCat",MB_OK); } |