473,486 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Resetting Environment.GetCommandLineArgs

Is there a way to reset CommandLineArgs programmatically?

Anatoly
Nov 21 '05 #1
5 2257
Is there a way to reset CommandLineArgs programmatically?


What do you mean by reset? The command line arguments are what they
are, set when the application is started.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 21 '05 #2
That's right, I started an app. from command line, then inside this app
I start a new instance of the same app. When this new instance starts,
for some reason it thinks it got started from command line even though I
start this new app on a new thread.

-Anatoly

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Nov 21 '05 #3
"Anatoly" <as******@acer-access.com> schrieb:
That's right, I started an app. from command line, then inside this app
I start a new instance of the same app. When this new instance starts,
for some reason it thinks it got started from command line even though I
start this new app on a new thread.


How do you start an application on a "new thread"?!

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #4
Here is basically the code of New Thread:
(I've removed some of other misc settings I'm doing in pNewDocThread,
but this is the core code.)

'Start new thread.
Dim NewDocThread as New System.Threading.Thread(AddressOf pNewDocThread)
NewDocThread.Start()

Public Sub pNewDocThread()
Dim frm As New PTPApp
Application.Run(frm) 'Start new instance of App.
End Sub

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Nov 21 '05 #5
Anatoly schrieb:
Here is basically the code of New Thread:
(I've removed some of other misc settings I'm doing in pNewDocThread,
but this is the core code.)

'Start new thread.
Dim NewDocThread as New System.Threading.Thread(AddressOf pNewDocThread)
NewDocThread.Start()

Public Sub pNewDocThread()
Dim frm As New PTPApp
Application.Run(frm) 'Start new instance of App.
End Sub


Application.Run does not start a new instance. Application.run contains the
message loop keeping the Thread alive and handling the messages send to it.

This is not a new application (AKA process). It's only a new thread in the
same process.

How to pass arguments to threads:
http://msdn.microsoft.com/library/en...ingthreads.asp
(see "Passing Data To Threads")

Within the thread, don't refer to the command line arguments but to the data
passed to the thread. If you want to have only one thread work with the
command line arguments, pass the arguments only to the first thread in sub main.

Armin
Nov 21 '05 #6

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

Similar topics

3
2253
by: The Plankmeister | last post by:
Hi... I'm getting to grips with custom error handling, and am wondering if it is possible to somehow reset all the content already sent to the browser, and send some new stuff in its place. ...
8
18731
by: riprod | last post by:
Someone in the IIS newsgroup suggest I post this here, so sorry in advance for the cross posting. I have a Win 2003 SP1 with IIS 6 and host about 40 websites, most of them useing ASP/VB with...
1
2279
by: Mahishapura | last post by:
How do i write GetCommandLineArgs implemention? Can any one help
1
1705
by: Frantic3d | last post by:
I just started using Access' Template file "Time & Billing Database" Well among other items I need to change the biggest right now is resetting the Client, Employee, Project ID #'s to start at 1. ...
4
1144
by: Robert Blackwell | last post by:
How do you reset Visual Studio's preferences and stuff to default? And more directly, how do I turn back on line numbering?
16
9480
by: Chad Z. Hower aka Kudzu | last post by:
Im using Environment.GetCommandLineArgs(). However some of the arguemtns passed in have spaces, so I enclosed them in "". For example: "c:\temp\My area\" The problem is when I access...
2
1800
by: DeveloperPDX | last post by:
I am creating a page and I need to add a reset button (like you would with HTML forms). Is there any way to do this other than resetting individual controls? Basically I need to page to return to...
4
4055
by: Ian Davies | last post by:
Hello I am struggling for a solution to clear some fields on my webpage that takes their values from some sessions My solution below works when the button is clicked twice. I sort of know why I...
0
1176
by: teejayem | last post by:
Hi. I have searched the groups and have been unable to find an answer to my question. I am trying to reset the password of a user account in active directory. I have been trying to do this...
2
2410
by: Tim Kelley | last post by:
I have a project that includes images as part of the project. I have a grid (Infragistics) with a button that the user clicks and it brings up a file open dialog that is used to browse to a file...
0
7173
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...
1
6839
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...
0
7305
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4863
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...
0
4559
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...
0
3066
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...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1378
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 ...
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.