|
take it only as an example !
this reply contributes nothing to the main problem...
(why are most people in messageboards such wiseacres? )
bye..
|
|
|
|
|
mindf*** wrote:
take it only as an example !
this reply contributes nothing to the main problem...
(why are most people in messageboards such wiseacres?
Let me just begin by stating that most people here in the forums are here to help. The fact that your description of the problem comes off as slightly vague doesn't help. Decoupling the loading of your XML from only happening in the constructor of the class will actually help (as it doesn't sound as if you are doing this), based upon what you have said in your previous threads. If that doesn't make sense just say so and I can try and explain further what I am saying. If you can post more of your code, again that would be helpful. Mind you, my post was anything from me being a wise ass.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Why are some people - like you - so vague and expectant of help with little to no explanation?
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I have an assembly that exposes some static functions. One of these static function reads a text file and returns a value. This assembly will be consumed by all types of applications (web, forms, web services, windows services, etc..) I want a way that I can store, or cache, the different values from the text file on the first read (value can expire in 5 seconds or so) so that subsequent reads don't have to do another file I/O to get those values.
The functions must stay static and the caching implementation has to occur at the assembly level (i.e. not at the calling object level).
Any ideas? My only thoughts was to write this information into memory somewhere but I wasn't sure how to handle addressing and allocation.
Thanks.
|
|
|
|
|
Cody Caillet wrote:
The functions must stay static and the caching implementation has to occur at the assembly level (i.e. not at the calling object level).
It would still have to happen within a class within the assembly, otherwise you are not making yourself clear. I am not sure what part of this you are unclear on, could you be more specific? There is nothing keeping you from writing a class that has a static method which will store values. If you want you can use a timer to control when it reloads it's information. If you could define exactly how you want to store this information in memory that would be helpful. Are you reading an XML document, flat file or something else?
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hello.
I have the following problem:
I can not release memory of MDI child form after it closed.
I've tried this.MdiParent=null in the child form.
I've tried this.MdiChildren[i]=null in the parent form.
Nothing works. GC does not collect it.
Can you help?
Thanks
Gena
|
|
|
|
|
Especially for things like Graphics and Forms you really need to call Dispose on them. It is not sufficient to just "disconnect" them from the managed memory space because there are handles behind the objects.
Try this instead:
<br />
Form child = this.MdiChildren[i];<br />
this.MdiChildren[i] = null;
child.Dispose();
|
|
|
|
|
Thank you, Tom.
The above code doesn't release the memory.
The problem is that
this.MdiChildren[i] = null;
doesn't work!!!
After this line you can simply execute something like this:
this.MdiChildren[i].Show();
and no crash!!!
By the way, if I open the child form without assigning MdiParent
to it, it releases the memory correctly.
Thank you again.
Gena
|
|
|
|
|
Hello ..,
I was just wondering if any1 knows how to insert a flash MX movie in C#.net? I've created a ref of Shockwave flash but i couldn't make it work. It gets null.
Code example would be greatly appreciated.
Ta
Bob
|
|
|
|
|
Mehbub wrote:
Code example would be greatly appreciated.
There are several articles on the Internet regarding this. I just did a quick search and came up with Using Flash With C#[^]. Lutz Roeder was also working on a Flash player in C#, it's here[^]
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hi All,
I create Windows form with 2 combobox, first combobox(cmbOwners) is set up from properties, and second one (cmbVessel) from code. Idea is when i select Owner from first combobox in second will show vessels releated with that owner. I have code on cmbOwner SelectedIndexChanged event :
private void cmbOwner_SelectedIndexChanged(object sender, System.EventArgs e)
{
cmbVessel.Items.Clear ();
dsVessel.R8.Clear ();
daVessel.SelectCommand.CommandText =
"SELECT * FROM R8 " +
"WHERE R1 = '" +
cmbOwner.SelectedValue + "'";
daVessel.Fill (dsVessel);
cmbVessel.DataSource = dsVessel;
cmbVessel.DisplayMember = "R8.Nm";
cmbVessel.ValueMember = "R8.RNo";
}
and code is working find only first time when i select owner,but on the second try i get error :
"An unhandled exception of type 'System.ArgumentException' occurred in system.windows.forms.dll
Additional information: Cannot modify the Items collection when the DataSource property is set."
Can anyone help me with this.
Thanks
|
|
|
|
|
Fule wrote:
private void cmbOwner_SelectedIndexChanged(object sender, System.EventArgs e)
{
cmbVessel.Items.Clear ();
dsVessel.R8.Clear ();
daVessel.SelectCommand.CommandText =
"SELECT * FROM R8 " +
"WHERE R1 = '" +
cmbOwner.SelectedValue + "'";
daVessel.Fill (dsVessel);
cmbVessel.DataSource = dsVessel;
cmbVessel.DisplayMember = "R8.Nm";
cmbVessel.ValueMember = "R8.RNo";
}
I think your problem is the cmbVessel.Items.Clear(); line. You don't really need to do that, since you are changing your DataSource anyways. Comment out that line and you should work better.
- D
|
|
|
|
|
Thanks , is working
|
|
|
|
|
Is there an easy way to set the width of Columns in a ListView so that they cannot be interactively resized at runtime ? I could not find any property of the ListView class to obtain that.
Thanks
Maurizio
|
|
|
|
|
in .net 2.0 you can handle ColumnWidthChanging event and cancel resize. I'm not sure if there is anything in 1.0
|
|
|
|
|
Hello!
I'm creating an mp3-player using DirectShow and I've got a problem. I want to show the length of the audiofile I'm playing but I can't figure out how.
When I'm e.g. playing an audio file with a length och 46sec the code below shows a length of 195sec (3m 15sec), why? Both Duration and StopTime shows the same length.
private IMediaPosition _mediaPosition;
_mediaPosition.Duration;
_mediaPosition.StopTime;
I've tried to find a pattern by playing different audio files but I have not found one.
I've looked at these pages but they seem to have the same problem.
DirectShow - Playa
DirectShow - MediaPlayer
Thanks!
Erik
|
|
|
|
|
Hello!
It's me again. I just figured out that Duration and StopTime works at some files.
Is'nt Windows MediaPlayer using DirectShow? Because Windows MediaPlayer can't get the correct length of all the files I've tested.
/Erik
|
|
|
|
|
|
I need help to make server which can accept connections from mobile using wap .. actully I am nebibe in .net and previosly was working with java and c++ languages ..
I need urgent help for resourses to look for and what to study ..
I am a enggeniring student ..
Regards
shubham shrestha agrwal
do best wherever u r
|
|
|
|
|
i need to draw a line that goes over sevral controls that are docked on a tab page , but when i used the graphics object of the tab page i didnt see the line, how can i draw this kind of line? (do i have to use all the graphic objects of all the controls in its way?)
|
|
|
|
|
The requirement is to paint the lines ON TOP of the controls, not behind them. Some controls don't work very well with transparent backgrounds and some controls don't even support transparent backgrounds.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Try overriding the OnPaint event of your form. Call the forms base OnPaint event and then draw your lines as required. This should put your lines on top of the controls painted by the base OnPaint handler.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hy everyone!
What I want to do is when rightclicking on a ContactItem I do want my proggy to be listed in there with a MenuItem. This should either start my programm or if it is running bring it on top and/or send the data of the selected object to it.
Well the actions which have to take place when being selcted shouldn't be the problem but at the moment I have no idea how to get this MenuItem into the contextmenu when clicking on a contact.
I found samples which created new MenuBars, but that's not what I want. I do want to add an item to an existing menu.
Does anyone of you know how to do this? Well the best thing is this being possible no matter which version of Outlook I do use. Or if the solution depends on which version I do use then I would like to implement it on Outlook 2000 for testing at the moment.
Thanks!
Stephan.
|
|
|
|
|
From my point of view you won't be able to edit any context menu of Outlook, meaning you won't be able to add any item to them, right?
As far as I know you are only able to add an item to a MenuBar. This should be described in the MSDN or elsewhere!
Or is it possible to edit context menus of Outlook? Because if it is possible then I would be interested as well and I would be happy if anyone was willing to provide me some code to show me how to do this.
(This code doesn't have to be this specific like in Stephans request, any "standard code" for editing or adding an item to the context menu is what I would be looking for!)
|
|
|
|
|
I want to add a Link label to a form ,and when a user clicks on it the browser opens and navigate to that link
in the .net help the follwing code has been given
protected void LinkLabel1_LinkClicked(object sender, System.EventArgs e)
{
// Change the color of the link text by setting LinkVisited
// to True.
linkLabel1.LinkVisited = true;
// Call the Process.Start method to open the default browser
// with a URL:
System.Diagnostics.Process.Start("http://www.Microsoft.com");
}
but it didn't work bcos the app enters to the debug mode..any suggestions?
samitha
|
|
|
|