Failed to register window class from okFrontPanelDevices_Construct

My code is pretty simple. I’m basically calling

okCFrontPanelDevices_HANDLE hFPDevices;
okError* err;

hFPDevices = okFrontPanelDevices_Construct("", &err);

if (!hFPDevices) {
    fprintf(stderr, "%s\n", okError_GetMessage(err));
    okError_Free(err);
    return;
}
else {
    fprintf(stdout, "Number of connected FrontPanel devices: %d\n", okFrontPanelDevices_GetCount(hFPDevices));
}

The first time I run, I get some wild count (eg -299688811)
the second time, I get an error: Failed to register window class.

Any ideas what’s going on?

I figured it out. I was passing a pointer to hFPDevices to GetCount instead of the value. That doesn’t totally explain why I was getting the “failed to register” error but I don’t get an error any more and I’m back up and developing now.