Hi Again 🙂
My objective now is to get TurboFloat's saved server address and port to appear in my UI. So, I'm making use of the TF_GetServer() function but I'm not sure what I'm doing wrong. My C++ string / buffer skills are severly lacking, so I apologize if this is not obvious.
I've tried this:
HRESULT hr;STRTYPE savedServerAddress = NULL;short * savedServerPort = NULL;
hr = TF_GetServer(tfHandle, savedServerAddress, 0, savedServerPort);
if (hr == TF_OK){ savedServerAddress = (TCHAR *)malloc(hr * sizeof(TCHAR)); hr = TF_GetServer(tfHandle, savedServerAddress, *savedServerAddress, savedServerPort); if (hr == TF_OK) { //convert saved server into a string for UI. }}
On the first call to TF_GetServer() in the above code, I pass in 0 for the cchHost so I can get the correct size of the buffer. However, when I break on the line that allows me to see the returned result into the hr variable, I see the following:
hr 0x0000000a : The environment is incorrect
So, I thought that meant something is not right when I actually save the server, but I'm saving it with TF_SYSTEM in the TF_SaveServer() function. Any idea what this means? And, is my code proper for calling TF_GetServer()?
Thanks again for your help!
--Arie