Ramy Mahrous 401 Postaholic Featured Poster

Just I need to make sure of something but I'll tell you to work with multithreading without using BackgroundWorker component

Thread thrd;
Extract_ButtonHandler_Click(object sender, EventArgs e)
{
thrd = new Thread(new ThreadStart(ExtractFrames));
}
string outPath = "you path";
///Extracts frames and saves them in directory
void ExtractFrames()
{
foreach (FrameGrabber.Frame f in fg)//error in this line highlighting "in"
{
using (f)
{
picBoxFrame.Image = (Bitmap)f.Image.Clone();
f.Image.Save(System.IO.Path.Combine(outPath, "frame" + f.FrameIndex + ".bmp"), System.Drawing.Imaging.ImageFormat.Bmp);
//Application.DoEvents();
}
}
Cancel_ButtonHandler_Click(object sender, EventArgs e)
{
thrd.Suspend();
}

Try above code and tell me if you got an error, you may need to customize the code but I expect you'll understand the idea.

Ramy Mahrous 401 Postaholic Featured Poster

You mean when you don't use BackgroundWorker component everything runs well?

Ramy Mahrous 401 Postaholic Featured Poster

i will try to prove you wrong(upps this reminded me of some..)

I know this quote reminds you of whom :p

Ramy Mahrous 401 Postaholic Featured Poster

what the difference? or what you'll get when you do that word by word?

Ramy Mahrous 401 Postaholic Featured Poster

You can't. There's not way to do that.

Ramy Mahrous 401 Postaholic Featured Poster

I didn't try your code but have a look on http://msdn.microsoft.com/en-us/library/af6z0wa2(VS.80).aspx and if it raises an error reply again.

Ramy Mahrous 401 Postaholic Featured Poster

What do you mean by merge your data to C# application? and for update database and so on you need to read in OLE in .NET

Ramy Mahrous 401 Postaholic Featured Poster

Look when I was senior student my graduation project was about code generation I use a method to generate for me keyfile for libraries I used this method which helped me to do some redirection and so on.

public void GenerateKeyFile(string command)
{
ProcessStartInfo PSI = new ProcessStartInfo("your.exe");
PSI.RedirectStandardInput = true;
PSI.RedirectStandardOutput = true;
PSI.RedirectStandardError = true;
PSI.UseShellExecute = false;
Process p = Process.Start(PSI);
System.IO.StreamWriter SW = p.StandardInput;
System.IO.StreamReader SR = p.StandardOutput;
SW.WriteLine(command);
SW.Close();
}
Ramy Mahrous 401 Postaholic Featured Poster

I think ASP.NET forum http://www.daniweb.com/forums/forum18.html can answer but I'll give a solution
if UserControl has property = "something from UC" you can from the page holds the Usercontrol say textbox.Text = UC.PropertyName; and it's the correct the usercontrol should have no information about the page it's in. but the page should have.

Ramy Mahrous 401 Postaholic Featured Poster

I know how to create dynamic report using Reporting Service, but I've no clue about how to do that using Business Objects.

Ramy Mahrous 401 Postaholic Featured Poster

MySQL data is in database or what you mean? if it's database I don't know if there's stored procedure to do that or not, if there's call it using their libraries. I prefer to ask this question in MySQL forum http://www.daniweb.com/forums/forum126.html to see the possibilities to do that

Ramy Mahrous 401 Postaholic Featured Poster

Remove it from project references.

Ramy Mahrous 401 Postaholic Featured Poster

You should create another thread for this method to run in, and suspend this thread at anytime you want.

Ramy Mahrous 401 Postaholic Featured Poster

No, Danny they need to do that System.Diagnostics.Process.Open("DirectoryPath"); C# Sample

System.Diagnostics.Process.Open("C:\\Windows");
Ramy Mahrous 401 Postaholic Featured Poster

I don't understand your question, where's your problem?

Ramy Mahrous 401 Postaholic Featured Poster

I think it's not applicable.

Ramy Mahrous 401 Postaholic Featured Poster

Tell me what the value you get and how you need to present it.

Ramy Mahrous 401 Postaholic Featured Poster

You need these changes to take place while the presentation is running?

Ramy Mahrous 401 Postaholic Featured Poster

I can get HWND or IntPtr to active window (whatever it's your or not) if it helps you I'll send the code, but I don't know how to disable another application, how can I disable my application?? or you mean disable form?

Ramy Mahrous 401 Postaholic Featured Poster

I've sent you two links for both, why didn't you reply with your questions to help you?!
Here you are again
Abstract classes: http://fci-h.blogspot.com/2008/03/oop-design-concepts-abstract-classes.html
Interfaces: http://fci-h.blogspot.com/2008/03/oop-design-concepts-interfaces_05.html

Ramy Mahrous 401 Postaholic Featured Poster
Ramy Mahrous 401 Postaholic Featured Poster

Try to assign estimateno is an integer in the table QuoteCalcHeader. to integral variable then pass it to last statement.

Ramy Mahrous 401 Postaholic Featured Poster

My first reply works I tried it.... I don't know where's the error!!

Ramy Mahrous 401 Postaholic Featured Poster

what the value of request in

Mediator.Class1 mediat = new Mediator.Class1();
mediat.recieveEle(request);
Ramy Mahrous 401 Postaholic Featured Poster

Your thread subject is totally different than the thread itself.
Sknake, they can't use SQL Profiler as

Consider that I dont have admin rights...

Log file is your eye, you can see through each transaction happened.

sknake commented: good catch ;) +1
Ramy Mahrous 401 Postaholic Featured Poster

- i have field which the input should be more than zero (how can i do that, should i do it on the Database or on the visual web developer )

As you like you can do it in BLL (Business logic layer) or you can do it as constrains in database.
About generating strings you can see that http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=59194

Ramy Mahrous 401 Postaholic Featured Poster

The btn_Click on your code is that for both (left and right)?

Yes.
You can't as there's a new reply.
I see you've some logic error.
As I understood, you need when there's no selected item in left listbox the left button is disabled and for the right side too.
So, you don't need to disable the button in its handler because you do that in selectedindexchanged event handler in the listbox (refer to my first\second reply)

Ramy Mahrous 401 Postaholic Featured Poster

I tried your code but it didn't work. I've seen that in your if statements, you maybe forgot to put the brackets. From what I've learned it's not advisable to write the if-statements if they don't have brackets.

No need for brackets; it's just one statement.

Btw, do I still have to declare the functions of the two buttons (btnToLeft and btnToRight, or maybe in your case here is the button2 and button1) I have? Because in your example, you only put the listbox1_SelectedIndexChange and listbox2_SelectedIndexChange?

No, you can write just one event handler for Button and one for ListBox, then assign your two buttons to the event handler inside you know which button raised it then go some action.

private void btn_Click(object sender, EventArgs e)
{
string buttonName = ((Button)sender).Name; //I used button name as identifier you can use anything else
switch(buttonName)
{
case "Right":
//your movement code 
break;
case "Left":
//your movement code 
break;
....
....
....
}
}

I hope it works right now.

Ramy Mahrous 401 Postaholic Featured Poster
Ramy Mahrous 401 Postaholic Featured Poster

Look by my reading in Windows APIs I developed application gets handler HWND or Intptr to the active window GetForegroundWindow that not neccessary assoicated with your program I'll try to mix both samples to get keys pressed regardless which window is active.

Ramy Mahrous 401 Postaholic Featured Poster

Have a look someone got fast solution customize it http://www.aghausman.net/dotnet/disable-special-keys-in-win-app-c.html

Ramy Mahrous 401 Postaholic Featured Poster

You can take a look on http://www.pinvoke.net/

Ramy Mahrous 401 Postaholic Featured Poster

I've another solution to the question "you need to disable every button when its ListBox controls Items not selected"

Form_Load()
{
button1.Enabled = false;
button2.Enabled = false;
}
private void listBox2_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listBox2.SelectedItem == null)
                button2.Enabled = false;
            else
                button2.Enabled = true;
        }

        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listBox1.SelectedItem == null)
                button1.Enabled = false;
            else
                button1.Enabled = true;
        }

