12/22/2005 12:49 PM | |
Joined: 9/27/2005 Last visit: 11/27/2007 Posts: 1398 Rating:
|
Hi Mehrnoosh Can you post your script here along with the header file you're using? Regards, Salma |
12/26/2005 11:40 AM | |
Posts: 102 Rating:
|
Dear Salma Thank you very much for your attention to this matter. I have attached a copy of my script.wchar.h is one of the visual c standard header files and I have copied it in "<WinCC project path>\library" path. It seems that there is some other definitions there that aren't supported by WinCC. Best regards Mehrnoosh |
12/26/2005 11:47 AM | |
Posts: 102 Rating:
|
Dear Salma Thank you very much for your attention to this matter. I have attached a copy of wchar.h which is one of the visual c standard header files.And this is my script: #include "apdefap.h" void OnClick(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName){ #include "wchar.h" char * s,s1; int i; s=GetTagChar("2b_general_zone.V_Color"); //Return-Type: char* for(i=0;i<strlen(s);++i) wcsncpy(s1,s,2); } I have copied wchar.h in "<WinCC project path>\library" path. It seems that there is some other definitions there that aren't supported by WinCC. Best regards Mehrnoosh AttachmentWCHAR.zip (776 Downloads) |
1/3/2006 10:27 AM | |
Joined: 9/27/2005 Last visit: 11/27/2007 Posts: 1398 Rating:
|
Any C gurus out there who can help with this one? |
1/3/2006 12:52 PM | |
Joined: 9/8/2005 Last visit: 7/17/2024 Posts: 177 Rating:
|
Hi, it is necessary to convert the wchar to an ansi char (and revert). Therefore you can use the both Windows API functions MultiByteToWideChar() and WideCharToMultiByte(). See below how to include them in WinCC scripts. #pragma code("kernel32.dll") int MultiByteToWideChar(UINT ui, DWORD dw, LPCSTR sz, int i, LPCSTR sz1, int ii); int WideCharToMultiByte( UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr, int cchWideChar, LPSTR lpMultiByteStr, int cchMultiByte, LPCSTR lpDefaultChar, LPBOOL lpUsedDefaultChar); #pragma code() The functions are described on the Microsoft MSDN Homepage (http://msdn.microsoft.com) If you have any further questions, please contact the WinCC Competence Center Mannheim http://www.siemens.com/process-management |
This contribution was helpful to
1 thankful Users |
1/4/2006 8:55 AM | |
Posts: 102 Rating:
|
Hi Michel |
Follow us on