|
you could assign the contents of the picture box to a Bitmap Object...
manipulate the Bitmap object via setpixel and getpixel
and the assign it back to the Picturebox
Does this help?
|
|
|
|
|
I need to do something simliar to what you did. I can get the service installed and running but my timer is not firing.The OnStart and OnStop code is firing ok so i know the service is running.
I am using vs.net 2005 btw
Chandhu
|
|
|
|
|
What are you talking about ?
|
|
|
|
|
Hi Guys
I am working on a WinForm Project (VSS2008) with SQL Reporting Services (SQL Server 2005). I have multiple reports that need to be printed ad-hoc. So far, I have placed each report into a seperate windows form and render the report within this form. Once referenced, these forms can be called from anywhere in the project using the Form.ShowDialog() method. Once the form is rendered I call ReportViewer.PrintDialog() to pop up the print dialog. This all works fine.
The Developement Specs asks for the form to be printed automatically. That means then when the form is called, it must render and bypass the print dialog, and then print the report (.rdlc) automatically. I have been struggling with this for a while now. I am still new to development and hope that someone can help me.
Basically, is there an easy way to programmatically trigger a Report Print (like clicking print on the Print Dialog) once the report has been rendered?
Thanks is advance.
|
|
|
|
|
I am working on a gaming project. The code has been migrated from .Net 1.0 to .Net 2.0.
I am using Sdldotnet in this project. Sometimes when action was not complete, the game crashes and error message is shown "Send or Don't Send". The error is
"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Suggest me something that helps me out of this.
Thanks in advance.
Prateek
|
|
|
|
|
Looks like an authorized access taking place. Bad news for you is, it can be due to anything and you would have to debug it. If you can reproduce the steps of the crash then your lucky(you have some lead) or else add try/catch in your main and see if the stack trace helps in providing some lead!!
|
|
|
|
|
I'm probably missing something obvious, but here's my problem:
I'm using VB.net to deal with large text files (mostly vertical lists and some used as data sources). When I save the file from my app, I end up with a blank line added to the end of the file (File.WriteAllLines...) because of the line terminator from what should have been the last line. I need to eliminate this.
If I use "File.WriteAllText" or "StreamWriter.Write(String)" the extra line is eliminated, but MS NotePad then renders the file as one long string of text (NoteTab and my own app render it properly).
If I use StreamWriter.WriteLine in a loop (thru the lines of the RTB) - it works okay for small files. But some of the lists I'm working with here have thousands of lines and this takes forever. The largest file to date has 80,847 lines.
I'm thinking this should be easy to solve, but I've not solved it. I just need to write the contents of a RichTextBox to a file with no extra blank line at the end, and in a manner that all Windows text editors (including NotePad) can properly read. I'm not doing anything fancy or complicated here, just editing text.
|
|
|
|
|
richTextBox1.LoadFile("test.txt", RichTextBoxStreamType.PlainText);
richTextBox1.SaveFile("test1.txt", RichTextBoxStreamType.PlainText);
When I load and save a file using the above code I create an identical copy. If you don't see the same then any editing you are doing must be adding the extra line.
Alan.
|
|
|
|
|
Thanks Alan.
Not sure this will help me. I may have an issue with chr encodings going this route. Didn't think about this simply because I hadn't used it in a long time. Will give it a whirl.
|
|
|
|
|
use Environment.NewLine when writing a line to the stream. It will work for you.
string.Format("{0}{1}",'your Variable', Environment.NewLine)
Krishna
|
|
|
|
|
Hi, i'm looking for a way to bind a BindingList<customerviewmodel>
to a grid... (allow adding a new row in the grid).
If i'll use BindingList<customermodel>, i know it will work...
but binding to he ViewModel allows me to add additional presenation logic to the class.
How did you solve this?
Thanks in advance,
Erik.
|
|
|
|
|
Hi,
First I implemented a bindinglistview which inherits from the BindingList and implements all necessary interfaces such as IEditableObject, etc. From there I used this in a custom collection that takes care of the Adding New logic. All of this came from the Data Binding with C#2 book but I cannot remember the author at the moment. Great indepth discussion in a single chapter on how to bind with objects. It also works well with the Interface during design time.
Happy Coding
|
|
|
|
|
Thanks for the helpful reply! =)
I've explored this subject some more, and came across the CSLA.NET framework,
As it seems the framework implementation does exacly that =)
I'm still learning it, but it looks promising...
Did anyone use this framework and implemented the Presentation Model pattern???
It seems rather cumbersome to wrap the CSLA entities with ViewModels, because them the ViewModel will have to implement all the interfaces and forward any calls to he CSLA entities...
(And of course the ViewModel will have additional logic to help support the UI and DataBinding)
BTW,
If i'm not using the Presentation Model Pattern, and I have this rule for example:
The row of a customer in a grid must be green if the customer ordered more than 10 items, at a price higher than 20$.
If i'm using Presentation Model, then my customer's ViewModel will have a property OrderedMoreThanTenItemsAt20DollarsEach (for example), which will implement this logic and the view will use DataBinding to bind the rows color property.
How will i implement this using the Supervising Controller pattern?
(I guess passive view will just iterate through the rows in the grid).
Thanks in advance,
Erik.
|
|
|
|
|
The CSLA Framework from Rocky has been around a long time. Rocky has updated this for many years and a lot of companies use it. My understanding is that it is very good. There are other frameworks as well that might be used such as Smart Client Software Factory, Web Client Software Factory, ASP.NET MVC and the brand new PRISM for WPF and Silverlight. Personally, I have been sticking to the Microsoft Patterns and Factories. Then my model, my presenter, my view and/or controllers can be reused between them.
All of these have things in common. The model, the view and the presenter or the controller. I personally like MVP since it truly encapsulates the actions, rules, transitions and translators into a reusable framework that can be used and easily adjusted as requirements change. If there is one thing for certain in this world - requirements change as the users or management see things evolve. The ability to know where to go to make these changes without Spagetti Coding is crucial to success.
It appears that you have a good handle on the tiers here and their requirements. So here is my take. This is only my take and not a definitive answer. So if it is usable then hey use it, if not applicable to your case, file it away for later. The supervising controller is used to centralize the methods between views. All events that can be shared should be fired up to this controller and the controller in turns then fires commands back to interested views. It is very useful for keeping the views of data synchronized on the same class. So supervising controllers listen to events and fire commands to controllers which in turn fire the view events. Now you have a loosely coupled set of views that can be reused between modules without having any dependencies to any one parent container. The supervising controller handles the work and the actions, the view is merely a container with very few methods and the controller for the view has specific methods and interfaces to make the view do things. The controllers talk to the model and obtain most of the data then rearrange it as necessary using LinQ to Objects or if you are using generic list then use the predicates to handle the where clause etc.
All views in turn should handle the same interface so the controllers fire things in a coordinated fashion. It keeps you from getting confused as to what to do. Over time you will see exactly how to do this and it will become automatic.
Some of the model patterns that I use are the abstract factory pattern for the repository objects, a command pattern for reusable commands, a facade pattern for the method calls to make it easier to move this. Regardless of which framework you use the repository and the model do not change significantly. Now you can loosely couple everything and hook up the data with Enterprise Factory, nHibernate, LinQ to SQL or ADO.NET Entity Framework.
Finally, all UI classes should be wrapped with a BindingListView<t> so that all interfaces to the classes are exposed in a single location in the correct way.
I hope that this helps.
Best regards and keep working on it - this is definitely worth it in the long run.
|
|
|
|
|
my actual task is to read the EULA from the .exe file and copy it to another file. i hope this question relates to this forum. please help me to solve this.
|
|
|
|
|
There is no EULA in calc.exe.. Lots of applications consist of multiple executables, and they load libraries that might have their own license. I'm using a spellchecker in my executable that's licensed under the CodeProject-license, but the main executable isn't.
An assembly might be licensed, but I doubt that the complete text will be embedded as a resource. I'm not going to say that it can't be done, but it would be at least challenging to do such a thing.
I are troll
|
|
|
|
|
thanks for ur reply. i just want read the EULA using my program from the softwares that are asking for the user acceptence while instaling them. hope you get my point.
|
|
|
|
|
Yeah, all too well. I was a fanatic World-of-Warcraft player, and Blizzard has the brilliant idea that every player needs to accept three licenses, for each and every update! Needless to say they update a lot, and you can't click it away - you need to scroll to the end to ensure that "everyone reads it". I'm sure that all those kids read it and carefully review the advantages and disadvantages of each license
There's lots of software on my system, and since I don't speak the law-lingo, I can't make heads or tails out of them. Unfortunately, there isn't a common place to put them.
Even hooking (to catch all installers) wouldn't give you all the licenses.
..but, you can get a list of currently installed software. You might not get the license automagically, but you could start working on a database that holds the licenses for the most common software. It would actually be sweet if there were a website where one could retrieve the license that goes with a software-package, along with a "human readable translation".
That would indeed be awesome
I are troll
|
|
|
|
|
hi thanks for your valuable information and for sugestions too. see you soon with more douts
|
|
|
|
|
HI All,
i have an windows application Add.exe . it is stored at in USB drive as follows
DriveLetter:\MyApplication\Add.exe
now I want to provide an auto launch for Add.exe, so that whenever My USB drive is connected to any PC Add.exe should initiaite.
Regards,
ashok
|
|
|
|
|
You'll need to add an "autorun.inf" file to the root of your USB-drive. As simple example of this file;
[autorun]
open=myexecutable.exe
icon=someicon.ico
For a list of all options look here[^]. If you wants an editor, look here[^].
I are troll
|
|
|
|
|
Hii,
After searching on for auto update feature to suit my needs/project, i started developing my own auto update feature.
This application basically compares the version of my file and any difference in it, it will download the newest version of that file.
Now problem is , i want to fire or start an .exe application/my main application whenever i find that there is no version update . And close auto update application before starting my different application .
I tried out using system.process.Diagnostic.Process method
But didnt succeeded.
Can anyone show me how i can open different application from my current application and close the current application before starting different application.
Aspiring Techie,
Vishnu Nath
|
|
|
|
|
Proces.Start is the easiest way to start a program.
Vishnu Nath wrote: But didnt succeeded.
Did you get an error? If so, what was the message? Can you post the code you used?
I are troll
|
|
|
|
|
Now i have changed the way i used the code.
Now i use my process.start code in Program.cs file.
But it is behaving in a different manner.
static void Main()
{
string appPath = applicationPath();
try
{
if (checkInternetConnection() == true)
{
if (setXML() == true)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Update());
}
else
{
Process.Start(appPath);
}
}
else
{
Process.Start(appPath);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
Process.Start(appPath);
}
appPath is the path of main application retrieved from applicationPath() method.
and setXml() is a method returning boolean value.
Now if update is available.
the application will fire Update Form else it will start my main app.
But instead the application runs , but its control and text are not visible.
When Update Form runs, Form is blank without any controls in it.
I m unable to understand what happens that my controls and heading form becomes invisible during runtime.
Can u sort out the problem?
Aspiring Techie,
Vishnu Nath
|
|
|
|
|
I can't see any reason here why the Update-form would hide it's controls, unless there's some kind of weird exception.
I wouldn't change the Program.cs, instead, I would have put the Process.Start code somewhere in the Update-form. Perhaps that any of the other members see a potential source of the error?
I are troll
|
|
|
|