Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. Is the function supposed to be returning ASCII text? Can you see the contents of the byte array in the debugger - if so does it look like it is only returnin a single byte?
  2. Have you considered Click Once as a deployment mechanism, although it doesn't implement the queuing you are after it does provide an easy way to deploy applications from a web server and provides auto updating capabilities. Roughly how large are these applications and what kind of demand are you expecting?
  3. You may find having a couple of interfaces can clean up some complexity without involving too much work for a starting project. Keep the IMod interface as it is for core plugin functionality (Initialiasation, cleanup, enable / disable etc), with different iterfaces for plugins that extend menus / toolbars, dialogs etc. This can give a cleaner seperation of functionality while allowing more complex plugins to implements as many interfaces as they need. You may find some usefule reading at the following places http://www.icsharpcode.net/OpenSource/SD/Default.aspx - the book they published is a free pdf now, has a lot of conceptual and code based work on a very comprehensive plugin system. http://www.codeplex.com/MEF http://msdn.microsoft.com/en-us/library/ms972962.aspx http://msdn.microsoft.com/en-us/library/system.addin.contract.aspx
  4. Using an Xmldocument will make it easier to produce valid html / xml markup as it will take care of escaping non-valid character sequences etc. Performance wise you would probably need to run a couple of comparisons to get a feel for which is going to give the best performance / feature tradeoff.
  5. What file extension does the header file have? Like vb.net c# just has source files - there shouldn't need to be a header and a library file. Could you give a bit more detail?
  6. You could create an additional library that holds just the interfaces, all the other parts (UI, main library etc.) reference this library but all other work is done at runtime - this way there is no hard coded dependencies apart from the interfaces.
  7. If you leave your app long enough does it raise any exceptions or other error messages?
  8. The background worker has a DoWork event, put the code you want to ruin in the background in there. It also raises an event when it's complete so you know it has finished.
  9. Any chance you could post your existing code? It maight help to make things a bit clearer.
  10. Could you not just use 2 stop watches - one as alreday suggested and one that waits for the two minutes?
  11. You would need to make the array big enough to hold each item. Something like string[] cellValues = new string[DataGridView1.SelectedRows[0].Cells.Count] that is probably a bit wrong as I don't have VS handy to test it.
  12. If you are going to use an installer to verify if the framework is installed why don't you use the installer to install the application as well? Click Once deployment might also be a valid option depending on your situation.
  13. If you are deploying your app with an MSI based installer then you can install the framework as part of the installation. Visual Studio's setup wizard can sort it out for you.
  14. If you try to access the share directly (start -> run and then type the full UNC path) what happens?
  15. What code are you using to check the server?
  16. A bit of google and the problem seemed to ring a bell with something I had problems with in the past.
  17. It could be the calling convention is wrong and corrupting the stack, equally you might want to force marshalling the strings as ansi - unicode strings could be causing memory to be corrupted if the dll is only expecting ansi.
  18. Which line is causing the error to be thrown? Are both the function and the callback using the cdecl calling convention?
  19. Did you try using NText as a datatype?
  20. You could use a connection string similar to Data Source=|DataDirectory|\.sdf if you are using the compact edition then this will default to the same folder as the .exe anyway.
  21. Text or NText depending on if you need Unicode support (NText is the unicode version) - has a storage limit of 2G per field.
  22. No offence but just posting an uncommented block of c code without even bothering to explain what it does isn't the best way to get helpful responses on any forum.
  23. To get the same effect as an autonumber field in sql simply declare the column has being an integer and then set it's identity property to true. You can set the primary key by clicking on the little key button when the correct column is selected in the designer.
  24. What are you using for the data source? Are you refreshing this as well?
  25. try using System; using System.ComponentModel; using System.IO; using System.Text.RegularExpressions; using System.Windows.Forms; namespace FileSystemWatcherTest1 { public partial class Form1 : Form { private readonly FileSystemWatcher myWatcher = new FileSystemWatcher(); private BackgroundWorker myWorker1 = new BackgroundWorker(); private Regex r = new Regex(@".*\..*"); public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) {} private void Form1_Load(object sender, EventArgs e) { // Get this applications path. string path = Application.ExecutablePath; string[] results = path.Split(new[]{'\\'}, StringSplitOptions.None); int num = results.Length - 1; results.SetValue("", num); string finalPath = String.Join("\\", results); // set the Path property myWatcher.Path = finalPath; myWatcher.SynchronizingObject = this; myWatcher.IncludeSubdirectories = true; myWatcher.NotifyFilter = NotifyFilters.CreationTime | NotifyFilters.DirectoryName | NotifyFilters.LastWrite | NotifyFilters.Attributes | NotifyFilters.LastAccess | NotifyFilters.Size; // add even handlers myWatcher.Changed += myWatcher_Changed; // Enable raising events myWatcher.EnableRaisingEvents = true; //textBox1.Text = "Path has been set on the FileSystemWatcher"; } private void myWatcher_Changed(object sender, FileSystemEventArgs e) { MakeChanges(e.Name); } private void MakeChanges(string result) { textBox1.Text += result + Environment.NewLine; } } } The key is the line myWatcher.SynchronizingObject = this; as this forces the event to be raised on the UI thread.Due to the fact this class may be used in several different scenarios forcing this single threaded event behaviour would be a major performance hit when direct UI interaction isn't required - setting this property http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.synchronizingobject.aspx gives the full details.
×
×
  • Create New...