- This topic has 16 replies, 2 voices, and was last updated 3 days, 19 hours ago by .
Forums › TWAIN Classic › OpenDSM fails when run from Citrix client
sloppy code example that has worked for me in the past,
BOOL IdHitThat::LoadSourceManager(BOOL bProfileAware)
{
wchar_t s[MAX_PATH];
CString szSM = _T("");
if (twState >= 2) {
return TRUE; // SM already loaded
}
if (bProfileAware) {
GetWindowsDirectory(s, sizeof(s)); /* GetWindowsDirectory is user specific in Citrix & TS */
} else {
GetSystemWindowsDirectory(s, sizeof(s));
}
szSM = s;
if ( szSM[szSM.GetLength() -1] != '\' ) {
szSM.Append(_T("\"));
}
szSM.Append((CString)DSM_FILENAME);
hDSMDLL = LoadLibrary(szSM);
if (hDSMDLL == NULL) {
std::cout << "LoadLibrary: failed" << szSM;
hDSMDLL = NULL;
}
if (hDSMDLL != NULL) {
lpDSM_Entry = (DSMENTRYPROC)GetProcAddress(hDSMDLL, DSM_ENTRYPOINT);
if (lpDSM_Entry) {
twState = 2;
} else {
std::cout << "LoadSourceManager: FAIL. Unable to GetProcAddress.n";
FreeLibrary(hDSMDLL);
hDSMDLL = NULL;
}
} else {
lpDSM_Entry = NULL;
}
if (twState != 2 ) {
std::cout << "LoadSourceManager: FAIL.n";
}
return (twState >= 2);
}
Hello,
I am having a similar issue with Citrix except, (using Twack_32) I can open the source manager the first time, but once the source manager is closed, attempting to open the source manager again gives an error.
Has anyone had this experience?
Regards,
Gary