|
1 Your question makes no sense at all
2 If you want code written for you the try rentacoder.com and pay for it, this is a forum to help with SPECIFIC programming problems, not to provide free code
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
|
hi everyone,
Hope everyone's doing better than me...
I have a problem
Here's the scenario
i'm currently a Network App using the Socket Class
which sends the image over the network..
Client Sends the image
the image is basicaly wrapped in my Packet class in packet assembly
(ofcource both the sides (client/server) will have reference to it)..
so i serialize it and send it through the networkstream of the socket
this happens on a separate thread..
like so
.................
'some where in the form
dim thre as new THread(addressof (startstream)
thre.start()
.............
'thread procedure
Sub startstream
dim img as bitmap
mypacket.screen=img
formatter.serialize(stream,mypacket)
End Sub
where 'mypacket' is a instance of Packet class
Server recieves the image
and deserialize it and uses it...
this also happens on a separate thread..
my idea is to send and recieve the packet(containing the image) asynchronously using threads is that a bad idea..or is there something fundamentally wrong...
The exception is Object in use elsewhere...on the client side serializing..
what am iam doing wrong here..
can anyone help me..
please forgive me, if my question sounds stupid and cause i'm a newbie
thanks in advance..
|
|
|
|
|
Vivek_India wrote: what am iam doing wrong here
Vivek_India wrote: cause i'm a newbie
You are engaged in far to complex a project for a newb. Studying materials designed to introduce and teach a subject to beginners is what you should be doing, rather than coding and posting messages in internet forums.
|
|
|
|
|
k.. i may not be an exact newbie ...but i am new to Multi-threading..i learned all the theory about it ..but the implementation went haywire..
so i thought of asking here..its wrong is it...
and
sorry if it offended you....
|
|
|
|
|
Vivek_India wrote: sorry if it offended you
In western culture, there is nothing in my post indicating I was offended, because I was not, I am simply offering free advice. You are not obligated to take it.
Vivek_India wrote: so i thought of asking here..its wrong is it...
Not wrong, just not optimal for beginners. Materials have already been design to teach beginners in these subjects and using them would be far more productive than internet forums for learning a subject. The forums are great for specific focused discussions, not so much for large subjects. Multi-threading is a very large subject.
Vivek_India wrote: .i learned all the theory about it
Back when I started I found the chapters in Advanced Windows[^] on multi-threading to be very helpful.
|
|
|
|
|
Hey thanks ...led-mike
And sorry, I completely misunderstood you..
any way i will study the book you recommended( or may be similar text is that ok?)...any way i was wondering what could be wrong and suddenly
the part where a bitmap object is assigned to the image property of the Picturebox
<br />
Picbox.image=screen<br />
was causing the trouble.. when i commented it out, it worked fine..i learned that picturebox was being rendered on a different thread,, than mine so it was accoring to
VS 2005 illegal cross thread operation or something along that line...
is there any thread safe way to do it...
And finally my english is not so good, so i apologize for the inconvenience...
Thnx
and
regards
Vivek
|
|
|
|
|
Vivek_India wrote: is there any thread safe way to do it
Of course, but once again this is the same issue of you trying to write code for a subject that you have not studied. In my experience, software development does not really work out well using that approach. And as I stated before, posting messages on internet forums is no substitution for putting in the proper effort of studying the subjects.
http://www.google.com/search?hl=en&q=MSDN+BeginInvoke&btnG=Google+Search&aq=f&oq=[^]
|
|
|
|
|
How to create icons for windows forms under smart device application in VS 2008?
|
|
|
|
|
Its really so simple . If you have I can maker first make icon you want with 16*16 pixel
go to properties of your project Then in Aplication you will see
Resource there you will get ICON and examin button from there select your icaon what you made before . Thats all
Hope it will help you
|
|
|
|
|
How can I cheange color of BoldedDates in MonthCalendar?
ICQ 33-00-44-7
P.S. Sorry for my English...
|
|
|
|
|
I need to disable some dates in DateTimePicker. User haven't case to select some dates (for example hollidays, special dates, etc.).
How can I do it?
ThnX.
ICQ 33-00-44-7
P.S. Sorry for my English...
|
|
|
|
|
Hi,
You'll have to either check after the user has selected a date, or create your own Control.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
I whant to disable click at current day in the Calendar at DateTimePicker...
ICQ 33-00-44-7
P.S. Sorry for my English...
|
|
|
|
|
DateTimePicker does not support that.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
private void dateTimePicker1_Validating(object sender, CancelEventArgs e)
{
if (dateTimePicker1.Value.Date == DateTime.Now.Date)
{
e.Cancel = true;
}
}
This might work.
|
|
|
|
|
In controls that allow selection of a thing, I've seen two common ways to inform the user that the currently selected thing has changed and what the new selected thing is.
In the first method, the event notification arguments contain no extra information about the selected thing but the control has a property for accessing it.
private void someControl_SelectedThingChanged(object sender, EventArgs e)
{
SomeControl someControl = sender as SomeControl;
SomeThing selectedThing = someControl.SelectedThing;
...
}
In the second method, the new selected thing is a property of the event notification arguments.
private void someControl_SelectedThingChanged(object sender, SelectedThingChangedEventArgs e)
{
SomeThing selectedThing = e.SelectedThing;
...
}
One advantage I can see of one method over the other is that the first method is useful if the SomeControl.SelectedThing property is read/write and can be set via code and not just input events. If the SomeControl.SelectedThing property is read-only, then it doesn't really need to exist and the value can be passed in the event arguments as per the second method.
Agree? Disagree? Discuss ...
|
|
|
|
|
Does anybody have an idea on how I can display tournament brackets in windows forms... I developed the code for single elimination now i just need a way to create dynamic brackets... any ideas?
|
|
|
|
|
Hi all
There is a very peculiar requirement on a screen on one of the application i am working on.
I need to show tool tip on every member of dropdownlist (when the list is open)
Is there any way we can do that...
If you have some hints please share.
Thanks in advance
Vikram
I Code...
|
|
|
|
|
Hope this helps:
- Change the DrawMode property of your combo box to OwnerDrawFixed.
- Implement the event DrawItem of the combo box and write there something like this:
ToolTip tt = new ToolTip();
private void comboBox1_DrawItem(object sender, DrawItemEventArgs e) {
e.DrawBackground();
e.Graphics.DrawString(comboBox1.Items[e.Index].ToString(),
e.Font, e.State == DrawItemState.Selected ? Brushes.White : Brushes.Black, e.Bounds, StringFormat.GenericDefault);
e.DrawFocusRectangle();
tt.Show(comboBox1.Items[e.Index].ToString(), comboBox1, 1000);
}
This event is now called whenever an item is displayed. Now you have to insert the text that draws the combo items and, by the way, you update the tool tip with the information you want to show about the item.
|
|
|
|
|
(Note that this post might seem familiar since i already posted it on the MSDN forums which was the wrong place)
Hello,
First of all, sorry for the title and the location of this post. i'm still sure i did something wrong there .
Now for the situation: I have a datasource ( +- 20 mb ) containing more then 100 000 elements where each element contains 4 properties which i need to download from the web.
Then i need to display this datasource in a winforms app. I only need to download this datasource once so it seems logical i save it at the disk for persistence. The datasource is already sorted by name which is good since its a requirement to search for certain elements within the datasource. My goals are to achief the above situation with the least system resources consumption possible ( not that its strictly required but... heck, you know what i mean )
Current progress: I download the datasource chunk by chunk so i can progress one element at a time. When a element got retrieved, i immidiatly create an object out of it and serializes it to the disk to a single file (shared by each element ofcourse) using the XmlSerializer. So far, all goes great, i made a few optimalisations where i dont serialize each element one by one but rather store them in a buffer of X size and serializes the buffer when full, which seems to improve performance.
When all elements are downloaded and stored, i use a listview in detailed view with multiple colums and virtual mode on. As far as i know, this should be one of the most efficient ways of displaying the data. Now comes the real bottleneck. I need to read in the data dynamicly, that is if i need element X to Y and dont want to read in any elements outside that range. XmlSerialization is no go since it always reads in all data, So does XmlDocument (and its rather slow). I cant use XLinq since im targeting .NET 2.0 so i was thinking about XPathDocument. XPathDocument comes with a few drawbacks for what i know. Most importantly, it seems that its loading the entire document in memory which i try to avoid. Next, when for example, scrolling up in the listview, i cant seem to find a way within the navigator to navigate upwards, even better. I cant seem to access a specific element at an index without having to create a new navigator, but these problems might just also be my lack of knowledge of the XPathDocument.
Question: Can anyone help me determine the best way to handle this specific situation?
Note that im not restricted to the above situation so please correct me on ANY part.
Thanks in advance,
Koen
|
|
|
|
|
Firstly I would store the table in a database, SQL Express by preference and Access under duress. All your problems go away when you use a DB as it is designed to serve up smaller chunks that 20mb.
I would then set up a filtering UI so the users can see the minimum number of usable records at any time, I find about 100 to be a good number. It depends on your data structure but with 4 fields there should be some grouping and after that try alphabetical.
I find a datagridview to be dramatically faster loading that a listview, even if the resources are higher.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thank you for the answer,
I doupt i can use a database since the application is clientside and all data should be handeled clientside. Because this application will be published on the web and i want the app to require the least ammount of prerequisites possible. Therefore, i cant expect the user to have some kind of db software installed (e.g. access or sqlserver) << I just assumed access is only avail when having the packet installed (from the office disk or wherever its located these days). Also, i like to build a mono version in the future so i need to watch out for microsoft specific solutions. (sorry for me not putting all this information in the original post)
Ill do some comparison with the listview vs the datagrid, lets see what happens...
Note that since you named access, i was thinking about using ado.net with a xml provider. Havent used this before though so i dont know if its a advantage. Within my knowledge, ADO.NET still needs to build his indexes for the datastore each time its opened right, they might have optimized memory consumption within this..., ill look into it.
Did i say something ridiculesly stupid up here? if not, does anyone have any other input?
Thanks again,
Koen
|
|
|
|
|
Hi there,
Help required....
I am using SourceGrid in .net winform ... I want to know how to set different fonts in different cells.
Regards,
Balu
|
|
|
|
|
balukg wrote: I am using SourceGrid in .net winform
What is SourceGrid?
Never heard of it.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|