Home All Groups Group Topic Archive Search About

Select TWAIN Source (VB.NET 2005)

Author
30 Mar 2006 11:01 PM
Dustin Davis
I'm hoping there is a TWAIN expert lurking here somewhere :)

I'm writing a very customized application. The software will be set up
in multiple location and will always have two types of scanners attached
to the computer. The scanners are microfilm/fiche and a flatbed.

So I've created a scanner setup screen where the user can select the
twain source for the fiche/film scanner and the twain source for the
flatbed scanner. I'm using an active x control to select the twain
source so that is simple enough, the problem comes in storing that
source or setting it manually. There is no way to do this in my active x
control.

Can someone tell me how this might be done in VB.NET? Basically, on the
main form there is a radio button for Fiche/Film and one for Flatbed. I
would like to programatically set the twain source depending on which
radio button is checked.

Help please! :)

Author
31 Mar 2006 12:31 AM
tommaso.gastaldi
Looks like you are lucky : just some some translation work ;)

http://www.codeproject.com/dotnet/twaindotnet.asp


Dustin Davis ha scritto:

Show quoteHide quote
> I'm hoping there is a TWAIN expert lurking here somewhere :)
>
> I'm writing a very customized application. The software will be set up
> in multiple location and will always have two types of scanners attached
> to the computer. The scanners are microfilm/fiche and a flatbed.
>
> So I've created a scanner setup screen where the user can select the
> twain source for the fiche/film scanner and the twain source for the
> flatbed scanner. I'm using an active x control to select the twain
> source so that is simple enough, the problem comes in storing that
> source or setting it manually. There is no way to do this in my active x
> control.
>
> Can someone tell me how this might be done in VB.NET? Basically, on the
> main form there is a radio button for Fiche/Film and one for Flatbed. I
> would like to programatically set the twain source depending on which
> radio button is checked.
>
> Help please! :)
Author
31 Mar 2006 1:36 AM
james
And here's a link to the VB.NET version:

http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=1551&lngWId=10

(works too)
james


<tommaso.gasta***@uniroma1.it> wrote in message
Show quoteHide quote
news:1143765082.319021.318490@t31g2000cwb.googlegroups.com...
> Looks like you are lucky : just some some translation work ;)
>
> http://www.codeproject.com/dotnet/twaindotnet.asp
>
>
> Dustin Davis ha scritto:
>
>> I'm hoping there is a TWAIN expert lurking here somewhere :)
>>
>> I'm writing a very customized application. The software will be set up
>> in multiple location and will always have two types of scanners attached
>> to the computer. The scanners are microfilm/fiche and a flatbed.
>>
>> So I've created a scanner setup screen where the user can select the
>> twain source for the fiche/film scanner and the twain source for the
>> flatbed scanner. I'm using an active x control to select the twain
>> source so that is simple enough, the problem comes in storing that
>> source or setting it manually. There is no way to do this in my active x
>> control.
>>
>> Can someone tell me how this might be done in VB.NET? Basically, on the
>> main form there is a radio button for Fiche/Film and one for Flatbed. I
>> would like to programatically set the twain source depending on which
>> radio button is checked.
>>
>> Help please! :)
>
Author
31 Mar 2006 3:05 PM
Dustin Davis
Sorry, I've looked at these already and the code connect to a dll, which
also shows the dialog to select the TWAIN source. I still couldn't find
a way to select the TWAIN source without showing the dialog box.

The system seems to remember the last TWAIN source selected. Does anyone
know where it stores this information. I was thinking that if there were
an ascii file somewhere, or a registry setting, I could modify that...

james wrote:
Show quoteHide quote
> And here's a link to the VB.NET version:
>
> http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=1551&lngWId=10
>
> (works too)
> james
>
>
> <tommaso.gasta***@uniroma1.it> wrote in message
> news:1143765082.319021.318490@t31g2000cwb.googlegroups.com...
>> Looks like you are lucky : just some some translation work ;)
>>
>> http://www.codeproject.com/dotnet/twaindotnet.asp
>>
>>
>> Dustin Davis ha scritto:
>>
>>> I'm hoping there is a TWAIN expert lurking here somewhere :)
>>>
>>> I'm writing a very customized application. The software will be set up
>>> in multiple location and will always have two types of scanners attached
>>> to the computer. The scanners are microfilm/fiche and a flatbed.
>>>
>>> So I've created a scanner setup screen where the user can select the
>>> twain source for the fiche/film scanner and the twain source for the
>>> flatbed scanner. I'm using an active x control to select the twain
>>> source so that is simple enough, the problem comes in storing that
>>> source or setting it manually. There is no way to do this in my active x
>>> control.
>>>
>>> Can someone tell me how this might be done in VB.NET? Basically, on the
>>> main form there is a radio button for Fiche/Film and one for Flatbed. I
>>> would like to programatically set the twain source depending on which
>>> radio button is checked.
>>>
>>> Help please! :)
>
>
Author
31 Mar 2006 3:21 PM
Dustin Davis
So, using Filemon & Regmon
(http://www.sysinternals.com/Utilities/Regmon.html) I was able to find a
registry entry for the default TWAIN source. On my machine it is located at
HKCU\Software\Microsoft\Windows NT\CurrentVersion\Twain\Default Source

Now this begs the question, how can I determine where it would be
located on Win XP or other OS versions? And how do I read & write to the
registry in VB.NET?

Dustin Davis wrote:
Show quoteHide quote
> Sorry, I've looked at these already and the code connect to a dll, which
> also shows the dialog to select the TWAIN source. I still couldn't find
> a way to select the TWAIN source without showing the dialog box.
>
> The system seems to remember the last TWAIN source selected. Does anyone
> know where it stores this information. I was thinking that if there were
> an ascii file somewhere, or a registry setting, I could modify that...
>
> james wrote:
>> And here's a link to the VB.NET version:
>>
>> http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=1551&lngWId=10
>>
>>
>> (works too)
>> james
>>
>>
>> <tommaso.gasta***@uniroma1.it> wrote in message
>> news:1143765082.319021.318490@t31g2000cwb.googlegroups.com...
>>> Looks like you are lucky : just some some translation work ;)
>>>
>>> http://www.codeproject.com/dotnet/twaindotnet.asp
>>>
>>>
>>> Dustin Davis ha scritto:
>>>
>>>> I'm hoping there is a TWAIN expert lurking here somewhere :)
>>>>
>>>> I'm writing a very customized application. The software will be set up
>>>> in multiple location and will always have two types of scanners
>>>> attached
>>>> to the computer. The scanners are microfilm/fiche and a flatbed.
>>>>
>>>> So I've created a scanner setup screen where the user can select the
>>>> twain source for the fiche/film scanner and the twain source for the
>>>> flatbed scanner. I'm using an active x control to select the twain
>>>> source so that is simple enough, the problem comes in storing that
>>>> source or setting it manually. There is no way to do this in my
>>>> active x
>>>> control.
>>>>
>>>> Can someone tell me how this might be done in VB.NET? Basically, on the
>>>> main form there is a radio button for Fiche/Film and one for Flatbed. I
>>>> would like to programatically set the twain source depending on which
>>>> radio button is checked.
>>>>
>>>> Help please! :)
>>
>>