After getting to the point where my app is successfully loading TurboFloat.dll, I'm running into a new issue, and I'm not sure how to go about debugging so I thought I would start a new thread.
My app is a plugin to a host app. I can see that when I first startup my plugin, the TurboFloat server I am running locally does recognize it and my app gets a license from the server. That's a huge win. Now, I would expect that after having registered the callback function in my code that the server would call the LeaseCallback. Alas, it is not.
Here's how I've implemented the request for the release. It's not much different than the example, and it seems to work:
#if LIC_FLOATING hr = TF_PDetsFromPath(datFile); tfHandle = TF_GetHandle(TA_GUID); hr = TF_SetLeaseCallback(tfHandle, LeaseCallback); hr = TF_RequestLease(tfHandle);
if (hr == TF_E_SERVER) { //TODO: Think of best way to get the IP address and port into this code hr = TF_SaveServer(tfHandle, _T("127.0.0.1"), 13, TF_SYSTEM);
if (hr != TF_OK) { printf("Failed to save the server details (TF_SaveServer() returned %d). Look in TurboFloat.h for a human readable explanation of the error.\n", hr); return 1; }
hr=TF_RequestLease(tfHandle); }
if (hr != TF_OK) { printf("Failed to get the floating license lease (TF_RequestLease() returned %d). Look in TurboFloat.h for a human readable explanation of the error.\n", hr); return 1; } #endif
Here's my lease callback implementation.
#if LIC_FLOATING void TF_CC LeaseCallback(uint32_t status) { std::cerr << status << std::endl; switch(status) { case TF_CB_FEATURES_CHANGED:
registered = true; printf("\n[APP] License Lease Callback: Success! Floating licensing server registered lease!"); break;
case TF_CB_EXPIRED: case TF_CB_EXPIRED_INET: default: //TODO: Disallow any features in your app. registered = false; printf("\n[APP] License Lease Callback: Floating licensing server canceled license lease."); break;
} }#endif
Now, when I place breakpoints on the switch line, my plugin's code won't break there. I also do not see any debug / error output for the status variable. However, I do see this in the debug output after I see that the floating licensing server issues the license:
First-chance exception at 0x00007FFF9105871C in {hostapp}.exe: Microsoft C++ exception: boost::interprocess::interprocess_exception at memory location 0x0000000000839630.First-chance exception at 0x00007FFF9105871C in {hostapp}.exe: Microsoft C++ exception: std::ios_base::failure at memory location 0x0000000000838F18.First-chance exception at 0x00007FFF9105871C in {hostapp}.exe: Microsoft C++ exception: std::ios_base::failure at memory location 0x0000000000839038.
I'm wondering if TurboFloat exists in some kind of thread created by boost. Any thoughts on how to at least troubleshoot / debug?
Thanks,Arie