BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Olevariant and WIA

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation
View previous topic :: View next topic  
Author Message
Pablo Arthur Rodger
Guest





PostPosted: Tue Sep 20, 2005 3:42 pm    Post subject: Olevariant and WIA Reply with quote




I am trying to use the scanner. I get the scanner to transfer the image to
an olevariant
but I have the same problem that you. I can not cast the variable into the
imagefile variable.
I believe this is very easy, but I can not make it work.

I will apreciate your help, whenever you can
Thanks in advance,


var
dev : IDevice;
itm : IItem;
iimg : IImageFile;
x : OleVariant;
Vector : IVector;
PropDisp : Integer;
begin
dev := WIAComDialog1.ShowSelectDevice(ScannerDeviceType,false,true); //
true false, etc.

If dev.type_ = ScannerDeviceType then
begin
// ShowMessage(dev.DeviceID);
for PropDisp := 1 to Dev.Items.Count do
begin
itm :=
dev.ExecuteCommand('{9B26B7B2-ACAD-11D2-A093-00C04F72DC3C}'); // Synchronize
itm := Dev.Items.Item[1];
iimg := itm.Transfer('{B96B3CB1-0728-11D3-9D7B-0000F81EF32E}');
// THIS GIVES AN ERROR OF INCOMPATIBLE TYPES "OLEVARIANT AND IIMAGEFILE

x := itm.Transfer('{B96B3CB1-0728-11D3-9D7B-0000F81EF32E}');
// THIS WORKS OK. BUT I CAN NOT CAST THE OLEVARIANT INTO THE IIMAGE FILE

iimg.SaveFile('kk.tif');

end;
end;

end;


I saw your example later on where it works but I do not see the declaration
of the

TheFile variable // What type of variable this is?

TheFile :=
itm.Transfer('{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}');
TheFile.SaveFile('C:file.tif');

Can you send me the part of this code,

Pablo Arthur-Rodger
Dominican Republic


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.