473,566 Members | 3,273 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB6-> VB.net .. problems

Hi,

I know VB6 pretty well but has just started to work on VB.net.

I am experiencing problems during my tests and I wonder if someone can
advise me.

Q1: I use the Shell function to run external 'console' programs. These
console programs display information on the screen while working.
Because I use the shell function, I would like to be able to grab what the
'console displays' on the screen to see if this console program works fine.
I basically tried to run something like 'c:\Consoleprog .exe > prog.txt' but
I never get the prog.txt with the shell function. It works fin in command
line.
So : Is it the best way to do what I want to do ? (I don't think so)
What is going on ?

Q2: I have a VB.net Service. This service is working fine. I would like to
create a function in my service that can be called from a script (.vbs). I
wonder what is the best and most simple option. Com ? Other ?
If you can advise me (because it is a service) and give me a sample code to
test this.

Thanks for you help.

Regards
SN
Nov 21 '05 #1
1 1072
Hi,

Answer to question 1

Dim pi As New ProcessStartInf o

Dim p As Process

pi.RedirectStan dardOutput = True

pi.FileName = "c:\pubsconsole .exe"

pi.UseShellExec ute = False

Dim sw As New System.IO.Strea mWriter("C:\MyO utPut.txt")

p = Process.Start(p i)

sw.WriteLine(p. StandardOutput. ReadToEnd)

p.WaitForExit()

sw.Close()

Ken

------------------------------------

"Snoop" <Sn***@discussi ons.microsoft.c om> wrote in message
news:F5******** *************** ***********@mic rosoft.com...
Hi,

I know VB6 pretty well but has just started to work on VB.net.

I am experiencing problems during my tests and I wonder if someone can
advise me.

Q1: I use the Shell function to run external 'console' programs. These
console programs display information on the screen while working.
Because I use the shell function, I would like to be able to grab what the
'console displays' on the screen to see if this console program works fine.
I basically tried to run something like 'c:\Consoleprog .exe > prog.txt' but
I never get the prog.txt with the shell function. It works fin in command
line.
So : Is it the best way to do what I want to do ? (I don't think so)
What is going on ?

Q2: I have a VB.net Service. This service is working fine. I would like to
create a function in my service that can be called from a script (.vbs). I
wonder what is the best and most simple option. Com ? Other ?
If you can advise me (because it is a service) and give me a sample code to
test this.

Thanks for you help.

Regards
SN
Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
17108
by: Kieran Benton | last post by:
Hi everyone, I'm just looking into this for my boss (and myself I suppose). What is the current state of VB6 to VB.NET converters out there and what are they? I'm trying to convince our company to convert its primary product over to .NET but our primary project is pretty huge (many forms, lots of db work, lots of CR9). Any suggestions are...
3
1348
by: Peter | last post by:
Hi, My C# application is supposed to cooperate with legacy VB6 code, but I am little bit worried if and how far C# strings, double etc. in the method interfaces will work smoothly from VB6 code. In VB6 code below an array of string "params" is passed to the C# method SetParameters. VB6:
8
10701
by: intrepid_dw | last post by:
Hello, all. I've created a C# dll that contains, among other things, two functions dealing with byte arrays. The first is a function that returns a byte array, and the other is intended to receive a byte array as one of its parameters. The project is marked for COM interop, and that all proceeds normally. When I reference the type...
16
2573
by: Ben Hannon | last post by:
Hi, I'm writting a COM Class in VB.NET to be used in a VB6 project (Tired of the VB6 hassles with cloning and serializing an object). All my classes I need cloneable/serializable are now in a VB.NET class that exposes those objects to COM perfectly. However I ran into a problem because some of these objects requires a Collection. When I...
13
3300
by: Metallicraft | last post by:
I have a vb6 application. On the main form is a picture box with one or two images and several pieces of text displayed in it. These are created on the fly using gdi32 routines that are all in a referenced, custom dll. I call a PrintImage routine in the dll and pass it only the the Picturebox.hdc from the main form. The dll's print routine...
66
3675
by: Mitchell S. Honnert | last post by:
In some recent posts, I've seen people who seem to be waxing nostalgic with respect to the "ease of use" of Visual Basic 6. I can't quite put my finger on it, but they seem to be implying that VB6 was simpler to use than VB.NET, that it was somehow easier to write programs in VB6 than in VB.NET. I have to admit I'm astonished by this...
9
2547
by: Terry | last post by:
I am converting (attempting) some vb6 code that makes vast use of interfaces. One of the major uses is to be able to split out Read-only access to an obect. Let me give you a simple (contrived) example: In Project RoObjDefs: RoPerson.cls file: Public Property Get FirstName() as String Public Property Get LastName() as String <end of file...
10
1303
by: AK | last post by:
Hello All, We received this in response to a question we had posed at a trade show meeting. Our proposed app's target features consist of a business application to crunch numbers, show forms, send emails and have Database access, would be web enabled so users set permissions, manipulate user accounts, and billing over web, manipulate...
1
2210
by: Bartholomew Simpson | last post by:
I know this is a VB.Net ng. But hopefully, someone remembers some classic (VB6) coding - besides I've not had any response when I posted this to the VB6 specific ng. I wrote a C++ librray that I want to use in VB6. I have exported a C API (via a win32 DLL) that may be used in VB6 using the 'Declare Function' syntax. However, I need to...
7
2668
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
I have a C# logging assembly with a static constructor and methods that is called from another C# Assembly that is used as a COM interface for a VB6 Application. Ideally I need to build a file name based on the name of the VB6 application. A second choice would be a file name based on the # COM interface assembly. I have tried calling...
0
7584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8109
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7645
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2085
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1202
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.