473,609 Members | 1,874 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Resetting Environment.Get CommandLineArgs

Is there a way to reset CommandLineArgs programmaticall y?

Anatoly
Nov 21 '05 #1
5 2278
Is there a way to reset CommandLineArgs programmaticall y?


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******@ace r-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.Threadin g.Thread(Addres sOf pNewDocThread)
NewDocThread.St art()

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.Threadin g.Thread(Addres sOf pNewDocThread)
NewDocThread.St art()

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
2261
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. For example, if I'm looping through a database, and I've already written 10 records to the browser, and then an error occurs, is it possible to send a command to the browser that makes it drop everything it's received thus far, and then just have...
8
18749
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 access databases. The server is a Dell Dual 2.4Ghz XEON with 512Mb Ram. Every few days I get the error 'HTTP/1.1 New Session Failed' and the server stops showing the sites. It comes right after a bit and then the error comes back. I
1
2292
by: Mahishapura | last post by:
How do i write GetCommandLineArgs implemention? Can any one help
1
1711
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. Is there a simple fix for this? TIA Neil
4
1149
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
9528
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 this as an element of the string array it
2
1808
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 the state after the OnLoad event
4
4072
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 have to click it twice to do the job (the first submit resets the sessions but this it too late to change the field values, which requires another submit to pick up the new session values). Problem is I cant think how to accomplish the resetting of...
0
1186
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 using the following code:-
2
2417
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 so the path can be saved in the grid. After the dialog is closed the program cannot find any of the images that are part of the project. I believe that using the open file dialog is changing the working directory and causing the error. Is there...
0
8091
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8579
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8232
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8408
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7024
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5524
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4032
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1686
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1403
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.