|
Matt Philmon wrote:
somehow make that function think it's writing to disk when it's actually writing to memory.
You could use a memory-mapped file (read the MapViewOfFile API call documentation for this).
But it is really overkill.
Yes, even I am blogging now!
|
|
|
|
|
Hi,
I need to display a treeview control node with: a check box, icon, title and a bitmap under the title.
Anyone have any ideas on how to do this?
thanks,
Chuck
|
|
|
|
|
Hi, I have problems with reading xml files tha contains values with ñ char, li this:
<br />
<BaseDatos>Piña</BaseDatos><br />
this throw me an exception:
<br />
XmlDataDocument DocumentoXML =new XmlDataDocument();<br />
DataSet DS = new DataSet();<br />
DS = DocumentoXML.DataSet;<br />
DS.ReadXml("file.xml");<br />
What I need to do to deal with in this case?
Than you
La realidad no es más que impulsos eléctricos del cerebro - Morpheus
|
|
|
|
|
One way of changing encoding is to have this:
<?xml version="1.0" encoding="ISO-8859-1" ?>
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
I am seeing an unusual problem, I have a main windows form that opens a form using showdialog. If there is an exception in that "subform" during a debug run the IDE shows it as being in the main form and if I break it breaks at the ShowDialog in the main form and not at the actual code that caused the exception in the sub form.
I don't see this in any other projects, any ideas? Could it be a project setting somewhere gone awry or...?
|
|
|
|
|
I take it you see a green triangle, too. This happens when the exception occured in an native API call or in another unmanaged thread. The debugger can't figure out where it happened, so it positions the indicator to the caller that spawned the message pump. This also happens for a top-level form, when the green triangle is position just after the Application.Run call (it's after because of the return address being after the function call itself, in terms of the JIT'd native code).
BTW: Congrats on receiving my 8,000th response! Just had to tell someone.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Any gift for the guy receiving your 8,000th response, Heath? Perhaps it's already in Santa's Christmas list
|
|
|
|
|
What, and leave the guy that responded to roughly 8,000 questions with nothing?
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Heath Stewart wrote:
This happens when the exception occured in an native API call or in another unmanaged thread.
I wish it were something like that, in this case it's neither. For example, I can, in one of those sub forms simply do something like attempt to access a null string and the IDE will break and will show the exception being in the code that called showdialog for that sub form.
If I attempt the exact same thing in a test project it breaks into the null access (for example) as expected.
There is no green rectangle, I know exactly what you mean about an exception in unmanaged or native code, this isn't the same thing at all, it's a simple exception in a form that was created through showdialog from another form in this one project.
The only thing unique about this project is that the solution overall is huge and has both the business tier and UI tier in it.
It's really bizarre and annoying, oh well, maybe it will clear up in vs2005.
Thanks for replying.
|
|
|
|
|
I was wondering how to create a file association in my app. So when the user double-clicks on a saved file (a file that was created using serialization), the program will execute and open the file. Also, how can a file icon association be created in the registry? I wasn't able to find to much on the web doing a search. Any help greatly appreciated.
Brian
|
|
|
|
|
This need to be done as part of your setup routine, like an installation program. Visual Studio .NET has a deployment project that makes this very easy.
Otherwise, read Creating a File Association[^] in the Platform SDK.
Your setup routine should not hard-code the path to your executable. Using VS.NET's Windows Installer project you can associate your executable file with the extension so that the right path is used. In less "automated" setup environment you associate the executable's file path with the target application for that file extension. Just try it out. It's quite easy.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Ladies and Gentleman,
How can I create a relative path in a .config file? Basically so I can tell the logging project im using to insert the log at the applications location\log.
Thanks,
Ryan
|
|
|
|
|
What's in the config file has nothing to do with how it's interpreted. The logging project's IConfigurationSectionHandler must understand relative paths and treat them as such. Only the project documentation can tell you whether or not it's supported, but since you didn't tell us what logging project you're even using (assuming it's a public release) we can't really help you.
It's the logging project that handles relative paths or not. What's in the .config file is just data.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Im using log4net, with the file appender, which has you specifically put the path of the log file to be created in the file appender. Unless there is a better way of doing it.
|
|
|
|
|
If you have questions about managed (i.e., not as in ".NET") projects - like those on SourceForge - please ask in their forums. For the log4net SF project page, see http://sourceforge.net/projects/log4net[^]. Your question is specific to their project, not to .config files (again, because the .config files contain just data - it's the implementation of the configuration section that interprets that data).
It's mainly for your benefit: you'll get more concise help for a project that offers it than on a general forum. You'll also learn more by looking at their source code, which - since it is on SF - is available in their CVS reposity - which is also viewable online - and more often than not as a separate download.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I had/have the same problem as you, too. I even tried to find the appender at runtime and make its relative path as an absolute, but it already did it itself. I tried to set a config value of "~/MyLogfile.log" and replace the tilde at runtime.
Maybe you could derive your own class from FileAppender and implement that behavior? What you can do is to place placeholders like "${SystemDrive} " in the path and let it expand it during runtime for you. See the docs for details.
--
Affordable Windows-based CMS: www.zeta-producer.com
|
|
|
|
|
Ahh, thats a good idea, thanks Uwe.
Ryan
|
|
|
|
|
Hello
I made a UserControl containing a ComboBox and I want the "Items" property of the combo relayed to my UserControl :
public class MyUserControl : System.Windows.Forms.UserControl
{
private ComboBox cb;
[...]
public ComboBox.ObjectCollection Items
{
get
{
return cb.Items;
}
}
}
This works but the UITypeEditor isn't "string collection editor" as it is for the ComboBox, but "object collection editor".
So basically, it isn't useful at all.
Is there a way i can force the UITypeEditor being a StringCollectionEditor, even though this class seems to be an internal framewok class ?
Thanks,
Etienne.
|
|
|
|
|
have you tried just marking up your accessor with the correct attribute?
[Editor("System.Windows.Forms.Design.ListControlStringCollectionEditor, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
public ComboBox.ObjectCollection Items
{
get
{
return cb.Items;
}
set
{
cb.Items = value;
}
}
|
|
|
|
|
hello,
thanks for answering. You can't set the Items property of a ComboBox. Your code nearly works, though the values are not serialized so the AddRange isn't added to InitializeComponents(). I'm going to try and find a way to do this.
|
|
|
|
|
to get the code in the designer's InitializeComponent method you also need a ShouldSerializeFieldName method too, so in your case it would be:
protected bool ShouldSerializeItems()
{
return true;
}
Note protected modifier - it doesnt need to be on the public interface of the object.
Alo, your collection will need an AddRange method on it for the IDE code gen stuff to work.
|
|
|
|
|
I have tried ShouldSerialize(...) and DesignerSerializationVisibility attribute with no luck. Apparently, there is no easy way to simply publish the combobox "Items" property in my UserControl, which is sad. Looks like i'll have to make my own Items collection class...
Again, thank you for answering.
Etienne.
|
|
|
|
|
The UITypeEditor has nothing to do with serialization. It's only an editor, hence the name. To get default serialization of your class, use the DesignerSerializationVisibilityAttribute to attribute your property, using the DesignerSerializationVisibility.Content enumeration member.
To customize serialization, implement your own CodeDomSerializer derivative for either your custom collection class or your property and attribute your collection class or property with the DesignerSerializerAttribute using the type of your CodeDomSerializer attribute. Several of the types mentioned above have examples in the .NET Framework SDK, which you can read online at http://msdn.microsoft.com/library/en-us/dnanchor/html/netfxanchor.asp[^] but that is also installed by default with VS.NET and the .NET Framework SDK stand-alone installer.
If you implement your own CodeDomSerializer be sure to set DesignerSerializerAttribute.Hidden or just don't use it at all.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi,
Is any one know, How to call CreateFileMapping in C#.
Thanks
|
|
|
|
|