|
Okay, don't get hung up on the fact that I called the public property, "DisplayRect". I know there's already a public property on RTF boxes called DisplayRectangle.
The point of this exercise is to understand how to use the 2 Windows constants in sending messages to Windows asking for this info, and then setting a new value. Since there doesn't seem to be any other C#-specific examples out there in the world, this would be *really* useful!
Thanks!
Anthony
|
|
|
|
|
Hi!
I'd suppose you can use EM_GETRECT and EM_SETRECT just like any other windows message sent to your RTB.
The declaration of SendMessage is something like this:
[DllImport("user32.dll")]
private static extern int SendMessage(IntPtr hWnd, int msg, IntPtr wPar, IntPtr lPar); Then you can use this function to send the messages to your RTB. The last parameter (lPar) is used for the rectangle. You can use the Marshal.StructureToPtr() and Marshal.PtrToStructure() methods to transfer the rectangle data to your working structures.
That should do the trick...
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
I got an app where I use the backgroundworker and when it's done it fires off the BackgroundWorkerCompleted event. Which is all good. but I need to reused the object later on. I get an exception that the BackgroundWorker has already completed.
So I tried myBackgroundWorker = new BackgroundWorker(); but none of the events are hooked up any more and it just sits there.
Is there anyway to reset it? or do I have to set all the properties each time I use it?
-Kevin
|
|
|
|
|
kselman wrote: myBackgroundWorker = new BackgroundWorker();
You must reconnect the events, this is a new instance of BackgroundWorker. You can't rest the original because the thread has already completed its work and has been returned to the pool.
only two letters away from being an asset
|
|
|
|
|
If you're re-starting the worker with RunWorkerAsync() the only exception would be InvalidOperationException, which means the worker is still running (IsBusy is true).
What exception are you getting?
--Bob
|
|
|
|
|
Welp.. Its working now.. not sure what was going on with it before. Unfortunately I changed too many things between testing and Im no longer receiving the Exception. It said something about "Background Worker has already completed"
I think was I calling ReportProgress during the Completed event.. but I tried to recreate the problem to report to you here.. but that didnt cause the exception. I also had a pointer to a helper class that was init'd outside of the DoWork function, but I put that back in and it still works.. *shrug* sorry.. i usually dont jump the gun and post a request for help.. but It sure seemed that I could not re-use the B.W. with out hooking its events back up. Which is not the case.. Just calling RunWorkerAsync() re-runs it as expected.
You reply did help, because you seemed confident to be able to re-use RunWorkerAsync and sure enough the problem was on my end..
Thanks for the quick replies..
-- Kevin
|
|
|
|
|
Good to hear it's working. I have an instance of a class which is a subclass of BackgroundWorker that reuses DoWork many many times. Never had a problem with it.
- Bob
|
|
|
|
|
How should i insert a word document into database.
I defined a Blob field in the database and i used this code
FileStream fls;
fls = new FileStream(path, FileMode.Open, FileAccess.Read);
byte[] blob = new byte[fls.Length];
fls.Read(blob, 0, System.Convert.ToInt32(fls.Length));
fls.Close();
query = "insert into Example(BLOBField)values(:BlobParameter)";
OracleParameter blobParameter = new OracleParameter();
blobParameter.OracleType = OracleType.Blob;
blobParameter.ParameterName = "BlobParameter";
blobParameter.Value = blob;
conn.Open();
cmnd = new OracleCommand(query, conn);
cmnd.Parameters.Add(blobParameter);
cmnd.ExecuteNonQuery();
cmnd.Dispose();
conn.Close();
What am i doing wrong. Its throwing up an error. Is there any other way to do this.
Thanks
Kal
|
|
|
|
|
kalyanPaladugu wrote: Its throwing up an error.
It might be helpful to say what the error is you are getting.
only two letters away from being an asset
|
|
|
|
|
ORA-00600:internal error code, arguments:
[koklgloblen:bnd][],[],[],[],[],[],[]
Thats the error its throwing. Iam able to
insert ordinary values like int and varchar
but not blobs
|
|
|
|
|
I figured out the error. I was able to insert into the database.
My second question is how should i retrieve it from the database.
If i execute the statement select * from table name its showing as orablob in those
columns i inserted. Is that the normal behaviour. Can some body provide the code to retrieve the word document from the database
Thanks
Kal
|
|
|
|
|
kalyanPaladugu wrote: Can some body provide the code to retrieve the word document from the database
Probably
kalyanPaladugu wrote: I figured out the error. I was able to insert into the database.
How about you share your solution. Its called give and take
Objects in mirror are closer than they appear
|
|
|
|
|
Its the same thing. The above code in the first link should work. Previously i was inserting into
two blob fields in the database from the same file stream object and so it failed. So i created
two file stream objects for two blob fields and it seem to work.
So if you run the code as it is i posted it should work as it is only one blob field in the database and one file stream object to load that
Thanks
Kal
|
|
|
|
|
How to retrieve the data from the blob field in the database
Thanks
Kal
|
|
|
|
|
i want to make splash screen to my Winapp
my splash screen first will be with transparent 0
will two 2 the transparent will be 100%
0 , 10 , 20 ,. .. ,100 transparent
how can make thing like this
Palestine
|
|
|
|
|
|
The default close/exit button on my form instantly closes the form when clicked.
However I would like the form to ask if I would like to save changes before closing when clicking this button.
I can't work out how to get access to the relevant function - assuming that is what i need to do. How should I go about solving this problem?
Thanks
Haz
|
|
|
|
|
Register to the Form.Closing event and use the passed CancelEventArgs object to cancel the closing process if needed.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi, can anybody recommend to me a charting component that runs on .net compact framework?
/\ |_ E X E GG
|
|
|
|
|
I tried simple serialization as this:
<br />
<br />
<br />
ArrayList RouteData = new ArrayList();<br />
<br />
...<br />
<br />
publicvoid Serialize()<br />
<br />
{<br />
<br />
DataGridRow[] dgr = newDataGridRow[RouteData.Count];<br />
<br />
<br />
<br />
for (int i = 0; i < RouteData.Count; i++)<br />
<br />
{<br />
<br />
dgr[i] = (DataGridRow)RouteData[i];<br />
<br />
}<br />
<br />
XmlSerializer a = newXmlSerializer(dgr.GetType());<br />
<br />
StreamWriter sw = newStreamWriter(@"c:/aaa.txt");<br />
<br />
a.Serialize(sw, RouteData);<br />
<br />
}
I`m getting error... What do you think may be wrong?
thank you in advance for any help
|
|
|
|
|
-Yoyosh- wrote: I`m getting error...
What error do you get?
-Yoyosh- wrote: What do you think may be wrong?
Maybe they are just typos or somethings gone wrong while copying code but you should definitely put spaces behind every new keyword.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
1."There was an error generating the XML document."
InvalidOperationException
2.This is just copy/paste issue, all code is being compiled successfully, error occurs at run-time
|
|
|
|
|
Did u declare the class or the method as [Serializable]?
Everyone is a genius at least once a year - Pramod
|
|
|
|
|
You right, I forgot. I mark both classes with that attribute - the class, that elemets` are kept in this structure, and class that contains Serialize method.
I still get exactly the same error
Please note that I cannot mark a method with that attribute: "Error 2 Attribute 'Serializable' is not valid on this declaration type. It is valid on 'class, struct, enum, delegate' declarations only. "
Do you have any idea, or maybe i did something wrong?
|
|
|
|
|
You don't need to declare the method as Serializable,
Declare only the classes as Serializable.
If u still get error
please paste the code here so that we can see wht's going wrong.
Regards,
Everyone is a genius at least once a year - Pramod
|
|
|
|