Something that just hit me, are you trying to read/write existing files/file formats or something brand new?
If the latter then serialization is one step in the same direction. You can either let the framework handle all of the details (simply apply the Serializable attribute to the class/struct) or you can customize it by also implementing ISerializable.
"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
For my current project, I am going to use XML. But I want my documents to be able to be embedded in OLE documents, not just linked.
I really like the idea of serialization, and have tried it out. (Just think - persist your whole class and let .NET do the work (except for the attributes on the members)!) But can a legacy OLE document use it like IPersistStorage? (They'd be smart to do it this way, and it wouldn't be too hard.)
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
We have a Windows Service written in C# that simply host some remote
components. The service does nothing itself. We have an ASP.NET application
that initialises the remoting in global.asax and has a single aspx page that
creates the remote component and calls its method, which returns a small
string. Thing is that the service process leaks memory. Now I've read most
of the articles/books on the wonders of the GC and I know that what I'm
seeing is not normal behavour. And here the catch: if I run the application
as a standard process, i.e. I replace the call to ServiceBase.Run with a
long Sleep statement - the application does not leak memory. The CLR memory
performance counters show very different traces of #bytes on heaps running
the same test. What could be causing this behaviour? Could anyone from
Microsoft check to see if remoting components from a Service has memory
issues. In the ASP.NET page I simply release the object by setting the
reference to null. My tests run for several hours with several hour of low
and high load but the service never reduces it memory. The process version
remains very flat. I'm not using any unmanaged resources or any thing that
consumes loads of memory just small string (100 characters or so).
Is anyone doing much work with Graphics.DrawImage? It does an adequate job for small images, but if you start getting into large ( 5 meg + ) images it really sucks. It also does not appear to be any faster if you limit the size of the image that is actually being drawn (drawing only a small portion of it).
DrawImage appears to limit .NET's unusability for anything similar to the complex and efficient drawing capabilities available with the various bitblting techniques in Win32 (which I know are available in .NET with a little extra work, but you no longer get the Transform methodlogy etc. available with GDI+ under .NET, which is nice to have). I'm also aware of various image cacheing techniques which speed up DrawImage - but for large images they simply require too much memory to be practical.
All of the rendering capabilities in .NET are performed by GDI+ (1.0 at the moment). GDI+ 1.0 has zero support for hardware accelleration, from my understanding. I beleive that GDI+ 1.1 will have support for hardware accelleration (assuming your video card has the appropriate new drivers).
I, too, have noticed this nasty surprise. You can tweak the Graphics object to use lowest quality rendering, and you can use DrawImageUnscaled to try and speed things up a bit, but I don't think it will be an order of magnitude faster than it is currently, and it certainly wouldn't compare to real hardware accelleration of the blitting/stretching.
"Have you gone mad Frink? Put down that science pole!"
i've developed a c# windows application that envolves file I/O. Up to now all development has been on my own machine running win2k pro and i am logged in as an administrator. I recently tried running the code on another machine on which i installed the .net redistributable and as soon as the app tried to access the file system (i.e when opening a file dialog) it through an exception of the type System.Security.FileIOPermissions.
I've looked into it a bit and discovered how the clr assigns permissions to different assemblies at runtime etc.
What i'd like to know is, is there a way for me to configure my code so that it can always access the file system on other machines... i don't want the user to have to manually increase the trust level using the .net config tool as that would be very messy!!
It seems that the .NET LicenseProvider does not work if the user is not allowed to modify the executing assembly, for instance, if the licensed control is consumed in an ASP.NET web application.
What are the possible workarounds?
Its recommened to use SQL Server .NET data provider because its made strictly for SQL Server and supports all its features. the OleDb.NET provider is a general provider and can be used for connectivity to any database Sql Server, Access, Oracel, etc...
Similarly you should use the Oracle.NET dataprovider for connecting to oracle.
There are finer points than what I've mentioned but that the bird's eye view.
I'm having a problem with a form that's supposed to be a topmost form, but it actually isn't. The form is created during the application startup by a method called on one of the main form's components. Here's what I do:
public class MyMainForm
CustomControl myControl; // Initialized during InitializeComponent()
// Initialize Component then do other stuff
in class CustomControl:
public void PerformCustomInit()
TopMostForm newForm = new TopMostForm();
newForm.Topmost = true;
I hope the description is clear enough. Of course I omitted things that weren't necessary, the topmost form is created only under given conditions on the custom control. However it doesn't stay always on top, and I suspect this is due to the fact that it's created and the property is set in the constructor for the main application form. Anyone can confirm this and perhaps help me with a hint for a solution?
Isn't there an event for when the form's z-order changes (or some such thing)? Maybe you can trap that and force it back.
Help! I'm an AI running around in someone's f*cked up universe simulator. Sensitivity and ethnic diversity means celebrating difference, not hiding from it. - Christian Graus Every line of code is a liability - Taka Muraoka Microsoft deliberately adds arbitrary layers of complexity to make it difficult to deliver Windows features on non-Windows platforms--Microsoft's "Halloween files"
i have to get access to the system image list. In MFC i used the SHGetFileInfo-methode to get a handle to the system image list. I need it to display files and their corresponding icon in a listview. What methode can i use in .NET framework c++ ? Maybe someone can help me.
I wanna to build a flow chart program in c#. It is like a simpler IDE. The canvas contains the block (rectangle or circle), link shape, some buttons and lists. If these buttons and lists can make use of the control in dotnet, it will save us a lot time to simulate out ourselves. In the program's design time, user can draw the block and link them, drop the control of dotnet into the block. Adjust its position, size , change its title, and maybe assign some script of vbscript or jscript to the event like button's click. In run time, all element can't be moved, only the event are responsed.
Do you think it possible in dotnet? Is there any example or link to study?
Thanks James for the link. Its got wonderful featues, which I require. Why I chose .NET deployment wizard was that, I thought it is the only one which will detect for a framework installation. Else I had been using a very simple easy to use installer, for my previous project.
And also the uninstall process for the ones we make with .NET deployment wizard, will not delete the application folder. It deletes only those files which were created during installation So it retains the old settings or other such information we record during a previous install
You are never given a wish without also being given the power to make it true. You may have to work for it, however.
-- Richard Bach
I created a COM+ library appliation using ServicedComponent and a client both in C#. When I keep the client on a remote computer how do I tell it to create an object from the server machine running the COM+ application, without registering the COM+ Server Component dll on the client machine.
Hi Giles, I did it. I used .NET Remoting and its working just fine. Now I can change the entire engine code without breaking the client even when they're running
I created the a .NET based interface and derived a ServicedComponent class from it, registered that class with COM+ catalog. Then created a remoting server and hosted the Class using "RemotingConfiguration.RegisterWellKnownServiceType(...)".
Now all the client needs is the interface and it works fine till that does'nt change. It can create a remote object based on that interface and that's it.
Last Visit: 31-Dec-99 18:00 Last Update: 29-Sep-23 19:14