|
Thank you to those who made an attempt to assist me.
The problem is resolved. All I had to do was double click on Line 14 in the Error List in VS 10, and the fix code was inserted.
The application now runs correctly.
Any new developers might consider picking up Dan Clark's Beginning C# Object Oriented Programming. I could have saved myself about 5 hours of frustration, had I skipped to Chapter 5 and read it.
|
|
|
|
|
I would also suggest Charles Petzold's .NET Book Zero[^] as a great (and free) introduction to the basics of .NET and C#.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Thank you for the suggestion. I am on my way to retrieve the Petzold reading.
|
|
|
|
|
re Dan Clark's book: in terms of new developers, who are not coming from a more formal development methodology, experienced in structured-code informed by CS theory background, not already having experience with flow-diagrams, UML, etc.
I specifically would not recommend this book: the first sixty pages are general theory, and you don't get to the C# "meat," until much later in the book. But, if you are person for whom state-machine concepts, flow-chart diagrams, and UML models, are already salient: go for it
There are many better introductory books, imho, for C#, among them I vote for ones by Jesse Liberty, Matthew MacDonald, Troelsen, Sells, etc., perhaps the one from Deitel, and even Petzold's very old first book, as well as his current free one mentioned.
best, Bill
When I consider the brief span of my life, swallowed up in the eternity before and after, the little space which I fill, and even can see, engulfed in the infinite immensity of spaces of which I am ignorant, and which knows me not, I am frightened, and am astonished at being here rather than there; for there is no reason why here rather than there, now rather than then. Blaise Pascal
|
|
|
|
|
Bill:
I noted the authors you list, and will research further. As I do not have a background in CS (other than the watered down clases provided for teaching credentialing) I scoured the reviews on iProgrammer and Amazon.
There are going to be issues with most books and/or tutorials, and I find myself irritated with the "casual" editing(simple errors in grammar/syntax) in many books, but I "deal". It's almost as if there is a race to the publisher, and then a laundry list posted of errata (?). I am not speaking of language (the u in color outside of the US), but rather when the word should be window, and widow is the printed text. Again, I rant.
As to the Clark book, I enjoy his "teaching method" as he explains how something works and why, and I don't feel stupid, just ignorant. I admit to enjoying DFD so I was probably enchanted.
Thank you again for your insight and recommendations.
Deborah
|
|
|
|
|
Hi Deborah,
fyi: I've been involved with technical editing and documentation strategy for many years: most recently as a paid technical reviewer for two major .NET books from Addison-Wesley.
I omitted from my recommendations what I consider to the ultimate C# book, the palladium, the ne plus ultra, mainly because I believe it is a very advanced book: Jon Skeet's "C# in Depth"[^] (Manning Press, 2nd. edition now available).
My own review of that book is here:[^]. But you'll note some of the most voted-up reviews on Amazon for this book recommend it as a beginner's book.
I think the type of book that is "best" for someone starting any computer language, embedded in (an expression of) a complex FrameWork, and "incarnate" in a complex IDE, really is not a one-size-fits-all "answer."
What I do know is that in my own experience, as I immediately jumped on the C# bandwagon several years ago, from VB6, was that Petzold's first book helped me get "off the ground," and then Jesse Liberty's book, Programming C# (O'Reilley ... new revisions issued several times), really gave me what I needed, in conjunction with Matthew MacDonald's very clean expository prose.
For myself, it is only at this point, that I am able to read Troelsen and really follow the content about what happens "under-the-hood" in the FrameWork and the CLR, and find that salient, and relevant. And, only at this point, that I can find, in constantly re-reading the chapters in Skeet's book, continuing re-appraisal of my own understanding (and I'm still a long way from mastery of the depths of Skeet's astounding mind's thoughts and concepts).
But, that's just the story of one pilgrim: someone with a good academic CS background, someone who's already "grounded in OO," could have, I believe, very different needs, and make very different choices for a first book.
And, perhaps, also a matter of temperament ? Some folks cognitive style in technical problem-solving is very much top-down: they are most comfortable starting very high-level abstractions, and moving "down" to code-on-the-ground.
People like me are more "bottom-up" in learning style: I have to be constantly experimenting in code, trying out ideas, observing what happens, and then going back to the conceptual level, and the books for inspiration and, hopefully, understanding, followed by step-wise refinement of my own techniques.
best, Bill
When I consider the brief span of my life, swallowed up in the eternity before and after, the little space which I fill, and even can see, engulfed in the infinite immensity of spaces of which I am ignorant, and which knows me not, I am frightened, and am astonished at being here rather than there; for there is no reason why here rather than there, now rather than then. Blaise Pascal
|
|
|
|
|
Bill:
Thank you for your very detailed explanation of choices. As you indicate, cognitive style plays a great part in the resources with which people will be comfortable. It's never a one size fits all. This is one of the difficulties in college classes, where there is an assigned text, which is why I elected not to enroll in a programming class as I prepare to return for my second Master's degree.
When I first began learning C#,which appealed to me of all of the languages (probably because it's case sensitive...but who knows) I recognized I am top down in my own thoughts, but because I taught both middle school and adults, lessons had to be presented in a bottom up fashion. When I first began teaching, I was very much top down, and my students crashed and burned. With C#, I have just recently begun to "mess" with code (some of the problems posted here), but am not proficient enough to offer input. I like to see how I can solve the errors I immediately recognize before clicking F5.
I have printed your post as a reference for authors. I did go to Amazon and research the authors you had initially recommended, and added them to my wish list. I really need to "discover" if I am a developer. Research is my absolute love, and I was initially hired by my client to be a technical researcher, and then he offered the opportunity of learning to code. I hope I can live in both worlds.
You may be interested in the book, Designing with the Mind in Mind by Jeff Johnson. He discusses UI (another passion along with UX), and the book is truly marvelous.
Best,
Deborah
"UberElmR"
|
|
|
|
|
Hi
i am using a web browser control on a win form to display a webpage. it was working fine on xp 32bit.
During testing on Windows 7 64bit after some time i m unable to see my form.
Showdialog() call from button only display the icon and title of my form in taskbar, Form is not visible on the screen. only solution to make it work again is to remove my windows profile and create it again.
i cant understand the problem please help.
i am using VS2010 and C#
thanks
Nav.
|
|
|
|
|
You need to explain what your structure here is in more detail.
1. is the WebBrowser in a Container Control (like a Panel) ?
2. what exactly makes you unable to see your form ? what's covering it up, or on top of it ?
3. where is the Button that triggers the use of ShowDialog ?
4. what is the purpose of the Dialog show ?
5. how is the TaskBar involved here ?
6. what is the "Windows profile" you say you have to remove ?
When I consider the brief span of my life, swallowed up in the eternity before and after, the little space which I fill, and even can see, engulfed in the infinite immensity of spaces of which I am ignorant, and which knows me not, I am frightened, and am astonished at being here rather than there; for there is no reason why here rather than there, now rather than then. Blaise Pascal
|
|
|
|
|
I was doing a C# windows service. the service installs and runs well on my machine, but when i deploy on server (Windows server 2003), and try to start it, i get the dreaded 'Error 1067: application terminated unexpectedly'!
What to do?
some of the code is shown below:
i was doing a C# windows service. the service installs and runs well on my machine, but when i deploy on server (Windows server 2003), and try to start it, i get the dreaded 'Error 1067: application terminated unexpectedly'!
What to do?
some of the code is shown below:
[RunInstaller(true)]
public partial class MessagingInstaller : Installer
{
public MessagingInstaller()
{
InitializeComponent();
}
}
public partial class MessagingService : ServiceBase
{
private MessagingLogic msglgc;
public MessagingService()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
if (!EventLog.SourceExists("MessageLogger"))
EventLog.CreateEventSource("MessageLogger", "Event Logger");
var _log = new EventLog { Source = "MessageLogger" };
try
{
if (msglgc == null)
msglgc = new MessagingLogic();
msglgc.Start();
}
catch (ArgumentException exception)
{ _log.WriteEntry("OnStart Error: " + exception.Message); }
}
protected override void OnStop()
{
if (!EventLog.SourceExists("MessageLogger"))
EventLog.CreateEventSource("MessageLogger", "Event Logger");
var _log = new EventLog { Source = "MessageLogger" };
try
{
if (msglgc != null)
msglgc.Stop();
}
catch (ThreadAbortException exception)
{ _log.WriteEntry("OnStop Error: " + exception.Message); }
}
}
Please help! I need the solution as soon as possible
modified 14-Dec-11 11:00am.
|
|
|
|
|
Does msglgc get initialized to null ? Does it keep running? And shouldn't the Stop method set it back to null ?
|
|
|
|
|
Does the new log get created, do you see any messages, normal or exception ...? Try and gather some more information about exactly where it is failing.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
eyesark wrote: Please help!
You are assuming that only one possible exception can occur in OnStart.
However if any exception occurs in there then windows will think that the service didn't start.
You can look at System.ServiceProcess.ServiceBase.AutoLog.
If set to true, before any real processing then if OnStart exits with an exception then an event log entry will be written with the exception stack trace.
|
|
|
|
|
I suspect that the problem is to do with registering the event source. If you don't have enough privileges to do this, the application will abort at the point you are trying to do this because you are creating it outside of the try/catch block.
|
|
|
|
|
Hi all,
I have created one windows setup application,when i installed it on the system if i click two times the application is running two times as it should run once.
How can i solve it ?
Thanks in advance.
|
|
|
|
|
You should run your app using the Mutex class, something like this:-
bool isNew = true;
using (Mutex mutex = new Mutex(true, "yourAppName", out isNew))
{
if (isNew)
{
Application.Run(new MainForm());
}
}
If the app is aplready running and you would like it to be given focus you need to use a Win32 API method called SetForegroundWindow which I'm sure you could find an instance of on Google.
Hope this helps
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
I didn't know about this. Very handy.
|
|
|
|
|
Thanks!
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
|
WARNING: all the schemes that have been mentioned to you do not prevent the app from launching a second or third time; all they do is try and make the app terminate pretty soon if it isn't the first instance.
|
|
|
|
|
Luc Pattyn wrote: all the schemes that have been mentioned to you do not prevent the app from launching a second or third time Even the one from Wayne G. using a Mutex ?
thanks, Bill
When I consider the brief span of my life, swallowed up in the eternity before and after, the little space which I fill, and even can see, engulfed in the infinite immensity of spaces of which I am ignorant, and which knows me not, I am frightened, and am astonished at being here rather than there; for there is no reason why here rather than there, now rather than then. Blaise Pascal
|
|
|
|
|
It still has to start to detect that there's another instance running. It's not that they don't stop the appearance of an app not being started again, but there will always be a finite period of time where the second instance has spun up - even if it then terminates.
|
|
|
|
|
CP has many articles on making a "Singleton" app:[^]
When I consider the brief span of my life, swallowed up in the eternity before and after, the little space which I fill, and even can see, engulfed in the infinite immensity of spaces of which I am ignorant, and which knows me not, I am frightened, and am astonished at being here rather than there; for there is no reason why here rather than there, now rather than then. Blaise Pascal
|
|
|
|
|
How to tell the OS to use the environment provided by the WinForm application instead from system environment.
Example : My WinForm application uses C++ runtime dll's(msvcm80.dll, msvcp80.dll and msvcr80.dll) and bundling them as part of the application. How to make sure that my application will use the C++ runtime dll's that bundled along with product even though the dll's present else where in the system(c:\Windows\Winsxs).
Regards,
Gopal Reddy
|
|
|
|
|
|