Hi to all
I have a working VB.net app developed under VS 2005 on a Windows 7 Pro 32 bit system. I moved the app to a Windows 8 Pro 64 bit system and the following synopsis takes place:
Windows 7 Pro 32 bit VS 2005
Reference interop.IWshRuntimeLibrary
Dim wh As New IWshRuntimeLibrary.IWshNetwork_Class
wh.SetDefaultPrinter(strDfltPtr)
Works
Windows 8 Pro 64 bit VS 2013
Reference IwshRuntimeLibrary (taken from windows\sysWOW64\wshom.ocr
Dim wh As New IWshRuntimeLibrary.IWshNetwork_Class
wh.SetDefaultPrinter(strDfltPtr)
Get
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in vbqtegen.exe
Additional information: Exception occurred. (Exception from HRESULT: 0x80020009 (DISP_E_EXCEPTION))
I know there are a number of variables here but the only problem I am encountering is the setting of the "default printer". As shown in the synopsis I changed the IWshRuntimeLIbrary to its 64 bit version by adding it from the sysWOW64 folder. Why am I getting the exception. Am I wrong in thinking this is a 64 bit issue? Is it the .net version used by 2013 versus that used by vs 2005 - any help would be greatly appreciated. Thanks in advanced
Respectfully,
IDEPRIZE
I have a working VB.net app developed under VS 2005 on a Windows 7 Pro 32 bit system. I moved the app to a Windows 8 Pro 64 bit system and the following synopsis takes place:
Windows 7 Pro 32 bit VS 2005
Reference interop.IWshRuntimeLibrary
Dim wh As New IWshRuntimeLibrary.IWshNetwork_Class
wh.SetDefaultPrinter(strDfltPtr)
Works
Windows 8 Pro 64 bit VS 2013
Reference IwshRuntimeLibrary (taken from windows\sysWOW64\wshom.ocr
Dim wh As New IWshRuntimeLibrary.IWshNetwork_Class
wh.SetDefaultPrinter(strDfltPtr)
Get
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in vbqtegen.exe
Additional information: Exception occurred. (Exception from HRESULT: 0x80020009 (DISP_E_EXCEPTION))
I know there are a number of variables here but the only problem I am encountering is the setting of the "default printer". As shown in the synopsis I changed the IWshRuntimeLIbrary to its 64 bit version by adding it from the sysWOW64 folder. Why am I getting the exception. Am I wrong in thinking this is a 64 bit issue? Is it the .net version used by 2013 versus that used by vs 2005 - any help would be greatly appreciated. Thanks in advanced
Respectfully,
IDEPRIZE