|
I know I should avoid anything that has to do with UI. But Background Worker does not exectly fit that criteria. Is the information regarding the Background worker event corrent?
|
|
|
|
|
I can't see any reason why BackgroundWorker shouldn't work in a service.
Its just using delegates and normal events.
I also googled a little bit. It says it works on a service but this class is designed for
UI purposes only so you shouldn't use it. Just use a normal Thread, this will work in any case.Greetings
Covean
|
|
|
|
|
|
Did you read the last message on this board?
"It works fine in a console or service app with no forms. The delegates are
run on thread pool threads instead of the UI thread. So there is nothing
special going on, just delegates, BeginInvoke, and events. Try it yourself." Greetings
Covean
|
|
|
|
|
BETA1 releases of Microsoft Enterprise Library 5.0 and Microsoft Unity 2.0 are available for evaluation now.
Those who followed the progress of the patterns & practices team through the regular iteration-end code drops are aware what a massive undertaking this has been! With exception of the integration with the Visual Studio, this release is feature complete. Enterprise Library users who are looking at this release for the first time, please review thee Change Log.
The team is very excited about the improvements they’ve made to the overall Enterprise Library architecture and configuration experience, both of Enterprise Library and Unity (with new configuration tools, fluent interface and IntelliSense support with new schemas). They also focused on making Enterprise Library easier to extend.
Here’s your call to action. Download this Beta1 release. It will quite happily run side-by-side with earlier versions, so you can easily evaluate it without disrupting your development environment. Try the new features. Attempt a migration of an existing application. Tell Entlib Team about your experiences.
|
|
|
|
|
|
This appears to be nothing to do with .NET, try the Database forum. MVP 2010 - are they mad?
|
|
|
|
|
I am using System::Data::OleDb::OleDbConnection. I know SQL; the problem is that some SQL code does not work fully with some .NET providers. I will try the database forum.
|
|
|
|
|
I have a gridview that displays a delete LinkButton. I also have a javascript confim box display before any action is taken. This works just find. What I want to do is insert a carrage return in the confim box. I thought that I could use "\n" but for some reason when I try this the confimation box does not display and the row is deleted. below is the function I have that is displaying the box.
protected void SetDeleteButton(Object sender, EventArgs e) {
LinkButton btn= (LinkButton)sender;
btn.Attributes.Add("onclick", "return confirm(\"Removing this Category will remove all Sub-Categories and Products tied to this Category. Are you sure you want to proceed? \");");
}
I get what I want from this except the format of the text is not neat. I would like to center the text if possible. and I want a new line where its asking the question "Are you sure you want to proceed?"
|
|
|
|
|
use
\\n for the new line.
|
|
|
|
|
lol
I diffently should have seen that. Guess I was just having a brain fart.
Thanks
|
|
|
|
|
Does Windows Workflow similar to Spring WebFlow? or MVC 2 is more closer to WEbFlow?
Thanks,
koko
|
|
|
|
|
Try the Workflow forum. MVP 2010 - are they mad?
|
|
|
|
|
Hello folks,
Can somebody clarify the "OnChanged" event.
Suppose I am copying/transferring a large file, does "OnChanged" fire up for every succesful bytes written? or when the operation is completed?
Thanks,
Koko
|
|
|
|
|
bluish wrote: does "OnChanged" fire up for every succesful bytes written?
No, that is unspecified, hence it will fire at least once, that is all we know. In practice, it fires once for a small file change, and multiple times for a large change.
And FSW does not signal the end of anything, so you often need either a timeout (unspecified duration!), or a loop with try and wait on failure.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
Thanks for the response Luc.
You mentioned interesting point about the loop.
If I choose to use the loop to monitor the file operation, what do I have to look for to know that the transfer/copy operation is complete?
Thanks,
koko
|
|
|
|
|
Most file producers create/open the file disallowing read operations by other processes, so opening or copying the file would fail ("file in use by other process") as long as the producer isn't done.
If the producer does allow concurrent reads (as an application should do with log files e.g.), then there is no definitive solution AFAIK; your best option then would be to watch file size and wait for a sufficiently long stand still.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
From the Changed event documentation:
The Changed event is raised when changes are made to the size, system attributes, last write time, last access time, or security permissions of a file or directory
NTFS does not update the last accessed time of a file every time it is written to. From the MSDN Docs on NTFS:
Not all file systems can record creation and last access times, and not all file systems record them in the same manner. For example, the resolution of create time on FAT is 10 milliseconds, while write time has a resolution of 2 seconds and access time has a resolution of 1 day, so it is really the access date. The NTFS file system delays updates to the last access time for a file by up to 1 hour after the last access.
Interesting, isn't it?
|
|
|
|
|
Hi all,
I have been programming in Visual C++/MFC for some time now and it can be a frustrating experience. Often I find myself implementing various workarounds for deficiencies in container classes, controls, dialogs and serialization. Also, documentation seems to be very fragmented. Sometimes I get hung up for days on something which should be very simple. Of course I know that every environment has it's quirks but hopefully things have improved with C#/.NET as opposed to a whole new, possibly bigger set of problems.
I thought I would list a few of my most frustrating experiences with C++/MFC to elicit comments comparing C#/.NET. I have started reading up on C#/.NET and I know it has many improvements but it's nice to hear from those using it before I jump in.
1. Container classes - I know that C# has reworked these. I use C++ CArrays extensively and although they work well for the basics, it's gets very tiring having to write workarounds or pure C code for things like multidimensions, sorting and serialization. Everytime I want to serialize a CArray with mixed types (CStrings), I have to implement a template override and depending in what MFC generated class the array/template lives, it may not be called and I have to cross my fingers that serialization will be reliable. As if this wasn't bad enough, MS documentation on this workaround consists of one poorly worded paragraph - took me ages to realize why serialization of Array based CStrings was not reliable.
2. Tabbed dialogs - I once had to make a fairly complicated tabbed dialog that was able to save user settings(via serialization) and restore them automatically on initialization - you can't believe how much code this required because of quirks in the behavior of property sheets/pages and inconsistent behavior of serialization from the property page class. Implementing the same behavior in a simple dialog would be trivial. It seems that MS .NET tabbed dialogs behave just like regular dialogs which would be a godsend.
3. Serialization - in addition to the problems with arrays, it seems like an excessive number of poorly documented macros are required. The whole IMPLEMENT_SERIAL/DYNAMIC/DYNCREATE macros are very confusing. I know most people use alternate methods but I hate to reinvent the wheel.
4. Lack of useful controls. I once needed to display lots of data in a grid format and ended up using Flexgrid which it seems was never intended for general useage. Also, implementing controls in the mainframe border area (ex. a color picker like the one in paint) is extremely difficult.
5. Modifying behaviour of framework - I often need slightly different behavior with regards to the mainframe/childframe. A lot of this knowledge seems to be tribal. For example, I recently had to modify the child window title based on various program conditions. This is fairly common - many apps will place a '*' next to the filename if source is modified. I found a webpage on methods of doing this. They presented several possible methods but they basically admitted that none worked well or at all due to framework code unknowns. Luckily I saw that someone gave a reply to the article that gave me a working solution. I could not find any documentation on MS.
|
|
|
|
|
Is there a question (or even a point) here? I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Good grief Mark,
We can only ask specific coding questions?
My intent was to get some idea if these types of issues are less likely to be an issue with .net as my projects tend to encounter the listed issues frequently.
|
|
|
|
|
Your post looks and sounds more like a rant that should be in the soapbox or the lounge than an actual question. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I tried for years, but never mastered C++/MFC. I gave up trying for a few years because of the frustration of trying to learn it, and make sense of the garbage Microsoft passes off as documentation. I even bought the 4-volume set of MFC documentation from Microsoft, and it's just as fragmented and useless as the online trash.
I recently started over, trying instead to learn C# and the .Net Framework, and I can assure you that it is a relative joy to work with. I only have a couple of nights a month available to work on learning it, but I'm already accomplishing things that I found impossible to do after many years of trying in MFC. No doubt those who love C++ will be offended by my remarks, but I'm finding C# a pleasure to learn and use, though it will probably take a lifetime to learn the Framework. The selection of controls is vast, and you can modify anything you like to get the behaviors you need.
Give it a go for a few months. I don't think you'll look back..."A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Why bring this here? It has nothing to do with .NET and really needs to be directed at Microsoft. My experience of MFC was that although seemingly complex for a beginner it worked well once you mastered the basics. I used it quite extensively in my professional life as a developer and did not have any real issues with it. MVP 2010 - are they mad?
|
|
|
|
|
The release candidate for Visual Studio 2010 and .NET Framework 4 is available for download. The downloadable release candidate was offered to MSDN subscribers on Monday. Non-members can get it on Wednesday.
For more information about the Go Live license, how to get free developer training, and get your copy of the release candidate, see Visual Studio 2010, .NET 4 Release Candidate Ships[^]
|
|
|
|