|
Hey:
I did the exactly same that you have provided above. Unfortunately, I got some execptional handling error. Then, later I tried:
Process.Start("SH_EVP2.exe ", "input1.sa")
But still it is not taking input1.sa as a file parameter.
Help please.
|
|
|
|
|
hsprasain wrote: Unfortunately, I got some execptional handling error.
Christian's code should do the trick, what is the exception you were getting?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
The exact code that I wrote as per Christian's suggestion is:
Dim yourParamString As String = "input1.sa"<br />
Process.Start("SH_EVP2.exe" + yourParamString)
The exception that I got while executing the application is:
The system can't find the file specified.
However I have input1.sa in the bin directory. I felt "SH_EVP2.exe" + yourParamString string got concanated and come up with new file name. Thus I'try the other one that I've posted above.
Thanks for your help
|
|
|
|
|
You might have to specify the file path to the parameter file as well...
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
By default it is taking taking the filpath of ../bin and my input file is inside bin. However, I tried with absolute path too. It doesn't make any differnce.
|
|
|
|
|
hsprasain wrote: Dim yourParamString As String = "input1.sa"
Process.Start("SH_EVP2.exe" + yourParamString)
You might be needing a space between the .exe and input1.sa
By the looks of your code, it is looking for: SH_EVP2.exeinput1.sa
Have you tried: Process.Start("SH_EVP2.exe " + yourParamString) , note the space between the last 'e' in exe and the last double quote...
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Hey:
I tried as per your suggestions but it doesn't work out. Same error. I'm getting really frustrated.
|
|
|
|
|
hsprasain wrote: The system can't find the file specified.
Of course not, you're trying to start SH_EVP2.exeinput1.sa, which does not exist.
hsprasain wrote: I felt "SH_EVP2.exe" + yourParamString string got concanated and come up with new file name.
Yeah, I thought it was obvious you needed a space.
hsprasain wrote: However I have input1.sa in the bin directory.
Doesn't really matter. sh_evp2.exe needs to be in the same folder, or in the general lookup path for windows. Additionally, where-ever sh_evp2.exe is, *it* needs to be able to find input1.sa, that is, even if sh_Evp2.exe starts from anotehr folder, odds are very low it will be able to find input1.sa. Application.ExecutablePath ( from memory ) contains the path to your exe, use Path.Combine to create the full path to input1.sa, make sure that sh_evp2.exe is able to be found, put in a space, and it should work.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi All,
I Want the Week Number of the Date Selected in MonthCalendar.
Can anybody plz forward me the codings in VB.Net.
Thanks & Best Regards,
Noor.
Noor
|
|
|
|
|
When you use Datetimepicker then use the property value and day of year it will show you the day then divide it by 7 you will got the week of year.
the code is : -
<br />
weekofyear=(Datatimepicker1.value.dayofyear)/7<br />
msgbox(weekofyear)<br />
If you uses C# then use toString for converstion.
With regards
Yogesh Agarwal
|
|
|
|
|
Yogesh Agarwal wrote: use the property value and day of year it will show you the day then divide it by 7 you will got the week of year
That only works for years where january the first is the first day of the week.
---
single minded; short sighted; long gone;
|
|
|
|
|
|
How can we enumerate and print through Network Printers?
Any link or code.
Help appreciated both ion VB.Net or C#.
Thank You!
X
|
|
|
|
|
You can use the EnumPrinters API
(Declaration)
<DllImport("winspool.drv", EntryPoint:="EnumPrinters", _
SetLastError:=True, CharSet:=CharSet.Ansi, _
ExactSpelling:=False, _
CallingConvention:=CallingConvention.StdCall)> _
Public Function EnumPrinters(<InAttribute()> ByVal Flags As EnumPrinterFlags, _
<InAttribute()> ByVal Name As String, _
<InAttribute()> ByVal Level As Int32, _
<OutAttribute()> ByVal lpBuf As IntPtr, _
<InAttribute()> ByVal cbBuf As Int32, _
<OutAttribute()> ByRef pcbNeeded As Int32, _
<OutAttribute()> ByRef pcbReturned As Int32) As Boolean
End Function
passing in the appropriate EnumPrinterFlags from:
<Flags()> _
Public Enum EnumPrinterFlags
PRINTER_ENUM_DEFAULT = &H1
PRINTER_ENUM_LOCAL = &H2
PRINTER_ENUM_CONNECTIONS = &H4
PRINTER_ENUM_FAVORITE = &H4
PRINTER_ENUM_NAME = &H8
PRINTER_ENUM_
PRINTER_ENUM_SHARED = &H20
PRINTER_ENUM_NETWORK = &H40
End Enum
|
|
|
|
|
Sir,
I was bit confusing on passing parameters to the function.Could you illustrate with an example please?
Thank You!
X
|
|
|
|
|
I have all this stuff built into a fairly large object model so it is a bit difficult to cut out just the bits that are needed, but it should look something a bit like:
Dim pcbNeeded As Int32
Dim pcReturned As Int32
Dim pPrinters As IntPtr
Dim pcbProvided As Int32 = 0
If Not EnumPrinters(EnumPrinterFlags.PRINTER_ENUM_NETWORK, String.Empty, 1, pPrinters, 0, pcbNeeded, pcReturned) Then
If pcbNeeded > 0 Then
pPrinters = Marshal.AllocHGlobal(pcbNeeded)
pcbProvided = pcbNeeded
If Not EnumPrinters(EnumPrinterFlags.PRINTER_ENUM_NETWORK, String.Empty, 1, pPrinters, pcbProvided, pcbNeeded, pcReturned) Then
Throw New Win32Exception
End If
End If
End If
If pcReturned > 0 Then
Dim ptNext As IntPtr = pPrinters
While pcReturned > 0
Dim pi1 As New PRINTER_INFO_1
Marshal.PtrToStructure(ptNext, pi1)
If Not pi1.pPrinterName Is Nothing Then
End If
ptNext = New IntPtr(ptNext.ToInt32 + Marshal.SizeOf(pi1))
pcReturned -= 1
End While
End If
If pPrinters.ToInt32 > 0 Then
Marshal.FreeHGlobal(pPrinters)
End If
However there's probably loads of declarations and namespaces missing from that - your best bet would be to download the latest source code form the printer usage monitoring application[^] and cut the bits you need out of that.
There is also more info on Randy Birch's site here[^]
|
|
|
|
|
Thanks for everything.
I really appreciate your help.
X
|
|
|
|
|
How to register a dll in a .net Application
|
|
|
|
|
The DLL's are automattically registered during installation.
or
if there is a problem then register it do the fillowing
1. open the dll file by double click on it
it will open the open with.. box
2. chosse the browse open to locate another applications
3. The choose the regsvr32.exe mostally available in ( c:\windows\system32).
with regards
Yogesh Agarwal
|
|
|
|
|
There is no such thing as .NET dll registration
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi All,
in my project there are the word file stored using the import option, now these file has to be forworded to other people using emails, now i picked the file and attached ti with mail, but i have to send the file using a word template alleady defined.
So if i picked the tamplate then the problem is i am not creating a new file it has to be attched to the existing one & if i try to write the content into that file the format is totally changed for that existing file.
Plz help me to solve this problem
Thanks is advance
Yogesh Agarwal
|
|
|
|
|
When we r cerating setup and run application on network computer of our vb.net appilcation, ther is some problem in crystal report I have alrady using merg module but at the time lodeing of dll message generated " Log on faild coud not lode file or assembaly" please suggest me to solve that problem.
|
|
|
|
|
try to install the .net frame work in the other computer you are using.
Don't block the drive way of all the newbies in programming.
|
|
|
|
|
I want to install .net application on AS/400.
Is there framework avaliable for AS/400 or for other platform
|
|
|
|
|
The only other implimentation of .NET is Mono, for *nix.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|