|
You could use the SecondaryBuffer[^] class in Microsoft.DirectX.DirectSound to play your waveform and set its Volume property to Volume.Max / 2 to get 50% volume.
If you're asking how to set the actual soundcard mixer, I believe there is an API to do that, though probably not managed. But I'm not familiar with it.
|
|
|
|
|
Hi!
This article[^] gives you a library to work with the windows audio mixers. You can use these classes to set the volume for every mixer line you need.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hello experts,
I'm using the System.Runtime.Remoting.Channels.Ipc namespace, and other remoting-related classes to communicate between instances of my app.
I have registered a class using the RemotingConfiguration.RegisterWellKnownServiceType() method, specifying WellKnownObjectMode.Singleton .
AFAIK, normally, the server automatically creates an instance of the object when the first request for the object is made, and for any request which follows, only returns references to it.
What I would like to do, is to be able to create the first instance myself, and have the clients requesting the object receive the reference to MY object.
Is it possible? How?
Hope I made myself clear enough...
Thanks in advance,
Shy.
|
|
|
|
|
Maybe if the application creating the server would also create a temporary client which would instantiate the first instance of the class?
|
|
|
|
|
Hello!
The RemotingServices.Marshal() method does exactly this - it publishes a given instance of an object as remoting server.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Thanks a bunch!
Greatly appreciated!
Wow... there are times I tell myself "Microsoft are really f***ed-up for not having an implementation for this and that in the .NET framework."
But then there are times I think the .NET framework contains everything a programmer needs...
Regards,
Shy.
|
|
|
|
|
I would like to use C# for writing a program to compile file html to file XML.How should I do? anyone help me?
|
|
|
|
|
turoi wrote: compile file html to file XML
|
|
|
|
|
You cannot compile HTML or XML. I thnk you mean to convert HTML to XHTML ? You'd have to write a parser to do that.
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 )
|
|
|
|
|
There's already a program for this, HtmlTidy.
|
|
|
|
|
To start, this is what I'm trying to do:
I have a custom style for my TreeViewItems in my WPF application. They do not have the small (+) expanders on the sides of my root items, and I don't want them anyway, so I have to double-click my TreeViewItems that have child items in order to expand them. I would rather my users have to single-click those TreeViewItems to expand them, showing the child items.
My problem is that the SelectedItemChanged event is not being fired when I select an already selected TreeViewItem, not allowing me to set the IsExpanded property in my event handler.
I have two options:
1. To find an easy way to expand my root TreeViewItems by single-clicking them instead of double-clicking them.
2. To allow the SelectedItemChanged event to fire even if the object I'm clicking on is already selected.
How do I either fire the SelectedItemChanged event if the selected item of the event is already selected?
For instance, I select one item in my TreeView, I select it again. However, the SelectedItemChanged event is not fired again because it's already selected, and technically not changed.
I tried using TreeView.MouseLeftButtonDown to test a click on my TreeView, but the event wasn't even firing because the SelectedItemChanged event was being fired when I would select items.
I've also tried setting the selected TreeViewItem's IsSelected property to false.
Any suggestions?
I appreciate your help in advance!
~ Doc
|
|
|
|
|
Try using the NodeMouseClick event.
Extract the clicked node from the e argument passed to the event, and call its Expand() method.
Regards,
Shy.
|
|
|
|
|
Sorry, I forgot to mention my application is a WPF application, so there isn't a NodeMouseClick event...
|
|
|
|
|
No... you did not...
I'm the one who didn't see it...
|
|
|
|
|
|
I'm using Visual C# Express Edition and the XNA Game Studio add-on.
If I want to include a System.X file by just writing "using System.X.Y" in the top of the program the compiler says he cannot find the files. I heard that there is another possibility to include the files so that's working (that should work somehow with the menu). If anyone knows how it works please write it in the message board.
Thanks.
Ich benutze Visual C# Express Edition mit der XNA-Game-Studios Erweiterung.
Wenn ich eine System.X-Datei einbinden will, und nur "using System.X" am Anfang des Programms schreibe, meldet der Compiler, er finde die Dateien nicht. Ich habe gehört, es gebe auch noch eine andere Möglichkeit die Dateien einzubinden (soll irgendwie über das Menü funktionieren).
Ich habe bis jetzt noch nicht herausgefunden, wie das funktioniert. Wenn es jemand weiß, bitte ins Forum schreiben.
Danke im Voraus.
|
|
|
|
|
Writing using This.That; doesn't include anything in your project.
It's just a shortcut for writing This.That. in front of every class living in this namespace.
You'll have to add a reference to the assembly containing these classes via the project explorer ("Add reference..."/"Verweis hinzufügen...") so that the compiler is able to find the corresponding classes.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi!
I have a question:
How i can download the email from POP3 server?
Thanks, Bye!
Bye
|
|
|
|
|
|
Hi!
First I suggest you read what POP3 is: http://en.wikipedia.org/wiki/POP3
You'll see that it's just a bunch of ascii commands being sent to a given port (usually 110) on the POP3 server.
If you plan to implement such a class yourself you can simply take a TcpClient as base class to perform the actual communication with the server.
...Or you just follow the suggestion from martin_hughes (posted while I was still typing)
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
I have written an XML file using this code
private void AddBook(string ISBN, string title, string author)
{
if (booksElement == null)
{
booksElement = xmlDoc.CreateElement("Books");
}
XmlElement bookElement = xmlDoc.CreateElement("Book");
XmlAttribute bookAttribute = xmlDoc.CreateAttribute("ISBN");
bookElement.SetAttributeNode(bookAttribute);
bookAttribute.Value = ISBN;
XmlElement titleElement = xmlDoc.CreateElement("title");
titleElement.InnerText = title;
bookElement.AppendChild(titleElement);
XmlElement authorElement = xmlDoc.CreateElement("author");
authorElement.InnerText = author;
bookElement.AppendChild(authorElement);
booksElement.AppendChild(bookElement);
xmlDoc.AppendChild(booksElement);
xmlDoc.Save(path);
}
it works fine for a new book, but I cannot OPEN an existing xml file and add a book (node) to it.
How do I append a node??
_____________________________________________________
Yea! I could be wrong...
|
|
|
|
|
Hi!
You didn't show how you create the xmlDoc object, but XmlDocument has a Load() method you can use to open an existing xml file.
If you do open an existing file, you don't have to create the root entry (I guess it's booksElement , but can use xmlDoc.SelectSingleNode("/Books") to retrieve a reference to the existing node.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
I'm sorry I posted only the function of creating one node...
I grabbed code from www.kirupa.com , all of it is here..
private XmlDocument xmlDoc = new XmlDocument();
private XmlElement booksElement;
private void AddBook(string ISBN, string title, string author)
{
if (booksElement == null)
{
booksElement = xmlDoc.CreateElement("Books");
}
XmlElement bookElement = xmlDoc.CreateElement("Book");
XmlAttribute bookAttribute = xmlDoc.CreateAttribute("ISBN");
bookElement.SetAttributeNode(bookAttribute);
bookAttribute.Value = ISBN;
XmlElement titleElement = xmlDoc.CreateElement("title");
titleElement.InnerText = title;
bookElement.AppendChild(titleElement);
XmlElement authorElement = xmlDoc.CreateElement("author");
authorElement.InnerText = author;
bookElement.AppendChild(authorElement);
booksElement.AppendChild(bookElement);
}
private void WriteToDisk(string path)
{
xmlDoc.AppendChild(booksElement);
xmlDoc.Save(path);
}
static void Main(string[] args)
{
Program bookList = new Program();
bookList.AddBook("0553212419", "Sherlock Holmes: Complete Novels and Stories, Vol 1", "Sir Arthur Conan Doyle");
bookList.AddBook("0743273567", "The Great Gatsby", "F. Scott Fitzgerald");
bookList.AddBook("0684826976", "Undaunted Courage", "Stephen E. Ambrose");
bookList.AddBook("0743203178", "Nothing Like It In the World", "Stephen E. Ambrose");
bookList.WriteToDisk(@"C:\books.xml");
}
So you see this creates a file OK.... But If I cannot ue this function to Append to the saved books.xml file.
meanwhile, I try the SelectSingleNode, and see if it works.
_____________________________________________________
Yea! I could be wrong...
|
|
|
|
|
Hi,there
I have a window application in C# (vs2003), I have one form class(Form1) and the Main[] located in the other class - MyProjectMain,
how do I pass variable between those two classes, for example I want to pass the arg[] that Main[] gets and populate in textBox1 of Form1?
Thanks a lot for your help,
namespace MyProject1
{
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox textBox1;
}
...
}
namespace MyProject1
{
public class MyprojectMain
{
[STAThread]
public static void Main(string[] args)
{
Application.Run(new Form1());
}
}
|
|
|
|
|
Put a parameter in the constructor of the form:
public Form1(string[] args)
Pass the arguments when creating the form:
Application.Run(new Form1(args));
---
single minded; short sighted; long gone;
|
|
|
|