|
I wrote a windows service that runs under the system account.
This service should launch other programs and monitor them, so it's a kind of a watchdog.
I use the System.diagnostics.process class to launch these programs.
The code is working perfectly when I run this in a simple console.
but this doesn't work in the service.
Process.start() simply returns, no program is launched, no exception is thrown...
what is wrong here ?
Is there another approuch that I can try?
gr,
Niko
<< Nearly all men can stand adversity, but if you want to test a man's character, give him power. >>
|
|
|
|
|
NikoTanghe wrote: Process.start() simply returns, no program is launched, no exception is thrown...
what is wrong here ?
The problem is you don't understand how services work. Services run under their own desktop, NOT the users desktop that you can see. The Process.Start() code worked. The application was launched. All you have to do is open TaskManager and click on the Processes tab to see that.
You have to configure your service to interact with the users desktop. Click Start/Run, then type SERVICES.MSC and hit enter. Find your service in the list and double-click it. Click on the LogOn tab and find the little check box that says something like "Allow server to interact with desktop" and enable it.
Now, YOU HAVE A MUCH BIGGER PROBLEM. Services run all the time, even when noone is logged into the machine. So, with no user desktop to show an app, you're service will still launch the applications, but noone will ever see them because there is no user desktop! Just logging into the machine will NOT automatically show you the launched applications either. They will be running, but on the services desktop only. There is no way to transfer the application between desktops. In order for the logged in user to see them, the applications would have to be killed and restarted.
Notice, in the .NET Framework's Service classes, that you don't get any "User logged on" events...
|
|
|
|
|
Before I used VC++, there is one command "Alt+F8" can realize the smart indent,
is there any similar command in VC#? I can not find it.
Please let me know if you knows. after all it is helpful!
thanks
|
|
|
|
|
In VS 2005, there's two commands, Format Selection (Ctrl+E, F) and Format Document (Ctrl+E, D), under the Edit/Advanced menu.
Not sure if that's what you're asking though....
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
I have some user defined functions in .vb/.cs page that I am calling in .aspx page that is perfectly working in VS.NET 2005 but when I migrated it to 2000 it is giving compilation error that "XYZ function is not declared."What can be the reasons ??
give your valuable suggestion.
Thanks in advance
adil kazmi
|
|
|
|
|
adilkazmi wrote: I have some user defined functions
There is no concept of user defined functions in .NET. SQL Server has user defined functions. What do you mean by this?
adilkazmi wrote: but when I migrated it to 2000
There's no such thing as VS.NET 2000. Again, what do you mean by this?
Paul Marfleet
|
|
|
|
|
adilkazmi wrote: that is perfectly working in VS.NET 2005 but when I migrated it to 2000
That's no such thing as VS.NET 2000. There's 2002, 2003, 2005, and soon to be 2008. Did you write an ASP.NET 2.0 application in VS 2005 and you're trying to migrate it back to an ASP.NET 1.1 app in VS.NET 2002 or 2003?? That's not going to work.
|
|
|
|
|
HI,
i've gor a form that act as a MDIparent
in that form there is another form - ChildForm
when i double click it and it expand it's covering
the FatherForm MenuStrip
i like it to expand but not to cover the FatherForm MenuStrip
any idea's?
THNKS
have a great day
kobkob
|
|
|
|
|
Did you set the MenuStrip's Dock property to Top in the MDIParent?? Calling it the "FatherForm" will probably confuse a few people.
|
|
|
|
|
Dave Kreskowiak wrote: Calling it the "FatherForm" will probably confuse a few people.
Yeah, call it the MotherForm instead
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|
|
HI,
yes it's by default
when i expand the ChildForm it's still cover the MenuStrip (not COvering so that it can not been seen but they get mixed togther, as now the ChildForm has The "ParentForm" Manustrip,
i'd like to expaned only just below the MenuStrip
Either way THNKS
and i will change from "Father" to "Parent" more accuret
kobkob
|
|
|
|
|
This is the functionality of MDI forms. The menu of the MDIChild gets merged with the menu of the MDIParent. The form isn't hiding behind the menustrip. This is how it works if you maximum an MDIChild. No, you can't change it.
|
|
|
|
|
Thanks
have a great Day
kobkob
|
|
|
|
|
HI,
I found here a MDI wizardinstaller,
i did every thing needed, but when i try to create a new projct of
MDI App i get thid error :
"File name or Class name not found during automation operation"
i'm using MS VS 2005
in the realse folder of the MDI wizard i found the :
CSharpSDI_VS2005.vsz
CSharpMDI_VS2005.vsz
files
Did anyone encounterd that kind of froblem?
and if u can give me another View of MDI (HOW TO & etc.)
a Link Or another MDI Wizard (Maybe an MS One, cause i did not found)
THNKS
kobkob
|
|
|
|
|
"Hashtable[]" is return object, I hope it return XmlAttribute object.
Which method need I to override?
|
|
|
|
|
You want to use the Dictionary class, which uses generics to specify type. Or if you know it's an XmlAttribute you can either derive from the Hashtable class and force the cast in there, or cast it yourself.
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 friends
How can I create a communication between two client that have invalid IP, with a server that has valid IP (like a mirror)?
|
|
|
|
|
If their IP is invalid, no-one can.
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 )
|
|
|
|
|
The two clients have server IP (it is valid) and connect to it, and server must create a communication between them (with two different ports).
How server can do ihis?
|
|
|
|
|
Ah... What was invalid then ?
The way to do this, is that the server sends each client the other client's IP address, then they can talk directly.
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 )
|
|
|
|
|
Hello Every body,
I had develop an desktop application in c# with dotnetframwork 2.0. The application is working fine but i am facing problem in crystal report.
I am getting the following error message :
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.TypeInitializationException: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception. ---> System.Runtime.InteropServices.COMException (0x800736B1): Retrieving the COM class factory for component with CLSID {11BD5260-15B6-412D-80DB-12BB60B8FE50} failed due to the following error: 800736b1.
at CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor()
--- End of inner exception stack trace ---
at CrystalDecisions.CrystalReports.Engine.ReportDocument..ctor()
at CrystalDecisions.CrystalReports.Engine.ReportClass..ctor()
at alokInventorySystem.outsideDelhiCustomerInvoice..ctor()
at alokInventorySystem.printInvoice.printInvoice_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
alokInventorySystem
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files/AspDotNet/AlokInventorySystemSetUp/alokInventorySystem.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Data
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Transactions
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.EnterpriseServices
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
----------------------------------------
CrystalDecisions.Windows.Forms
Assembly Version: 10.2.3600.0
Win32 Version: 10.2.51014.0
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/CrystalDecisions.Windows.Forms/10.2.3600.0__692fbea5521e1304/CrystalDecisions.Windows.Forms.dll
----------------------------------------
CrystalDecisions.Shared
Assembly Version: 10.2.3600.0
Win32 Version: 10.2.51014.0
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/CrystalDecisions.Shared/10.2.3600.0__692fbea5521e1304/CrystalDecisions.Shared.dll
----------------------------------------
CrystalDecisions.ReportSource
Assembly Version: 10.2.3600.0
Win32 Version: 10.2.51014.0
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/CrystalDecisions.ReportSource/10.2.3600.0__692fbea5521e1304/CrystalDecisions.ReportSource.dll
----------------------------------------
System.Web
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll
----------------------------------------
CrystalDecisions.CrystalReports.Engine
Assembly Version: 10.2.3600.0
Win32 Version: 10.2.51014.0
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/CrystalDecisions.CrystalReports.Engine/10.2.3600.0__692fbea5521e1304/CrystalDecisions.CrystalReports.Engine.dll
----------------------------------------
CrystalDecisions.ReportAppServer.CommLayer
Assembly Version: 10.2.3600.0
Win32 Version: 10.2.9700.0
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/CrystalDecisions.ReportAppServer.CommLayer/10.2.3600.0__692fbea5521e1304/CrystalDecisions.ReportAppServer.CommLayer.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box
Regards,
rahul saini
|
|
|
|
|
This error raises when you use installed application? If yes, have yo included Crystal Reports Merge Module? If not you, the cause maybe this.
Visit my blog at http://dotnetforeveryone.blogspot.com/
|
|
|
|
|
Hi,
Sorry I was out of town.
Actually this error occur when the report is generated not at the time of installation. I was working fine but as the system reboots this problem occurs at the time of report generation.
Regards,
rahul saini
|
|
|
|
|
public ArrayList listcht = new ArrayList();<br />
byte[] comparar = new byte[10];<br />
<br />
comparar[0] = 0x57;<br />
comparar[1] = 0x33;<br />
comparar[2] = 0x58;<br />
comparar[3] = 0x20;<br />
comparar[4] = 0x56;<br />
comparar[5] = 0x69;<br />
comparar[6] = 0x73;<br />
comparar[7] = 0x69;<br />
comparar[8] = 0x6f;<br />
comparar[9] = 0x6e;<br />
listcht.Add(comparar);<br />
<br />
<br />
comparar[0] = 0x57;<br />
comparar[1] = 0x33;<br />
comparar[2] = 0x58;<br />
comparar[3] = 0x31;<br />
comparar[4] = 0x76;<br />
comparar[5] = 0x73;<br />
comparar[6] = 0x31;<br />
comparar[7] = 0x48;<br />
comparar[8] = 0x61;<br />
comparar[9] = 0x63;<br />
listcht.Add(comparar);<br />
<br />
comparar[0] = 0x57;<br />
comparar[1] = 0x33;<br />
comparar[2] = 0x58;<br />
comparar[3] = 0x43;<br />
comparar[4] = 0x75;<br />
comparar[5] = 0x73;<br />
comparar[6] = 0x74;<br />
comparar[7] = 0x6f;<br />
comparar[8] = 0x6d;<br />
comparar[9] = 0x4b;<br />
listcht.Add(comparar);<br />
}
The problem here is the comparar[] array byte can't assign the new values
why? they maintaine the old values.
well, the sort soluction is redeclare the array
|
|
|
|
|
When you add the array to the list, it's not copied. The list is just a list of references, and you add the reference to the array, not a copy of the array.
You add the same array three times to the list, so all the items in the list will be the same actual array. When you change the contents of the array, it will change the contents of all items in the list, as they are all the same object.
---
single minded; short sighted; long gone;
|
|
|
|