I have the source to a C++ SDK that I'd like to try convert to PB. Would someone be kind enough to point me in the right direction on how to convert the parameters to the correct variable types.
example C++:
int foo(char* szBuff, int* pnBuffSize, char* lpszInfo)
Thanks.
C++ Conversion Question
Thanks... I've tried the methods described, and many different variations of my own, and having very little luck. I think its my bad understanding of how a pointer is used in PB thats knocking me down.
Here's the function I'm trying to convert. szBuffer is a pointer to a character buffer that will receive the value of szOName. pnBSize will bring in/take out the length of szBuffer.
Here's the function I'm trying to convert. szBuffer is a pointer to a character buffer that will receive the value of szOName. pnBSize will bring in/take out the length of szBuffer.
Code: Select all
char szOName[] = "Sample";
int GetName(char* szBuffer, int* pnBSize)
{
int nLength = lstrlen(szOName);
if(*pnBSize < nLength)
{
*pnBSize = nLength;
return -1;
} else
{
memset(szBuffer,0,*pnBSize);
lstrcpy(szBuffer,szOName);
return nLength;
}
}