You can enhance the above code.

Ramy Mahrous 401 Postaholic Featured Poster

I just need to answer one question and dig the other.
To handle keys pressed when your application on top or activated (any term you prefer) you need to set Form property (Key preview = true) then handle Key press event handler.

The question I want to discuss with you, what about if I want to get the keys user pressed whatever the status of my application (minimized, maximized, etc...) is answer is to override Windows API (the queue handles the key pressed as example..) I don't know actually how do I, but I'll try to develop an application and keep you up-to-date.

Ramy Mahrous 401 Postaholic Featured Poster

Yes, Just add reference from one to another not from both to both.

Ramy Mahrous 401 Postaholic Featured Poster

It's already exist. if you go to add\remove program you'll find it + if you install the application and RErun the install file it gives you an option to uninstall the application. All in all nothing called uninstall file. uninstall option by default in install project.

Ramy Mahrous 401 Postaholic Featured Poster

No, they shouldn't. You should add reference from Project1 to Project2 to be able to write using namespace MainProject.Project2; To add reference, from Project1 solution explorer references->add reference->browse to locate the project2 assembly or projects tab to get all assembles in all solution including project2 assembly.

Ramy Mahrous 401 Postaholic Featured Poster

Which technology you use? WCF or just socket programming what's the importance of data? all of these questions determine the best practice of implementing passing messages.

