kGenius
asked on
CreateObject alike for WIA
Hi,
This is a code-snippet from a VB.NET print module
Dim dialog As Object = CreateObject("WIA.CommonDi alog")
dialog.ShowPhotoPrintingWi zard(vecto r)
I've tried this in C# as follows:
Type t = Type.GetTypeFromProgID("WI A.CommonDi alog");
object dialog=Activator.CreateIns tance(t);
But then I cannot access dialog.ShowPhotoPrintingWi zard();
I've referenced the waauit.dll now and add using WIA at top.
But still I want to get the other way(without referencing WIA).
kGenius
This is a code-snippet from a VB.NET print module
Dim dialog As Object = CreateObject("WIA.CommonDi
dialog.ShowPhotoPrintingWi
I've tried this in C# as follows:
Type t = Type.GetTypeFromProgID("WI
object dialog=Activator.CreateIns
But then I cannot access dialog.ShowPhotoPrintingWi
I've referenced the waauit.dll now and add using WIA at top.
But still I want to get the other way(without referencing WIA).
kGenius
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Is it possible to add a reference, and use early-binding, instead of the late-bound Activator call?
Bob
Bob
ASKER
It is possible in my app. I've done it that way (add the reference)
But I was so curious how C# could handle this one.
Thanks bruintje for sharing...
kGenius
But I was so curious how C# could handle this one.
Thanks bruintje for sharing...
kGenius
tmp is like this..: "c:/users/me/pictures/abc. jpg"...
What the compiler says is "argument can not be converted from string to "ref object"
If've refered to http://msdn.microsoft.com/en-us/library/ms630492(VS.85).aspx
where is said that also could used a path to afile....
What the compiler says is "argument can not be converted from string to "ref object"
If've refered to http://msdn.microsoft.com/en-us/library/ms630492(VS.85).aspx
where is said that also could used a path to afile....
WIA.CommonDialog myprintDialog = new WIA.CommonDialogClass();
String tmp = theBasisPfad + currentDateiname;
theDruckListe.SetFromString(tmp,false,true);
myprintDialog.ShowPhotoPrintingWizard( tmp );
----------
you could try
object dialog = CreateObject("WIA.CommonDi
dialog.ShowPhotoPrintingWi
----------
bruintje
share what you know, learn what you don't