|
Use a MemoryStream instead of a FileStream and load the STREAM directly into the RichTextBox
<a TITLE="See my user info" href=http:
|
|
|
|
|
Thanks Leppie.
Is it possible to have an example. I don't know how to do replacement in a memorystream neither how to bind this memeorystream to the richtextbox.
Thanks in advance,
x
|
|
|
|
|
Does anyone else think that the implementation of Windows.Forms has been compromised by the decision to continue to drive windows in a Single Threaded Apartment?
Does anyone know of a wrapper implementation that gives the seamless illusion that a window is 100% free threaded? I'm getting tired of calling Invoke(..) -- or having a refresh timer on a dialog to pull data off the back-end! There must be a better way!
Jade Burton
Programmer
|
|
|
|
|
You are not alone man. I haven't found an alternative either.
|
|
|
|
|
It's impossible, I think. Microsft use Invoke or timers in many controls (see variable names "delayed" in debugger!!!). Now I'm working on implementing FreeForm in DataGrid. I have no any timer or Invoke but it doesn't work good.
Hi,
AW
|
|
|
|
|
My app CPQ was running in systray and all of my sudden it crashed this info.
At the time of the crash I was doing some other work.
.NET-BroadcastEventWindow.1.0.3300.0.19:CodeProjectQuoter.exe - Application Error<br />
The instruction at "0x77f8b812" referenced memory at "0x04e40030". The memory could not be "read".<br />
<br />
Click on OK to terminate the program.
Can anyone explain me what's this error means?
"If Sun and [Microsoft] disagree on [language extensions to Java] and diverge in these areas, as long as Netscape doesn't buddy up with Sun, super outcome for us (more fragmentation)."
Ben Slivka, Microsoft engineer, October 1996
This signature was created by "Code Project Quoter".
|
|
|
|
|
Kant wrote:
Can anyone explain me what's this error means?
No, , its usually a threading/delegate/callback error. I havent look at your code, so I cant point any fingers
<a TITLE="See my user info" href=http:
|
|
|
|
|
leppie wrote:
its usually a threading/delegate/callback error.
Had it been happened during the debugging then I could have catched it. But suddenly crashed, so I have no clue how it happened or which code made it crashed. I tried 2 or 3 times to bebug the app, but that error didn't throw up. Argh!!!
Never take a problem to your boss unless you have a solution. This signature was created by "Code Project Quoter".
|
|
|
|
|
Kant wrote:
Had it been happened during the debugging then I could have catched it.
Nope, those errors are not caught by the debugger (maybe if unmanaged debugging is turned?).
<a TITLE="See my user info" href=http:
|
|
|
|
|
leppie wrote:
unmanaged debugging is turned?).
It was false. I changed to "true", let me see if I can reproduce the error.
BTW, IIRC the only unmanaged code in my app is the code I borrowed from Marc (Single Instance)
Never take a problem to your boss unless you have a solution. This signature was created by "Code Project Quoter".
|
|
|
|
|
|
Can I use the RowFilter of a DataView to populate it with only the enteries in the specified coloum that start with a certian letter?
tia
|
|
|
|
|
gadgetfbi wrote:
Can I use the RowFilter of a DataView to populate it with only the enteries in the specified coloum that start with a certian letter?
Confused by the statement. The "in the specified column that starts with". The column starts with a certian letter or the data in the column starts with a certain letter?
If it is the latter and you only want to filter the rows by a given column that has data starting with a certian letter you would:
myDataView.RowFilter = "substring(myColumn,1,1)='B'"
Where myColumn is the column you wish to filter by and 'B' is the letter you wish to match.
Rocky Moore <><
|
|
|
|
|
yeh, thanks.
I wasnt sure if I could use string operators in the filter expression. I need to read more.
Rob
|
|
|
|
|
Yeah, they have a lot of functionality in there filters and sorting ability in DataSets. Makes for a lot less work!
Rocky Moore <><
|
|
|
|
|
I am using the compiler from inside a program, using the Microsoft.CSharp.Compiler class.
When compiling code, I add references to system.dll, mscorlib.dll, and another custom library deployed to the global assembly cache.
I am now recieving an error stating that the custom library could not be found. I have viewed the global assembly cache and verified it is there. I am simply refering to it as myLib.dll.
Any ideas why the compiler would not associate "myLib.dll" with the myLib.dll in the global assembly cache? This is confusing me because system and mscorlib are found just fine.
|
|
|
|
|
To my knowledge the compiler never looks for an assembly in the GAC. Instead you need to supply a physical location for it to find your assembly.
I would guess that System.dll and mscorlib.dll are automatically found because the %WINDIR%\Microsoft.NET\Framework\%version% directory is automatically searched by the compiler.
I have no experience with the compiler classes, but this is how the command line compiler behaves.
James
"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him
|
|
|
|
|
YagiSka wrote:
I am simply refering to it as myLib.dll.
You need to give the fully qualified name or the location.
<a TITLE="See my user info" href=http:
|
|
|
|
|
The fully qualified name would be like
myLib.dll,version=1.0.0.0,publicKeyToken=2222222,culture=neutral
correct?
If so, I tried that and still ran into the same problem.
|
|
|
|
|
Alright, I fixed that problem, thanks for the help. However, this led to a new problem.
I am saving the compiled assembly to disk, and then reading the contents and loading it via Assembly.Load(). This is so that the file is not locked, and can be recompiled and reloaded.
However, I am getting an error when I try to use the xml serializer with a type found in this assembly. It tells me that the assembly may be dynamic, and I must save and load it from disk in order to use the xml serializer with it.
How can I avoid this. I absolutely need to use the xml serializer, and I absolutely need to prevent the file from locking.
Also, with this error be generating with the binary serializer as well?
Thanks
|
|
|
|
|
YagiSka wrote:
This is so that the file is not locked, and can be recompiled and reloaded.
That will cause multiple version of the same types to be loaded in the same appdomain. I'm afraid, you will have to load the assembly in another appdomain and use remoting to prevent to the type being consumed but the "main" appdomain.
Have a look at my Plugin Manager article. It could solve your problem.
<a TITLE="See my user info" href=http:
|
|
|
|
|
leppie wrote:
That will cause multiple version of the same types to be loaded in the same appdomain.
Right, but in my case that's actually not a bad thing. The program I'm writing has VERY long lifecycle objects. It is entirely possible for an object of both the old type and new type to exist at the same time.
Objects are persited in binary format, and it's simpler to modify the binary formatters behavior to update the objects to use the new code during a reboot then to try to update the objects when the program is running.
As to my xml formatter problem, xml in this program is mainly used to set values for newly created objects. Xml serialization doesn't really work for the type of objects I'm working with, so binary is used to save and load state after an object is first created. So since I'm only setting supplied values for types I can discover the public members of, I'm thinking of simply writing my own xml serializer.
|
|
|
|
|
Your alternative to the BinaryFormatter is the SOAPFormatter, but beware those files are @#$@## HUGE! XML serialization has many drawbacks, but those are tradeoffs for space. Another thing you can look at is the SerializationState (?). There is an enum with various options how the object will be de/serialized for persistance.
The ideal solution is to build some "basic" XML serializable objects and use a wrapper for the more complicated stuff.
HTH, I wish someone can create a "simple" solution for this.
<a TITLE="See my user info" href=http:
|
|
|
|
|
Ok, going through this, implementing my xml deserializer is turning out to be rather simple so far, but my needs for it are rather simple.
Only, I've run into an embarrasingly simple problem.
I get all the public, writeable properties in the type, and then look for corresponding information in the xml file.
If the property type is not a value type, then I do the same process for the object.
The only problem is when it's an array. If the property type returns as System.Array, how can I tell what type of array the property wants? As in string[], int[], object[], etc.
I am of course assuming that if I have a property of type string[], when I query the properties type it will return System.Array.
Thanks again
Kris
|
|
|
|
|
YagiSka wrote:
Only, I've run into an embarrasingly simple problem.
I only learnt of this recently too after a year
Type.GetElementType()
Note: It does not work on interfaces
<a TITLE="See my user info" href=http:
|
|
|
|