Oh, that's so me! :sigh: :sigh:
Excuse me for buttin' in, but I'm interrupt driven.
Oh, that's so me! :sigh: :sigh:
Excuse me for buttin' in, but I'm interrupt driven.
Hi all, I have an application that was written in C# (VS 2005). The applications reads properties of ms office documents and for that purpose it uses the dsofile.dll (version 2.1) library from Microsoft. Now I'm trying to port my app. to VS 2008. But the problem is that when I try to add a reference to dsofile I get an error stating that 'Can't add a reference to the file. Please verify that the file is a valid assembly or a COM component.' Can someone please help me with it..? Regards Ankit. =========================== It's done people. The problem was due to file permissions. I downloaded another copy from Microsoft and replaced the original file, and it's working fine now.
-- Modified Monday, June 14, 2010 5:49 AM
modified on Monday, June 14, 2010 5:54 AM
I cannot figure out how to translate the following line of code:
int maxMagicBytesLength = imageFormatDecoders.Keys.OrderByDescending(x => x.Length).First().Length;
into equivalent .Net 2.0 (C# 2.0) code. Here's the declaration of the imageFormatDecoders dictionary:
private static Dictionary<byte[], Func<BinaryReader, Size>> imageFormatDecoders = new Dictionary<byte[], Func<BinaryReader, Size>>()
{
{ new byte[] { 0x42, 0x4D }, DecodeBitmap },
{ new byte[] { 0x47, 0x49, 0x46, 0x38, 0x37, 0x61 }, DecodeGif },
{ new byte[] { 0x47, 0x49, 0x46, 0x38, 0x39, 0x61 }, DecodeGif },
{ new byte[] { 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A }, DecodePng },
{ new byte[] { 0xff, 0xd8 }, DecodeJfif },
};
As my rest of the application is .net 2.0. I just can't figure out the use of the OrderByDescending() method. I've not worked in C# 3.0 or later versions. Please help me. Thanks in advance.
Excuse me for buttin' in, but I'm interrupt driven.
Thanks a lot.
Excuse me for buttin' in, but I'm interrupt driven.
No, I don't want to move the picturebox, I want to move the image file (the file from which the image into the picturebox was loaded).
Excuse me for buttin' in, but I'm interrupt driven.
Hello everybody, My application has a picturebox control. Now what I want is to move the source image file (to a different directory) without clearing the picture box. Any suggestions? Thanks in advance.
Excuse me for buttin' in, but I'm interrupt driven.
modified on Monday, June 1, 2009 9:21 AM
Thanks, Your hypothesis was perfectly correct. When I removed the while(...)...; loop from the form_closing event, it started working perfectly.
Excuse me for buttin' in, but I'm interrupt driven.
Hi, Thanks for your response. Well, my problem is not that the BGWKR is not working. Infact, it's working perfectly. My problem is that if I call CancelAsync() from FormClosing event, the Do_Work method never stops execution and the .IsBusy property never becomes false. At the same time, the code inside the Do_Work event seems to be jammed. I can say this as the if(CancellationPending)
condition in the Do_Work event is never hit. The very same architecture works flawlessely, it CancelAsync() is called from a button's click event handler. Your 1st comment: That Groups.Add() call is nothing. I added it for testing purposes while debugging. So don't worry about that. I know it's not a thread-safe operation and will remove it. Your 2nd comment: Doing so will only get me out of the inner foreach loop. What about the outer one? Your 3rd comment: That i'll replace with code to hide the form and then wait till the BGWKR finishes or a deadline is met.
Excuse me for buttin' in, but I'm interrupt driven.
My apologies for the post being too much wide. I've reformatted it now.
Excuse me for buttin' in, but I'm interrupt driven.
Hello everybody, My application uses a ListView control to display a list of files. Everything works fine except that when I set the View property of the ListView to View.List, the list appears but, here's[^] a screenshot of how it looks. I can't understand, why the filenames are condensed and appended with a "...". I've searched google and msdn, but couldn't found a solution for the problem. The Large Icon[^] and Details Views[^] are working perfectly. Just the list view is misbehaving. My second problem is regarding a BackgroundWorker. I have a BGWKR that I'm using to perform a database transaction. Now the problem is that the user may close the form while the transaction is in progress. To handle this, I added code to the form's closing event handler, to inform the user that a transaction is active and ask him/her, whether to cancel it. If the user affirms, then a call to BGWKR.CancelAsync() is made. Here's the form_closing event.
private void WndSearchResults_FormClosing(object sender, FormClosingEventArgs e)
{
if (bgDatabaseSearcher.IsBusy)
{
if (MessageBox.Show(Resources.msgSearchActive_WindowClosing, "Question",
MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
{
e.Cancel = true;
return;
}
else
{
bgDatabaseSearcher.CancelAsync();
while (bgDatabaseSearcher.IsBusy)
Thread.Sleep(500);
}
}
}
Here's the BGWKR's Do_Work event
private void bgDatabaseSearcher_DoWork(object sender, DoWorkEventArgs e)
{
VFS virtualFS = new VFS();
foreach (ListEntry entry in imagesToSearch)
{
try
{
virtualFS.OpenConnection(Path.Combine(AppSettingsManager.ImagesDirectory, entry.imageDbPath));
foreach (VFSSearchTerm searchTerm in termsToSearch)
{
Hi Xmen My problem is not how to implement searching but, how to display the search results. I've already formulated the background searching algo. but, I can't think of how to integrate the search results in the main window.
Excuse me for buttin' in, but I'm interrupt driven.
Hello all, I'm building this app. that stores list of files in a directory in a database (called an image in the app's terminology) and then lets you browse the directory even if it has been deleted. Now my problem is that, I want to provide search facility, so that a user can search the files. The user would be able to search within as many images as he likes simultaneously. Now I can't figure out, how to implement the UI for the search results. The search input will be taken through a separate dialog box. But I really can't decide about the UI mechanism. I mean, I want everything to be very clear & concise. Further, I want the search results to be visible in the same window. Please don't suggest using tabs :-\ . Please help Here[^] is a pic of the current UI. Thanks in advance.
Excuse me for buttin' in, but I'm interrupt driven.
"Google didn't corrected it till now , the error is not showing because google is not providing the redirection service , the links are direct now , previously it was passed through a Verification server before redirecting...." -----------Someone on some forum
Excuse me for buttin' in, but I'm interrupt driven.
Breaking News (31/1/2009 08:33 PM) Google Got Corrupted. Warns That The Search Results May Harm Your Computer, No Matter What You Search For. Working Correctly At Last (08:46PM)
Excuse me for buttin' in, but I'm interrupt driven.
I once encountered similar problem. I deleted the solution's user option file. It's usually located it the same directory as your solution file. It's hidden by default and has the same name as your solution file, but with ".suo" extension. I'm using VS2005.
Excuse me for buttin' in, but I'm interrupt driven.
Thats because when B starts A, A's startup path is set to B's home directory. Use the following algorithm in B to start A: 1. Change the directory where A resides. 2. Start A This should solve your problem.
Excuse me for buttin' in, but I'm interrupt driven.
It's explorer.exe
Excuse me for buttin' in, but I'm interrupt driven.
All right, try like this
void CloseApplications(void)
{
string explorerPath = Path.GetDirectoryName(System.Environment.SystemDirectory);
explorerPath = Path.Combine(explorerPath.ToLower(), "explorer.exe");
Process[] processes = Process.GetProcesses();
foreach(Process process in processes)
{
try
{
if (process.MainModule.FileName.ToLower() != explorerPath)
process.CloseMainWindow();
}
catch
{
// Handle exceptions here.
}
}
}
Excuse me for buttin' in, but I'm interrupt driven.
Do you have a yahoo id. If yes, send me an Add Request at ankit_incredible_2006. The problem can be solved more quickly if we have a realtime comm. link.
Excuse me for buttin' in, but I'm interrupt driven.
Hi Sandhya, The reason you're getting that shutdown window is that the GetProcesses method gets a list of all running processes on the local computer or the machine name specified as an argument, and this list includes explorer as well. So when you call CloseMainWindow(), the close signal is being sent to all running programs including explorer as well. You should do like given below:
Process[] processlist = Process.GetProcessesByName("Notepad");
foreach (Process theprocess in processlist)
{
theprocess.CloseMainWindow();
}
All the best
Excuse me for buttin' in, but I'm interrupt driven.