|
pyhtang1 wrote:
(the old common dll is overwrited by a new common dll consisting not only the new shared objects but also the original set of shared objects).
Well, that's probably not a good idea. As I've written about in my AAL articles, I'd suggest a container that wraps each piece of data. The data should also be stored in some "universal" format--use the built in value types, string, and DataTable/DataSet, for example. Then the "data hub" can be used to acquire the data in the format that the plug-in wants.
Of course, you can't store class instances this way, but you probably don't want to because then it creates interlinking dependencies between the assemblies.
Marc
MyXaml
Advanced Unit Testing
YAPO
|
|
|
|
|
Why not have a core set of shared objects in one dll and have user defined objects in their own dlls?
Regards
Senthil
|
|
|
|
|
Thanks for your reply.
But the problem is that the core set of shared objects (in one dll) will be also increased as new applications are created, so it seems not good that
when new app are created, the core sets need to be overwriten also.
|
|
|
|
|
|
|
One way I found is to wire up an event for Layout or Resize, then check the WindowState property.
Thanks! If anyone has a better way, let me know!
Marc
MyXaml
Advanced Unit Testing
YAPO
|
|
|
|
|
Don't know if the following is a better way, but it was recommended when I asked the same question here some months ago.
Personally, I think that your solution is probably better, cause not every message for the form is checked, but thought it won't hurt to mention it anyway
public class YourForm : Form
{
protected override void WndProc(ref Message m)
{
if (m.Msg == 0x0112)
if (((int)m.WParam & 0xFFF0) == 0xF020)
{
}
base.WndProc(ref m);
}
}
www.troschuetz.de
|
|
|
|
|
Hi Marc!
I've used the Resize event for this once (to make a form disappear whenever it's minimized).
You can query the form's WindowState in the event handler to find out whether the window is minimized or not.
Regards,
mav
|
|
|
|
|
mav.northwind wrote:
You can query the form's WindowState
Thanks! That's just what I discovered. Too bad there isn't a WindowState change event.
(I think I'll write a simple article about it )
Marc
MyXaml
Advanced Unit Testing
YAPO
|
|
|
|
|
Working on an application requiring a progress bar implementationin C#. While working on it, I thought it would be a nice idea to display the download information presented for the users while incrementing the information by placing the processing code into the _Tick event of a Timer object and displaying the information about the download in a series of labels. I would like to display the:
1. Bytes Received (in KB)
2. Download Size Total
3. Time Left
4. Time Elapsed
5. Average Speed (KB/sec)
6. Percent Complete (%)
Now, I just figured out how to get the file size for each of the files using the FileInfo class and then getting the .length property for each of the instantiated FileInfo objects. Then, all I need to do is to add them up and to display them in the respective label.
While I may perhaps be able to get the Time Elapsed value simply by utilizing the TimeSpan object with comparison to the Timer object, I do not know how to get the performance type information like the Bytes Received, or the Time Left, or the Average Speed in KB/Sec or the Percentage completed? Would appreciate some advice on an appropriate approach.
Also, I would like to display the progress bar with an image in the background and a slightly transparent progress stepper incrementing at the required points. I have looked at Seti's progress bar, and I will try to implement it, but are there any .ocx component files available that could be implemented into a project? Finally, how would I get permission from Seti to utilize Seti's progress bar into the application?
|
|
|
|
|
We have a webservice that periodically crashes and loses track of the web methods that are to be exposed. At some point the webservice stops responding and when I look at the asmx file on the web server, none of the web methods show up. It displays the error about the default tempuri domain and nothing else. When I restart the www service things return to normal. Has anyone experienced this? We're using C# on Windows 2000 server and there are some third party DLLs that are referenced. We aren't seeing anything in the event logs.
|
|
|
|
|
www.colormatch.dk
Hey this is the link which works in IE but not in Firefox.
Can anyone help me make this wokr in Firefox.
|
|
|
|
|
And this has what to do with C#?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Can someone tell me how can i override delete key function in datagrid.
byebye
|
|
|
|
|
Hi all,
I've a web application with several datagrids on it. I need to export some of them to excel files. I used the code above, and everthing works fine except that users see the "Open/Save/Cancel" dialog box once they've clicked the ExportToExcel Button.
Does anyone know how can save the excel file into a user's local folder by default?
Here is the code (C#)
private void ExportToExcel_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
string fileName = "BATable";
//Set the content type to Excel
Response.ContentType = "application/vnd.ms-excel";
//Turn off the view state
EnableViewState = false;
//Remove the charset from the Content-Type header
Response.Charset = string.Empty;
StringWriter textWriter = new StringWriter();
HtmlTextWriter htmlTextWriter = new HtmlTextWriter(textWriter);
htmlTextWriter.WriteLine(nomFitxer);
htmlTextWriter.WriteLine("");
//Get the HTML for the control
GridBA.RenderControl(htmlTextWriter); //GridBA is the name of my DataGrid
//Write the HTML to the browser
Response.Write(textWriter.ToString());
//End the response
Response.End();
}
Thanks a lot
|
|
|
|
|
Ok, I have a server app that various ASP.NET web pages call upon. This server APP does stuff based on the request string being sent in from the ASP.NET web pages.
Well here's the problem. If 4 clients connect at the same time on 4 different threads thread all the requests finish ok; cause i can see them finish. However, when it comes time to sned the client a completed request back only thread 1 gets a completed string back indicating that the request was comnpleted successfully and I am ready for the next; but threads 2, 3, 4 seem to just hang.
The moment I shut the server off i.e stop listening threads 2 ,3 ,4 seem to finish and they get a completed message back.
Any ideas on why this maybe happening or advice.
|
|
|
|
|
Besides the obvious, that there is a bug in your code, I have experienced problems with the TcpClient class--losing data, basically. I've replaced the client-side with Indy Sockets[^] and my problem went away!
BTW, the reason 2-4 are getting completed messages when you shut off the server is because the thread is actually exiting with a connection broken message.
Off the cuff, I'd say you need to put in some more error checking to start with.
Marc
MyXaml
Advanced Unit Testing
YAPO
|
|
|
|
|
hi everybody,
i'm trying to write a file filter for activesync to convert files with a specific extension. i found the api ICeFileFilter into msdn. But there is no c# code all over the the internet and very few lines of c++ examples(i found 1 example).
my problem is that i can't figure out how make it work.
i created the registry entry for my filter dll and activesync now fire an error when trying to copy this files to the device(at least it's something!!!).
my dll is surely not implementing correctly the ICeFileFilter.
aslo i'm unable to find this guid: 6C5C05E1-97A2-11cf-8011-00A0C90A8F78
wich seems to be the ICeFileFilter guid but it's not in my windows register.
here is the code:
<br />
using System;<br />
using System.Runtime.InteropServices;<br />
using System.Windows.Forms;<br />
<br />
namespace myFilter<br />
{<br />
[ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), <br />
Guid("6C5C05E1-97A2-11cf-8011-00A0C90A8F78")]<br />
public interface ICeFileFilter<br />
{<br />
[PreserveSig()]<br />
Int32 NextConvertFile (<br />
int nConversion,<br />
CFF_CONVERTINFO pci,<br />
CFF_SOURCEFILE psf,<br />
CFF_DESTINATIONFILE pdf,<br />
bool pbCancel,<br />
IntPtr perr);<br />
Int32 FilterOptions (IntPtr hwndParent);<br />
Int32 FormatMessage (<br />
UInt32 dwFlags,<br />
UInt32 dwMessageId,<br />
UInt32 dwLanguageId,<br />
[ MarshalAs (UnmanagedType.LPStr)]<br />
string lpBuffer,<br />
UInt32 nSize,<br />
IntPtr Arguments,<br />
UInt32 pcb);<br />
}<br />
<br />
[ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), <br />
Guid("6C5C05E0-97A2-11cf-8011-00A0C90A8F78")]<br />
public interface ICeFileFilterSite<br />
{<br />
[PreserveSig()]<br />
Int32 OpenSourceFile (<br />
int nHowToOpenFile,<br />
[In, Out] byte[] ppObj);<br />
Int32 OpenDestinationFile (<br />
int nHowToOpenFile,<br />
string pszFullpath,<br />
[In, Out] byte[] ppObj);<br />
Int32 CloseSourceFile (object pObj);<br />
Int32 CloseDestinationFile (<br />
bool bKeepFile,<br />
object pObj<br />
);<br />
Int32 ReportProgress (<br />
UInt32 nPercent<br />
);<br />
Int32 ReportLoss (<br />
UInt32 dw,<br />
string psz,<br />
[In, Out] byte[] args<br />
);<br />
}<br />
<br />
<br />
[ComVisible(true), Guid("<<myguiid>>")]<br />
public class myFilter : ICeFileFilter<br />
{<br />
public myFilter()<br />
{<br />
}<br />
<br />
public Int32 NextConvertFile (int nConversion, CFF_CONVERTINFO pci, CFF_SOURCEFILE psf, CFF_DESTINATIONFILE pdf, bool pbCancel, IntPtr perr)<br />
{<br />
return 0;<br />
}<br />
public Int32 FilterOptions (IntPtr hwndParent)<br />
{<br />
return 0;<br />
}<br />
public Int32 FormatMessage (UInt32 dwFlags,UInt32 dwMessageId,UInt32 dwLanguageId,[ MarshalAs (UnmanagedType.LPStr)]string lpBuffer,UInt32 nSize,IntPtr Arguments,UInt32 pcb)<br />
{<br />
return 0;<br />
}<br />
}<br />
<br />
[StructLayout(LayoutKind.Sequential)]<br />
public class CFF_CONVERTOPTIONS<br />
{<br />
public UInt64 cbSize;<br />
public Boolean bNoModalUI;<br />
}<br />
<br />
[StructLayout(LayoutKind.Sequential)]<br />
public class PFF_CONVERTOPTIONS : CFF_CONVERTOPTIONS{}<br />
<br />
[StructLayout(LayoutKind.Sequential)]<br />
public class CFF_CONVERTINFO <br />
{<br />
public Boolean bImport;<br />
public IntPtr hwndParent;<br />
public Boolean bYesToAll;<br />
public ICeFileFilterSite pffs;<br />
}<br />
<br />
[StructLayout(LayoutKind.Sequential)]<br />
public class PFF_CONVERTINFO : CFF_CONVERTINFO{}<br />
<br />
[StructLayout(LayoutKind.Sequential)]<br />
public class CFF_DESTINATIONFILE <br />
{<br />
public String szFullpath;<br />
public String szPath;<br />
public String szFilename;<br />
public String szExtension;<br />
}<br />
<br />
[StructLayout(LayoutKind.Sequential)]<br />
public class PFF_DESTINATIONFILE : CFF_DESTINATIONFILE{}<br />
<br />
[StructLayout(LayoutKind.Sequential)]<br />
public class CFF_SOURCEFILE <br />
{<br />
public string szFullpath;<br />
public string szPath;<br />
public string szFilename;<br />
public string szExtension;<br />
public int cbSize;<br />
public FILETIME ftCreated;<br />
public FILETIME ftModified;<br />
}<br />
<br />
[StructLayout(LayoutKind.Sequential)]<br />
public class PFF_SOURCEFILE : CFF_SOURCEFILE{}<br />
}<br />
thanks everybody for all kind of help!
|
|
|
|
|
I have two controls on a form, a label and a text box. The Text box is there just to hold txtfiles (like notepad) and I want to display the line numbers in the label. I've done a quick search here but the only method that I can find is searching for the carriage return charater in the text and then incrementing the line numbers that way; however, this isn't the way I want to do it, because then end of the line isn't always marked with a carriage return. I do NOT want the form to realise that the line has been wrapped and to increment for EVERY line of text.
so for example, if the form was resized, then there would be an increase in the line numbers.
I don't even know how to go about this
jasrus
|
|
|
|
|
I've done a quick search on MSDN and think you'll get the wanted result, if you use a RichTextBox and the following code snippet:
label1.Text = richTextBox1.GetLineFromCharIndex(richTextBox1.TextLength - 1).ToString();
www.troschuetz.de
|
|
|
|
|
I know it is possible to load a file inside a program using stream reader in binary mode, now is it possible read also a directory so get all tha data (its, its files and its subdirecoties).
How could i do?
|
|
|
|
|
|
I'm refferring also to a empty directory, can i read it in binary mode?
|
|
|
|
|
|
Colin Angus Mackay wrote:
If the directory is empty then there is nothing to read. I'm guessing that I am not fully understanding what you are wanting to do. Could you explain the wider problem? For example why do you want to read an empty directory in binary mode?
This was an old DOS technique where you read directories as a binary file, to create tools that hide files, recover deleted files, etc.
Yes, even I am blogging now!
|
|
|
|
|