Hey guys first post here, I'll try to follow the forum standards.
So here is the thing, I'm in to PLC programming and as part of the whole deal I have to get familiar with C which is mainly used to create a more advanced and custom interface for HMI programs.
While poking around some code I got stuck at this part here highlighted.
Code:
#include "apdefap.h"
void OnClick(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)
{
#pragma code ("UseAdmin.DLL")
#include "pwrt_api.h"
#pragma code ()
int i, j, n;
char pic_name[256];
char obj_name[60];
PWRTLogout();
n = strlen( lpszPictureName );
for ( i = n; i > 0; i-- )
if ( lpszPictureName[i] == '.' )
{
strncpy( pic_name, lpszPictureName, i );
strcpy( obj_name, &lpszPictureName[i+1] );
for ( j = 0; j < (n-i); j++)
if ( obj_name[j] == ':' )
{
obj_name[j] = '\0';
break;
}
SetVisible(pic_name,obj_name,FALSE);
}
}
don't worry about the header and those wierd names in it, I woud just like to know the part where it says &lpszPictureName[i+] I looked everywhere on the internet and I could not find a single thing about this wierd code (at least for me it is) it seems like a mix of pointers with pointers?¿
I got at least the purpuse of the code by looking at it, this code is used to call pictures (HMI screens for industrial process control) and those pictures have .PDL extention so it would extract the NameOfThePicture without the .PDL extention I think and the last part would set it to Invisible ( highlighted in blue).
Last but not least, I thank you all in advance.