Hello, I am using the C# bindings of DTWAIN. In this case, the app is built for x86, all the dll's and includes are setup properly.
As the title says, I'm unable to retrieve proper product names for sources. I nearly identically copied the code from the Full Demo that fetches the names of all enumerated sources.
public List<string> GetConnectedSources()
{
List<string> sourceNames = new List<string>();
TwainAPI.DTWAIN_SysInitialize();
// Fill the sources
DTWAIN_ARRAY sourceArray = IntPtr.Zero;
TwainAPI.DTWAIN_EnumSources(ref sourceArray);
// Get sources size
int sourcesSize = TwainAPI.DTWAIN_ArrayGetCount(sourceArray);
DTWAIN_SOURCE curSource = IntPtr.Zero;
for (int i = 0; i < sourcesSize; i++)
{
StringBuilder sourceName = new StringBuilder(256);
/* Get DTWAIN_SOURCE from Array*/
TwainAPI.DTWAIN_ArrayGetSourceAt(sourceArray, i, ref curSource);
TwainAPI.DTWAIN_GetSourceProductName(curSource, sourceName, 255);
sourceNames.Add(sourceName.ToString());
}
TwainAPI.DTWAIN_ArrayDestroy(sourceArray);
return sourceNames;
}
But I keep getting trash values such as these:
I have no idea what the problem is, could you help me out?
Hello, I am using the C# bindings of DTWAIN. In this case, the app is built for x86, all the dll's and includes are setup properly.
As the title says, I'm unable to retrieve proper product names for sources. I nearly identically copied the code from the Full Demo that fetches the names of all enumerated sources.
But I keep getting trash values such as these:
I have no idea what the problem is, could you help me out?