|
Hi, Thanks for responding.
Sorry I was a little vague.
My process at the moment is thus:
I am creating the file myself locally and when it is finished I then sent to remote
I cannont know the size of the file beforehand but I do know when I am finished creating it.
My problem is two fold:
1. How to access a file which is currently being written too. (the file I am creating)
2. How to control the speed at which I upload the file so that I can match the pace of the creation process.
|
|
|
|
|
Yes. You can do this. I have done this last early last year. I created a tiny text editor that would upload my web pages AS I WAS CREATING THEM. I acheived this by using the TextChanged Event of the TextBox control. Then I added code to the TextChanged event handler that would save the text inside TextBox control to a string. Then, I uploaded the text inside the string to my ftp sever. By doing this, everytime the TextBox control is "changed" it would save to string and upload. Save to string and upload.
So, in short:
Create TextChanged Event Handler for TextBoxControl (or whatever input control you're using)
Add the code that will save the controls text to a string
Upload string's text to server (make sure you use Append. Instead of Write.)
Hope this helps. There's alot of code involved in this (hence the reason I didn't post it here)...
jt.
p.s. let me know how it goes...
|
|
|
|
|
Thank you for your response.
I got a solution. though I am having buffer starvation issues!!
I instigate the file creation from a third party application. It takes a variable time to create the file I want to transfer via FTP.
I was chewing too big a problem, and of course once I reduced it. the solution was easy.
A lower level call to open a file as shared read on a thread I can sleep. (I have problems with this approach as my reader thinks the file writing is complested when thats not true)
but upto about 20mins I am good.
at any rate the bytes I read I feed to a queue for the FTP process and all works well till my file reader thinks the file is ended.
I will solve this shortly if you are interested, I will post the solution.
if not
Thx for your responses.
J.
|
|
|
|
|
Nice work, J. I am very interested to see how things go
j.t.
|
|
|
|
|
Cool, now that I've got the basics nailed. I'm off to work on the server core which uses remoting, so it'll be a couple of weeks no doubt
j.
- Why does everything you want to do require you to learn one more thing?!!!
|
|
|
|
|
Hello!
If I have a XML File which is at first a serialization of a class done by application A, is there a way to create in application B, which does not know how the class should look like, a class with the correct structure just by this xml file?
e.g:
Aplication a:
[Serializeable]
class A1
{
prop string s1 {get;set;}
prop int i1 {get; set;}
}
{
A1 a1 =new A1(){a1="test", i1=1};
XmlSerializer xser = new XmlSerializer(typeof(a1.GetType());
StreamWriter writer = new StreamWriter(...);
xser.Serialize(writer);
}
Now I have the xml file.
Application b:
{//MainThread
TODO: Desirialize the xml file
without knowing class A1 from application a
Or maybe this can be done by creating an xsd file first (and if so how this can be done?)?
|
|
|
|
|
ezazazel wrote: is there a way to create in application B, which does not know how the class should look like
How about both classes implement a common interface? After deserializing, you can cast that object to this interface instance.
|
|
|
|
|
This doesn't help me, because the application which creates the xml file is not made by me.
So I get the huge serialized xml file and now should do something with it.
|
|
|
|
|
I have tried to find some information on the internet but can't seem to find any tutorials on this.
Basically when someone install's my application I will have it check when they run the application to see if there is a update available. If there is a update available it will download and run the new MSI file. (This is all done).
The problem I am having is when you run the new MSI file, I can not get it to actually upgrade the program. I have changed the Version number from 3.0 to 4.0 in the setup file and then select yes to update the ProductCode since I changed the version number. I have RemovePreviousVersions set at True and DetectNewerInstalledVersion to True.
Am I missing anything or does someone know of a article that describes how to do this?
|
|
|
|
|
Hi,
I'm working with PowerPoint Object Library 12
and I need to check if a file with a "ppt" suffix was created in PP 2003.
The "ppt" itself is not enough to know what I need,
because it is possible that the file was created in PP 2007 and saved as PP 2003 with a PPT suffix.
Thanks,
Ophir
|
|
|
|
|
|
Thank you for the reply!
Any idea how do I get this magic number form a ppt file?
I opened the ppt file in notepad to have a look if there is anything obvious in the beginning of the file, but no luck there.
Thanks
|
|
|
|
|
Voting 1 for a message that helps you will not encourage cp members to help you.
|
|
|
|
|
Sorry,
I'm new to the group.
I Clicked 1 by mistake and then clicked 5 to fix it.
Thanks
|
|
|
|
|
ophirmi wrote: and then clicked 5 to fix it.
Perhaps you didn't as the rating is still 1.
As for powerpoint files, I am not sure if they have magic numbers. You can create several files and see if they have some common header or use google to find information about it.
|
|
|
|
|
Hi all
I have a Parent form with a calendar and a child form with a schedule on it. When i double click on a date it will show me the schedule from inside the parent form. i want it create a tab in the parent form whenever it opens.
Please help
|
|
|
|
|
If your application is using the MDI environment then tabpages may not be what you are looking for (I can't really tell based on the wording of your question).
If, however, you are creating a stanard WinForms application, then you should be able to manually code a TabControl, Adding TabPages to that TabControl and then adding a usercontrol to that TabControl. For information on how to do this, just use a google. If you still have problems after using Google then you can always post back with specific questions.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
Please do not post the exact same question in the forums. Especially if it happens on the same day or week of first posting. It just aggravates the forum dwellers.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
Look at his record; earlier this month he listed the same question four times. He has been told several times NOT to post more than once.
Blog link to be reinstated at a later date.
|
|
|
|
|
I do recall pointing it out, in a nice manner in the past. Some folks just don't get it.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
There have been so many of them lately I can't keep track. It seems to go in waves. Might have to restart my "list."
Blog link to be reinstated at a later date.
|
|
|
|
|
maybe you can add tab container, and if you create new child like :
FormChild form1 = new FormChild(); // form Child is configured Child form by you
create new tab page too:
TabPage tab1 = new TabPage();
and then attach your new Child form at that page like:
form1.MdiParent = MyParentForm;
form1.Parent = tab1 ;
I try something like this on many tabbed application, but I don't try at calendar like yours.
No one can prevent me to learn something
|
|
|
|
|
Hi!
I'm part-way through making a control that utilises tab to switch between different panels. I have the code working that when the user clicks on a tab at design-time, it switches to the corresponding panel through the override WndProc in the ControlDesigner class.
I have another option though, using the DesignerActionList and DesignerActionListCollection, where I have an "Add tab" option in the Smart-tag.
In design time, it does actually add the tab. But, each tab is linked directly to a custom panel I made that should get added to the form too.
So when I click "Add tab", it invalidates my control so it writes the tab text on the top, but when I run the application it is promptly removed.
I clicked on my custom panel collection to see whether the tab is added to a collection inside the control when "Add tab" is clicked, and it is. But the problem is, it's simply not adding the control to the form's designer code.
public void AddTab()
{
StylusOption STOpt = new StylusOption();
int i = this.dtc.OptionTabs.Count;
while(this.dtc.ParentForm.Controls["StyleOption" + i] != null)
i++;
STOpt.Name = "StyleOption" + i;
this.dtc.ParentForm.Controls.Add(STOpt);
this.dtc.ParentForm.CreateControl();
this.dtc.OptionTabs.Add((StylusOption)this.dtc.ParentForm.Controls[this.dtc.ParentForm.Controls.Count - 1]);
this.dtc.Invalidate();
this.UIScu.HideUI(this.dtc);
}
That's the current code I have. StylusOption is the name of the control i'm trying to add, StylusBar is the control i'm adding it to, and this.dtc is the StylusBar i've set the handler to work with.
In the code, i've attempt to add the control via this.dtc.ParentForm.Controls.Add(STOpt); but even that doesn't work. I can't figure out how to add the StylusOption to the actual form to remember. If anyone can help, i'd appreciate it a lot.
An example of how i'd like it to work is like the TabControl, where if you click Add Tab, it creates a new TabPage in your form so you can edit any details there.
Thanks
modified on Wednesday, October 29, 2008 11:33 AM
|
|
|
|
|
It seems like you might have to manually serialize the objects that get created when the smart tag is utilized. An article that I wrote for CP might be able to help you with regards to full design-time feature support: Targeting Design-Time Events of UserControls[^]. It doesn't cover serializing specifically, but it still may be able to jog your memory with regards to finding a solution.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
I gave it a read through. It did give me a little reminder of somethings I had missed, but unfortunately I can't get it to work :\
Serializing the controls? Hmm, I understand the [Serializable()] ComponentModel, but how to implement it into a declaration from within the ControlDesigner functions I don't know D:
Thanks.
|
|
|
|