|
Hello,
I am developing a windows service using the WCF technology(this contains the windows service and also hosts a webservice) in C#.net3.0. I am developing this on the windows XP platform.
Here, i have two class files WCFservice.cs and WindowsService.cs. There is a single thread declared, started (in OnStart()) and Aborted(OnStop()) methods of the WindowsService.cs file.
Now, my requirement is to, suspend() and resume() the same thread in the WCFservice.cs file.
since, the WCFservice class is inherited from IWCFservice and WindowsService class is inherited from the ServiceBase class, i am unable to fix my problem of accessing the same threadObj from both these files.
Can anyone help me here...
Thank you
Anee..
Anee
|
|
|
|
|
I think, you could, in the OnStart function that runs first, store a reference to the current running thread:
Thread _currentThread;
OnStart()
{
_currentThread = Thread.CurrentThread;
}
This should give you a handle to the current thread. You could then add the following code which can be invoked from a different thread:
void Suspend()
{
_currentThread.Suspend() //Depracated - Use Alternative Threading Technique
}
void Resume()
{
_currentThread.Resume() //Depracated - Use Alternative Threading Technique
}
This isn't a good solution, but it's a rought template that might nudge you in the right direction.
Alternatively, it may not be what you're looking for.
Hope it helps anyway.
Tris
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
Hi Guys,
I have a rather long running process that was populating a list view, and i have now moved this process to a worker thread with callback for each new item. I use the RequiresInvoke check to re-schedule the callback with the UI Invoke.
This loads fine, but i get a lot of flickering with each item loaded, and it looks ugly as hell. I'd like to be able to use the items in the list before its completed loading (this works fine atm), so i can't defer loading.
Any ideas how to solve this? Or could it be Vista sucking eggs?
Cheers
Tris
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
modified on Wednesday, January 23, 2008 8:08:20 AM
|
|
|
|
|
Tristan Rhodes wrote: Any ideas how to solve this?
More of a guesss
Tristan Rhodes wrote: Or could it be Vista sucking eggs?
Or it could be Vista not sucking eggs. I mean if all of this is happening fast enough then your updating the list one by one so frequently that it is of course causing a flicker. One potential approach is to buffer the new items or throttle the adding of the items so that you do a group of them every few seconds rather than adding a new one every nnn milliseconds. Of course make sure to use BeginUpdate/EndUpdate.
led mike
|
|
|
|
|
Hello
I am finding something that can convert VC++ project to C#.net
Anyone can help me?
Thank You
|
|
|
|
|
There isn't anything that can do that. You have to rewrite the code from scratch.
|
|
|
|
|
Sunil123 wrote: I am finding something that can convert VC++ project to C#.net
Anyone can help me?
The human brain. That's about it. There are just too many differences for this to be done effectively by a tool.
|
|
|
|
|
You are going to have to pretty much rewrite from scratch. Map out what the C# code is doing and hand translate to C++.NET.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
Looks like you're going to have to become an honest-to-god programmer now. No more hiding behind cut/paste.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
By hand.
Its not all bad though - Managed C++ will pretty much compile your existing code, you'll just have to decide what managed interface to expose. That depends on what your library does...
|
|
|
|
|
Its been a year that i have used .NET for development, and now am back to it again.
Now, the problem is that I need to work on an application developed on the .NET 2.0 framework, and am wondering which MS IDE to use with it
should i use:
- Visual Studio 2005
- Visual Studio .NET Professional
- Visual Studio .NET 2003
- Visual Studio 2008
I dont have the MSDN subscription for VS .NET 2005
HELP!
------------------------------------
Vision is the ability to see the invisible
|
|
|
|
|
.NET 2.0 = Visual Studio 2005.
Though 2008 can use .NET 2.0, 3.0, and 3.5.
|
|
|
|
|
Dont i need to use something like
VS .NET 2005 ??
I am confused if i would be able to work with the 2.0 features and ASP pages in VS 2005?
------------------------------------
Vision is the ability to see the invisible
|
|
|
|
|
There is no ".NET" version of 2005. ".NET" was dropped from the Visual Studio name with the release of the 2005 version.
|
|
|
|
|
You could always use one of the free Visual Studio Express editions. There's a version for web development - Visual Web Express, and a straight Visual C= version.
|
|
|
|
|
If you need to target the .NET Framework v2.0 you can use any of the Visual Studio 2005 or Visual Studio 2008 versions.
The breakdown looks basically like this:
Visual Studio.NET .NET 1.0
Visual Studio.NET 2003 .NET 1.1
Visual Studio 2005 .NET 2.0
Visual Studio 2005 (with .NET 3.0 extensions) .NET 2.0, .NET 3.0
Visual Studio 2008 .NET 2.0, .NET 3.0, .NET 3.5
There is not VS.NET 2005. The "VS.NET" name was dropped after VS.NET 2003.
Keep in mind that using VS2008 to target .NET 2.0 or .NET 3.0 you are actually targetting .NET 2.0 SP1 and .NET 3.0 SP1.
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
Easiest would be to stick with VS2008 all the time because not only do you have much better features and an environment to work with but it can also target .NET 2.0 as well as 3.0, 3.5 etc and do all the classic stuff like VC++.
|
|
|
|
|
VS2008 allows targeting of 2.0, 3.0, and 3.5...
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
I have a case where an assembly dynamically loads another assembly based on what it needs to get done. In some cases, it loads itself (or a copy of itself - not sure) to attend to the task at hand.
Is this a problem from any standpoint? Performance hit? Over utilizing memory, bad practice, etc?
Thanks,
Andrew
|
|
|
|
|
Only one copy of the code is loaded, whether you do it normally or by reflection.
There's no ill-effects to the rest of the system if you do it through reflection. Though, calling methods and instantiating objects through reflection is a bit slower.
|
|
|
|
|
|
|
Don't cross post, it's considered rude
|
|
|
|
|
Hi !
I want to make some kind of Process/application/EXE that cannot be terminated using the task manager. for the security purpose.
Thank you
Sunil Patel
|
|
|
|
|
Sunil123 wrote: for the security purpose
I think you might want to rethink your security strategy.
|
|
|
|