Ramy Mahrous 401 Postaholic Featured Poster

Very nice solution and better a lot than one I gave, thank you very much for sharing this beneficial information :)

Ramy Mahrous 401 Postaholic Featured Poster

Triggers, and Events not called by you, rather called on something happens. As Sknake recommended ask more about SQL Triggers in MS SQL forum http://www.daniweb.com/forums/forum127.html

Ramy Mahrous 401 Postaholic Featured Poster

Once you finish you can kill Excel process (IFF you don't need it anymore).

Ramy Mahrous 401 Postaholic Featured Poster

textBox1.Text = sr.ReadToEnd(); you say remove the text in the textbox1 then put instead the text in the file if you need to append it use textBox1.Text += sr.ReadToEnd();

Ramy Mahrous 401 Postaholic Featured Poster

There's no triggers in C# rather events.

Ramy Mahrous 401 Postaholic Featured Poster
Ramy Mahrous 401 Postaholic Featured Poster

Yes, Sknake it's important issue if your client uses Windows XP or not. Adatapost you show a lot of bad recommendations, please when you're sure answer!

Ramy Mahrous 401 Postaholic Featured Poster

Most likely you should ask this question in MySQL Forumas they are who developed this component they can help you well.

Ramy Mahrous 401 Postaholic Featured Poster

Check from SQL Server Surface Area Configuration on the Server and check if it allows remote connections or not. Please mention exactly the exception you get.
Or
Change the connection string to "Data Source=192.168.0.10;database=mydatabase;User id=myuser;Password=pass"
Or check with the administration group 2301 is the SQL Server port or 1433?

Ramy Mahrous 401 Postaholic Featured Poster

Did you test this procedure against MySQL database, and works fine?

Ramy Mahrous 401 Postaholic Featured Poster

I've wrote how to store image in binary format in SQL Server database http://fci-h.blogspot.com/2008/04/how-to-save-image-in-sql-server.html you can use Access without doing any modification else your change the datatype in Access to Image
Or
You can save the path of the image and retrieve it and set the PictureBox.Image to Image.Load(FilePath)

Ramy Mahrous 401 Postaholic Featured Poster

You've to check the change yourself, there's no way like SqlCacheDependency plus MS ACCESS doesn't support multiple concurrent access to its tables. In your case I recommend you to use SQL Server.