|
I have a simple Windows Service. It is a timer loop, and when the timer expires it calls an external component to check if certain tasks need to be executed.
I noticed it was leaking memory. The Service itself does nothing but call a function in the external component, and it creates one reference to this component at startup and keeps this single reference to the component throughout the service lifetime.
At first I thought this might be a Timer problem, because it leaks memory every time the Elapse event expires.
But after a lot of experimentation, I determined that the memory leak actually occurs because of a call to write an entry in an EventLog. If I remove the EventLog entry write from the Timer_Elaspe event, the memory leak goes away.
I'm running Framework 1.1 on Win2K Service Pack 4.
Anyone else seen this problem??
|
|
|
|
|
I need to create a windows user account and add permissions for a specific folder. I have to code to create a auser, but how can I add permissions for this user on a specific folder?
|
|
|
|
|
Can someone suggest a tool to find the dependencies of a .NET assembly?
|
|
|
|
|
|
|
How can I get information about currently logged users (user names) in windows?
--
Digitally yours, Bounz
|
|
|
|
|
Hi all,
I am working in .NETCF.I am developing similar to paint software for Pocket PC using .NETCF.I like to do cut/copy/paste. For that I need to select particular area in picture box. How to do that.
If I am draw the rectangle then it is merged to the picture box. So I am not able not able to zoom that.
If I am creating new bitmap with rectangle drawn. But it is not transparent. So I am not able to view the actual picture behind that bitmap. How to handle this. Please help me.
Regards,
S.Sevugan.
|
|
|
|
|
how to pass messages between java and .net without using sockets
Mohamed Hasan is usally called as Hasan. He is very much interested in C++ programming . He slowly picking up .NET programming. He done his Bachler degree in Arumugam Pillai Seethai Ammal college Thiruppathur. and Master degree in MK university College.
Contact him at: hasansheik@hotmail.com
hasansheik@yahoo.co.in
hasansheik@lycos.com
|
|
|
|
|
|
We have an API from a contributor that provides us access to their data via web services. My code is a small server that runs 24/7 and repeatedly (every 5 seconds) requests updates via a call to a web service method. So far it seems that after a day or two of continuous running, this call ends up blocking forever.
Looking into the wrapper code, I see that it is derived from the System.Web.Services.Protocols.SoapHttpClientProtocol class, and the wrapper method ends up calling Invoke().
The docs claim that you can set a timeout using the Timeout property of the class. They further claim the default timeout is 15 seconds. This does not seem to be the case otherwise the call would return after 15 seconds, wouldn't it? Is there something else I'm missing?
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
Newbie question.
I have a .net form (C++) and all I want to do is launch an external application when a button is pushed. (e.g. MSWord or Notepad) The button is all setup, and right now I just have it displaying a message box when it's pushed. How can I tell the operating system to go launch this independent application?
Thanks in advance.
John
|
|
|
|
|
|
Thanks for the help.
In case anyone else has the same question, here's a direct link to the MSDN article and a code snip that I did based on it.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdiagnosticsprocessmemberstopic.asp
private: System::Void button2_Click(System::Object * sender, System::EventArgs * e)
Process *myProcess;
myProcess = Process::Start(S"Notepad.exe");
while (!myProcess->HasExited){
Thread::Sleep(500);
myProcess->Refresh();
}
myProcess->Close();
MessageBox::Show( "Complete", "Notepad has exited");
|
|
|
|
|
in earlier times it was possible to install a app with setup /r to record the user interactions in a Setup.iss. after that we run the setup in silent mode.
is the same posssible with a msiexec installation?
Ariadne
|
|
|
|
|
msiexec supports a /qn switch that will force it to run as a silent install.
But I am not aware of any equivalent to InstallShield's utility to generate a script to supply any required user fields.
You can supply default values in the MSI Properties table.
If you require things like a database login, obviously default values will not work. You may be able to accomplish this by having and administrator run an Admin install for his user groups. But I have personally never worked with Admin installs, and I am not very clear on exactly how they function.
Unfortunately the MSI documentation is poor at best ...
|
|
|
|
|
Hi all,
In my project we had system to log the exceptions through creating a text file for each day and writing the exceptions occured during tht day. The exceptions will be cathed through exception handling applied for necessary events.
There is system class called using 'System.Diagnostics' in .net.
Through which we can enter details in to a cutom log and we can see the details .
My point is it better to use the application orinted logging as we are doing or
Is it better to use the 'System.Diagnostics.EventLog()' for logging the errors.
Is any one worked on these concepts..? Please let me know the details.
Adavanced Thanks,
yeggu
|
|
|
|
|
Microsoft is pushing System Diagnostics logging, but I think you can argue for and against both methods.
There are two clear cut cases:
1) Windows Services should definitely use "System" logs.
2) If you still have to support Win98, there are no system logs, so a conventional file method is your only option. Of course you could create multiple versions, but I see no compelling reason to do so just for logging.
There are pluses and minus for both. For example, if you need to troubleshoot a weird problem it is a lot simpler to ask a client to find a folder and e-mail you a log file than it is to try to explain to them how to save a System log to a file and send it.
On the other hand if you actually have access to the Event log viewer, you can assign levels when you write messages and then System logs make it easy to find critical errors out of possibly a large number of insignificent messages.
Personally, I use both methods. If it is an application that I will be managing directly on a server I have access to I will use a System log. If it is a "3rd party app" that I don't expect to have direct access to once I've released it I ten d to still use the old fashioned flat file approach for the reason I've mentioned - I can always request an error log by e-mail if a problem arises.
You really have to evaluate your own specific situation.
|
|
|
|
|
Hi All!
I need to know that fromwhere I can modify the Install Shield script. I have created a setup in InstallShield X and now i want to modify its code. I cant find the code. It has just the design view...
Need Help immediately
Thanx
_mubashir
Marriala Technologies,
Pakistan
|
|
|
|
|
Hi
I am facing one problem while opening my Dot net project ?Error is coming like there "There is error on 1 Line:Expected '<' but found Auto attach" and the corresponding project file is not a valid project.
if anybody knows please help me out
dimp
dimp
|
|
|
|
|
Hii All!
I have created an application using Vb.net......Now I want to make its installer with Install Shield. I want the installer to check whether the .Net Framework is installed, if not then install it. I need to know that what kind of scripting is required to achieve it.
Regards
_mubashir
Marriala Technologies,
Pakistan
|
|
|
|
|
Search the MSDN for Bootstrapping the NET Framework. They have C++ source code that you can use as an example of how to check this. You should be able to convert that into Install Script, because is is essentially a "C" language.
|
|
|
|
|
Hi folks,
The following piece of C#.NET code creates an A4 size binary image by reading values from a two-dimensional byte array iPage[][].
Is there anyway I can further optimize the nested for loop inside the unsafe block? It is taking ~2.2s, and I'd love to bring it down further.
Sarab.
// page dimensions
iwd=iPage.Length;
iht=iPage[0].Length;
// create new bitmap
bMap=new Bitmap(iwd, iht, PixelFormat.Format24bppRgb);
// create bitmap data
bData=bMap.LockBits(new Rectangle (0,0,iwd,iht),ImageLockMode.WriteOnly,PixelFormat.Format24bppRgb);
// get bitmap position
Scan0 = bData.Scan0;
iStride=bData.Stride;
unsafe
{
// initialize pointer
byte *p = (byte*)(void*)Scan0;
int nOffset = iStride-iwd*3;
for(int y=0;y<iht;++y)
{
for(int x=0;x<iwd;++x)
{
if (iPage[x][y]==0) p[0]=p[1]=p[2]=255;
else p[0]=p[1]=p[2]=0;
p += 3;
}
p += nOffset;
}
}
PS. the code above is inspired from the article(s): http://www.codeproject.com/cs/media/csharpgraphicfilters11.asp
|
|
|
|
|
It looks like that about as fast as your going to get it without resorting to writing the thing in Managed C++.
Whoops! Accidently clicked Submit...
If you can come up with an algorithm to get rid of that if statement, you'll probably cut the time in half.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 18:01 Tuesday 27th September, 2005
|
|
|
|
|
hmm... not so confident in managed c++.. can't remove the if statement either!
thanks anyways...
|
|
|
|
|
What values does the byte array contain? Do you only swap 0 <-> 255 or does the byte array contain different values?
When it contains only 0 or 255, you can use p[0]=p[1]=p[2]=~iPage[x][y];
How do you create the iPage array? If you could swap it to be iPage[y][x], you could evaluate iPage[y] outside the inner loop. (byte[] thisRow = iPage[y] and then continue to use the inner loop).
Also, you might want to eliminate bounds checking on iPage array access by using a foreach loop (it looks slower, but the C# compiler generates special code (no bounds checking) when foreach is used on an array).
So propably this could be faster: (provided you swap x and y in your array creation and use only the values 0 and 255):
foreach (byte[] row in iPage) {
foreach (byte val in row) [
p[0] = p[1] = p[2] = ~val;
p += 3;
}
p += nOffset;
}
|
|
|
|