Anyone with VB .NET 2003, please help!

A

A.S.

I have this code here that I wrote with the Visual Basic 2005 Express
Edition Beta. However, I can't use the executable on other computers
because it was compiled to use the .NET Framework 2 Beta. Could
someone please compile this to use the .NET Framework 1.1? Heck, I
don't even know if it's possible. I'm a VB newbie.


Module Main

Sub Main(ByVal files() As String)

Try

Dim vector As Object = CreateObject("WIA.Vector")

For Each file As String In files
vector.Add(file)
Next

Dim dialog As Object = CreateObject("WIA.CommonDialog")
dialog.ShowPhotoPrintingWizard(vector)

Catch e As Exception

End Try

End Sub

End Module
 
A

A.S.

Thanks. I was able to compile my code with the 1.1 Framework (I used
vbc.exe), but now nothing happens when I run it on other computers. It
works as intended on the computer I compile it with.

Here is the updated code:

Module Main

Sub Main(ByVal files() As String)

Try

Dim vector As Object =
Microsoft.VisualBasic.CreateObject("WIA.Vector")

For Each file As String In files
vector.Add(file)
Next

Dim dialog As Object =
Microsoft.VisualBasic.CreateObject("WIA.CommonDialog")
dialog.ShowPhotoPrintingWizard(vector)

Catch e As System.Exception

End Try

End Sub

End Module
 
H

Herfried K. Wagner [MVP]

* (e-mail address removed) (A.S.) scripsit:
Thanks. I was able to compile my code with the 1.1 Framework (I used
vbc.exe), but now nothing happens when I run it on other computers. It
works as intended on the computer I compile it with.

Here is the updated code:

Module Main

Sub Main(ByVal files() As String)

Try

Dim vector As Object =
Microsoft.VisualBasic.CreateObject("WIA.Vector")

For Each file As String In files
vector.Add(file)
Next

Dim dialog As Object =
Microsoft.VisualBasic.CreateObject("WIA.CommonDialog")
dialog.ShowPhotoPrintingWizard(vector)

Catch e As System.Exception

Add some output there, for example a 'Console.Write(e.Message)' to see
if an exception occured.
 
A

A.S.

I got it working - thanks for the Console.Write tip!

First, I tried what you suggested. On my other computer I got the
exception "Cannot create ActiveX component.", even when the code was
compiled on that computer. So there was no problem with the code -
there was something wrong with that computer. So I read more about the
WIA library (which contains the WIA.Vector and WIA.CommonDialog
objects) and found this:

"You will need WIAAut.dll to use the WIA Automation Layer. To locate
the file that contains the DLL and installation instructions, follow
these steps."

From http://msdn.microsoft.com/library/d...wiaaut/wia/wiax/overviews/startpagewiaaut.asp

So I searched the troubled computer for WIAAut.dll... nothing! So once
I downloaded and registered it, everything worked fine.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top