Not sure why you both waste your time to replicate specialfolder.windows function.
well, I know there is no practical use for the code - but I try to understand how to build a plugin.
REALBuildString needs a pointer to data and length in bytes, so why not pass sResultstring and bufCharCount*sizeof(TCHAR)?
OK... so I've tried this :
REALstring result = REALBuildString( sResultstring, bufCharCount*sizeof(TCHAR ));
But the compiler told me:
error C2665: 'REALBuildString' : none of the 2 overloads could convert all the argument types
c:\plugin tests\app5\app5\app5\rb_plugin.h(128): could be 'REALstring REALBuildString(const char *,int)'
while trying to match the argument list '(TCHAR , DWORD)'
So I need some kind of converting TCHAT->CHAR ... after some more testing I've found this:
void TCharToChar(const wchar_t* in, char* out, int Size)
WideCharToMultiByte(CP_ACP, 0, in, wcslen(in)+1, out , Size, NULL, NULL);
Now it works
But I get this warning :
C4995: 'REALRegisterMethod': name was marked as #pragma deprecated
Is this somethnig to be worried about ?