|
|
Take a look at the AForge.Net framework, it has a component for this kind of algorithms:
AForge.NET Framework
This is the namespace you might be interested in:
•AForge.Genetic - evolution programming library;
|
|
|
|
|
I'm trying to open openoffice/Libreoffice impress(simpress.exe) in my C# windows form.
But it opens in its own window and there is no data on form.
I want to integrate it in my form.
This is my code:
ProcessStartInfo proc = new ProcessStartInfo();
proc.FileName = @"C:\Program Files\LibreOffice 4.0\program\simpress.exe";
proc.UseShellExecute = true;
var process = Process.Start(proc);
Thread.Sleep(2000);
SetParent(process.MainWindowHandle, this.Handle);
It open Libreoffice impress but not in my form.
How can I integrate it with my form?
Thanks!
|
|
|
|
|
toms from newdelhi wrote: It open Libreoffice impress but not in my form. That is what the Process.Start method is designed for. I do not know if it is possible to open this within your form. You need to study the openoffice SDK to see what features it supports.
Use the best guess
|
|
|
|
|
toms from newdelhi wrote: It open Libreoffice impress but not in my form.
How can I integrate it with my form?
Because LibreOffice is still loading and building it's form when you call SetParent . Try to WaitForInputIdle[^] before changing the parent.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I used it but its not working.
I used process.WaitForInputIdle() but getting the same result.
Thanks!
|
|
|
|
|
I have no idea how you can integrate it with your forms. You cannot use Process.Start to integrate any form with you custom form. Try to find any Library control like OCX control so that they can be integrated with your forms. But try this one [^]. I hope this will help you.
First and the Foremost: FIGHT TO WIN
|
|
|
|
|
Actually, you can. It takes a fair bit of interop work, but it is possible. Basically, you reparent the application into yours.
|
|
|
|
|
I thought that COM automation is used for these jobs. OpenOffice would/should have registered a COM automation object for external applications to call the automation server (dll).
www.oooforum.org/forum/viewtopic.phtml?t=9815
"It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan
That's what machines are for.
Got a problem?
Sleep on it.
|
|
|
|
|
You could do it this way, but you can also reparent other application windows.
|
|
|
|
|
OK, this is new to me.
I'll go and take a look.
"It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan
That's what machines are for.
Got a problem?
Sleep on it.
|
|
|
|
|
Actually I'm trying to integrate OpenOffice/LibreOffice in my C# windows form program.
But I'm getting bootstrap error.
So I thought to do it in this way.
Is it not possible to integrate it in C# program.
Do anyone having any idea of doing it?
Please suggest.
|
|
|
|
|
This seems to fit your problem even though it's MSOffice in the examples.
officeautomationcsharp.php
& this fits in too.
Hosting-EXE-Applications-in-a-WinForm
"It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan
That's what machines are for.
Got a problem?
Sleep on it.
modified 18-Mar-13 11:14am.
|
|
|
|
|
Check out referring Embedded Open Office assembly.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
hi can you help me about my problem regarding this C# program. I try to update but this error always show. what is the meaning of Syntax error in UPDATE statement: ? thank you so much. your reply will highly appreciated.
|
|
|
|
|
Sounds like a database question, not a C# question.
What error?
|
|
|
|
|
It means that your UPDATE statement is not correct in some way, but unless you show us the actual details we cannot guess what the problem may be.
Use the best guess
|
|
|
|
|
As Richard says, without your actual code and the UPDATE command istelf, we can't tell you exactly what the problem is.
An SQL update statement is similar to this:
UPDATE <table_name> SET <field>=<new value>,<field... WHERE <field>=<value> So an example would be:
UPDATE myTable SET UserName='kruczynski123' WHERE UserID=9738136 So, check you have each section of it, or very similar, and check you have quotes where you need them. If you are using C# (and I assume you are) then try using Parametrized queries - they may help you (and you should use them anyway to prevent an SQL Injection attack accidentally of deliberately destroying your database). This may help:
using (SqlConnection con = new SqlConnection(strConnect))
{
con.Open();
using (SqlCommand com = new SqlCommand("UPDATE myTable SET myColumn1=@C1, myColumn2=@C2 WHERE Id=@ID", con))
{
com.Parameters.AddWithValue("@ID", id);
com.Parameters.AddWithValue("@C1", myValueForColumn1);
com.Parameters.AddWithValue("@C2", myValueForColumn2);
com.ExecuteNonQuery();
}
}
The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)
|
|
|
|
|
Or it could be
UPDATE <table_name> SET <field>=<new value>,<field... FROM ...
|
|
|
|
|
Error in update query? Check if the parameters you are passing into the query are all correct and in the right format.
|
|
|
|
|
How to connect two forms in a C# project in a way that in a button click event to the other form from form1, the form1 must be closed the moment the form2 is diaplayed on the screen
|
|
|
|
|
coolvibhu wrote: connect two forms
Nothing in here suggests that you need to "connect" the forms in anyway. All you need is
Form2 frm = new Form2();
frm.Show();
this.Hide();
Or close form 1 but that will probably also close your application. Kind of hard to tell since you did not post any code for what you have tried.
|
|
|
|
|
That depends on how you want to do it.
If Form1 is opening Form2, then it's pretty simple:
Form2 f2 = new Form2();
Hide();
f2.ShowDialog(): Then either
Show(); Or
Close(); Depending on if you want Form1 redisplayed or not. Do note that if Form1 is your startup form, then closing it will end the application - even if you have displayed a Form2 from Form1, it will be closed as well.
If you have a third form involved which opens Form1, then Create an event in Form1 which it's parent handles and which causes the parent to open Form2. Once Form1 has signalled the event, it can close itself.
The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)
|
|
|
|
|
i create a winform program that load the data from ms access database to my listbox. when i click my item which i want to update on database and datasource on my listbox and click the update button, the item just wont update for the first time clicked but the second does, so everytime i need to modify my data i need to choose my item and click the update button two times. that's is crazy lol..
private void buttonUpdate_Click(object sender, EventArgs e)
{
OleDbDataAdapter cmd = new OleDbDataAdapter();
cmd.UpdateCommand = new OleDbCommand("UPDATE Item SET ITEM = @ITEM, ITEM_DESC = @ITEM_DESC WHERE ID = @ID",GetConnection());
cmd.UpdateCommand.Parameters.AddWithValue("@ITEM", textBoxITEM.Text);
cmd.UpdateCommand.Parameters.AddWithValue("@ITEM_DESC", textBoxITEMDESC.Text);
cmd.UpdateCommand.Parameters.AddWithValue("@ID", Convert.ToInt32(textBoxID.Text));
cmd.UpdateCommand.ExecuteNonQuery();
_productlist.Clear();
listBox1.DataSource = null;
listBox1.Items.Clear();
Fill();
listBox1.Update();
}
basic thing that happen:
1. load data to listbox with databind to textbox
2. click item on my listbox and modify data from textbox
3. click the update button to update database and datasource
4. datasource not update for the first time but database does update
5. repeat no.2
6. repeat no.3
7. datasource updated
what i want:
1. load data to listbox with databind to textbox
2. click item on my listbox and modify data from textbox
3. click the update button to update database and datasource
4. datasource and database updated
how do i fix this bug on my application?? please let me know if i need to be more clear..
|
|
|
|
|
you are not adding any items to the listview neither assigning a datasource.
What does the 'Fill();' do?
Think! Don't write a line of code unless you absolutely need to.
|
|
|
|