|
led mike wrote: recreate whatever work they all did
why didn't i think of that? this'll be simple! *downloads firefox source code* (sarcasm)
that code doesn't tell me a thing, i don't even know where to start. if i think about it though, didn't sun (and microsoft, and other vm devs) write the browser plugins themselves? meaning instead of just hosting the applet, i'd have to simulate a browser environment...
this might be more work than it's worth...
|
|
|
|
|
zildjohn01 wrote: this might be more work than it's worth...
Duh
|
|
|
|
|
ok that was mean... lol. WebBrowser it is. i guess i'll just SetParent the java window or rewrite the html and strip the ads out
|
|
|
|
|
zildjohn01 wrote: i guess i'll just SetParent the java window or rewrite the html and strip the ads out
Keep in mind you never actually stated the problem you are trying to solve. Rather you asked how to accomplish a specific solution.
|
|
|
|
|
Is the MCISendString function in winmm.dll suitable for playing the music in a game? I would use wave files with the PlaySound command but file sizes are too large!
Thanks
|
|
|
|
|
I am attempting to make a set of textboxes that will allow dragdrop operations. I am inheriting from RichTextBox in my class and have added the following code...
...
// Only allow copy if this textbox is readonly (cannot move from this box)
if (base.ReadOnly)
this.DoDragDrop(this.SelectedText, DragDropEffects.Copy);
...
protected override void OnDragOver(DragEventArgs drgevent) {
// Set the effect, based on keys pressed and drgevent.AllowedEffects
}
The problem is that drgevent.AllowedEffects is ALWAYS (Move|Copy|Scroll). Then, when I set drgevent.Effect to DragDropEffects.Move (since I have no way to see if the source is readonly), I get the cursor indicating that NO dragdrop operation is allowed. Is there any way for me to get the value passed into DoDragDrop, or at least see if Move is allowed by the operation so I can set drgevent.Effect to Copy? Thanks,
Jeff
|
|
|
|
|
For anyone who is having the same problem, I decided to go with a very hacky solution that only solves some cases, but it is the best I can figure since I am finding it impossible to get help or find a solution anywhere online. I ended up making a static variable (and a lock) within my DragDropRichTextBox class, which stores the allowed operations. Then, in the DragOver event handler, I and (operator &) my allowed effects with drgevent.AllowedEffects to determine what the "real" effects are. As you can imagine, if the source is read-only and is not of my class type, my RTB's will not allow a dragdrop operation unless the user is depressing the ctl key (indicating a copy operation). If anyone has a cleaner solution that works for external sources, I would still like to hear it. Thanks,
Jeff
|
|
|
|
|
This is stressing me out.
I am trying to read word documents at the moment by loading them in as plain text into a hidden richtextbox, then I take that text and use regex to "attempt" to extract the words from the unicode.
I have so far been somewhat unsuccesfull as their is always garble unicode left.
Does anyone know any regex expressions that remove unicode from a string?
If you are wondering why im doing it in this fasion, it is the fastest way I have found to read word docs. I have tried to use WordApplication classes, and OfficeReaders, and they are either slow or error prone. I thought about using Iwordbreaker, but that skyrocketed over my head and dont know where to begin their, plus you need a license.
My c# app is working great now, and its almost ready to go live, its just these bloody word documents.
If anyone can help I would greatly appreciate it.
Thanks
Jeremy
|
|
|
|
|
I don't understand, a Word doc is NOT just rich text. How is this working ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I use the load method that comes from a richtextbox variable, I point it at a word doc, and I choose the plain text option, it loads the text into the richtextbox with a combination of junk and all the actual words in the word doc. I then transfer the text from their in to a string. Its just the matter of getting rid of the junk. Usually all the text in the word doc is tucked away neatly in the middle of the junk, but you get some \\'07 and \par's in their sometimes.
|
|
|
|
|
My question is related to changing the window state of an application prior to opening the app. I am attempting to open a new instance of MS Word from my application so I can interact with the Word API. I used to do it by asking for an instance from the Windows Com object, but that does not guarantee that I get a new instance. To prevent undesireable effects on already open instances of word, I decided to take this new route. However, I want the new instance of word to open in a hidden state, so the user never sees the instance on his or her screen. I tried using the WinApi ShowWindow function after instantiating the class, which is taking 7 ms to both instantiate Word and make the call to ShowWindow. However, it takes the UI about 200 ms to actually hide the Word application. Does anyone know a way to either
1: Assign a handle to a window prior to opening it, so the properties on that handle are carried into the new app (so I could call ShowWindow BEFORE instantiating word), or
2: Instantiate an application from the command line where you can specify the initial window state, or
3: Speed up the refresh of the main UI so the Word window is hidden in less time, or
4: Tell the windows com object to always create a new instance when you ask it for a word app.
Thanks,
Jeff
|
|
|
|
|
I have a fairly simple winform that has several textBoxes, one listbox and one combobox. I have the listBox bound to a field in a table (table1), when a user clicks on an item in the listBox the textBoxes are bound to that table so they display the other data columns for that record. The comboBox is bound to another table (table2) in the dataset that is merely a lookup table. The "Selected Value" of the combobox is bound to one of the colums in table1. This results in the appropriate value being selected in the combobox list. The comboBox has been changed to type "DropDownList" so the user cant type in the box, they can just select one of the pre-existing values in the comboBox. This all works great. The problem occurs when I try to change the selected value in the comboBox. The value does not update in the database when I call the update() method of the table adapter. If I change one of the textBoxes I call a function that ends the current edit ------this.BindingContext[ds_form_contacts, "table1"].EndCurrentEdit(); ------- then calls table1TableAdapter.Update() . This works fine, but if I change the comboBox, I call the same function and the value for the comboBox does not update. If I change the comboBox value then change one of the textBoxes the newly selected value for the comboBox will get updated in the database. I can post code if it helps. All of the binding was done in the designer in vs2005
thanks, -Kevin
|
|
|
|
|
Oh C# gurus, surely someone has the answer to my burning binding question....
anyone????
anyone????
Bueller????
Please....
-Kevin
|
|
|
|
|
I was able to get one step closer. I added a function to handle the SelectionChangeCommited event. In the function I added code to force the rowstate to be "Modified".
((DataRowView)this.tblgroupsBindingSource.Current).Row.BeginEdit();
Interestingly enough this works only if I select the same value in the comboBox twice in a row. The first time it does not change the rowstate.
Thoughts?
|
|
|
|
|
Sorry, Scratch that. The BeginEdit() has no effect on the situation. I removed it and it still does work when you select the value from the combobox twice in a row.
I put a MessageBox in just after the endcurrentedit() to check the state of the row. The first time through it is Unchanged, but when I select it again it is Modified.
thoughts?
|
|
|
|
|
I have a C# application that calls a MySQL procedure and writes data to the db. All of the fields get populated properly but for the ID field, which is my PK field. It populates the field with an empty string instead of the value. the ID field is a varchar field.
When I try a direct insert through the MySql Query Browser, it populates the field correctly, but when using the C# code/appl. the above issue occurs.
What could the issue be?
|
|
|
|
|
when you use the MySql QB what value does it use to populate the field? and I would have to see the code you are using to call the MySQL procedure.
-Kevin
|
|
|
|
|
Here is the c# code that calles the stored procedure:
public void createUserProcedure(string uId, string lname, string fname, string email, string pswd, DateTime expdate, int secId, char usrStat, DateTime lgn)
{
MySqlCommand cmd = new MySqlCommand();
try
{
DB_Connection conn = new DB_Connection();
cmd.Connection = (MySqlConnection)conn.DBConnect();
cmd.CommandText = "createUser";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("USERID", uId);
cmd.Parameters["USERID"].Direction = ParameterDirection.Input;
cmd.Parameters.AddWithValue("USER_LAST_NAME", lname);
cmd.Parameters["USER_LAST_NAME"].Direction = ParameterDirection.Input;
cmd.Parameters.AddWithValue("USER_FIRST_NAME", fname);
cmd.Parameters["USER_FIRST_NAME"].Direction = ParameterDirection.Input;
cmd.Parameters.AddWithValue("USER_EMAIL", email);
cmd.Parameters["USER_EMAIL"].Direction = ParameterDirection.Input;
cmd.Parameters.AddWithValue("USER_PSWRD", pswd);
cmd.Parameters["USER_PSWRD"].Direction = ParameterDirection.Input;
cmd.Parameters.AddWithValue("USER_PASSWORD_EXPIRE_DATE", expdate);
cmd.Parameters["USER_PASSWORD_EXPIRE_DATE"].Direction = ParameterDirection.Input;
cmd.Parameters.AddWithValue("USER_SECURITY_LEVEL_ID", secId);
cmd.Parameters["USER_SECURITY_LEVEL_ID"].Direction = ParameterDirection.Input;
cmd.Parameters.AddWithValue("USER_STS", usrStat);
cmd.Parameters["USER_STS"].Direction = ParameterDirection.Input;
cmd.Parameters.AddWithValue("USER_UNSUCCESSFULL_LOGIN", lgn);
cmd.Parameters["USER_UNSUCCESSFULL_LOGIN"].Direction = ParameterDirection.Input;
cmd.ExecuteNonQuery();
}
This is how I call the procedure:
DateTime dt = new DateTime();
dt = DateTime.Parse("02/01/2007");
UserDAO test = new UserDAO();
test.createUserProcedure("test","TEST", "tst", "tst@net", null, dt, 1, 'A', dt);
Here is the stored procedure in mysql:
DELIMITER $$
DROP PROCEDURE IF EXISTS `the_vault`.`createUser` $$
CREATE DEFINER=`VAULT_DEV`@`%` PROCEDURE `createUser`(IN USERID varchar(20), IN USER_LAST_NAME VARCHAR(40), IN USER_FIRST_NAME VARCHAR(20), IN USER_EMAIL VARCHAR(50),IN USER_PSWRD VARCHAR(20), IN USER_PASSWORD_EXPIRE_DATE DATETIME, IN USER_SECURITY_LEVEL_ID INT, IN USER_STS VARCHAR(1), IN USER_UNSUCCESSFULL_LOGIN DATETIME)
BEGIN
INSERT INTO USERS VALUES(USER_ID, USER_LAST_NAME, USER_FIRST_NAME, USER_EMAIL, USER_PASSWORD, USER_PASSWORD_EXPIRE_DATE,
USER_SECURITY_LEVEL_ID, USER_STATUS, USER_UNSUCCESSFULL_LOGIN);
END $$
DELIMITER ;
|
|
|
|
|
newbieAl wrote: DROP PROCEDURE IF EXISTS `the_vault`.`createUser` $$
CREATE DEFINER=`VAULT_DEV`@`%` PROCEDURE `createUser`(IN USERID varchar(20), IN USER_LAST_NAME VARCHAR(40), IN USER_FIRST_NAME VARCHAR(20), IN USER_EMAIL VARCHAR(50),IN USER_PSWRD VARCHAR(20), IN USER_PASSWORD_EXPIRE_DATE DATETIME, IN USER_SECURITY_LEVEL_ID INT, IN USER_STS VARCHAR(1), IN USER_UNSUCCESSFULL_LOGIN DATETIME)
BEGIN
INSERT INTO USERS VALUES(USER_ID, USER_LAST_NAME, USER_FIRST_NAME, USER_EMAIL, USER_PASSWORD, USER_PASSWORD_EXPIRE_DATE,
USER_SECURITY_LEVEL_ID, USER_STATUS, USER_UNSUCCESSFULL_LOGIN);
END $$
Check the "Bold" values. They are different. Is this an intended difference, or is it a mistake?
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
I'd say that's it. Everything else looks pretty good.
-Kevin
|
|
|
|
|
Kevin, That was the issue,however why would MySQL still write this record to the table even though tere wasn't a valid USERID value?
|
|
|
|
|
Is the USER_ID field actually set as the PK in MySQL?
You say it is a varchar?
Is it set to Auto Increment?
Is set to not null?
in MySQL QB does the newly inserted value show up as empty or null?
-Kevin
|
|
|
|
|
Yes, PK
Yes, varchar
No it is not set to auto increment
Yes, it is set to not null
in mysql qb it shows up as the value that I passed to the stored procedure
|
|
|
|
|
yes, now that you've fixed it, it should show up as the value you passed. Your question was why did it allow this in the first place? Your original post stated "It populates the field with an empty string instead of the value". That was my question was the value showing up in the db as any empty string or null, before you fixed it? There is a difference. I think your application was posting an empty string and not a null value, thus passing the db's test to not allow nulls. and since you do not have the field set as auto-incrementing an empty string would be a valid unique string. You probably could not run it twice in a row since that would violate the "unique" requirements of a pk. I guess in any event it is working now, eh?
-Kevin
|
|
|
|
|
Yes, it is working. Your analysis is correct. It put an empty string it orig. and not the value.
Thanks for your help!
|
|
|
|
|