|
Hello,
anyone knows if there is a configuration framework available which provides saving of configuration and edit the configuration in an graphical editor..
Best regards
Hansjörg
|
|
|
|
|
|
Hello,
I search some configuration framework with which I can make application configuration. Edit inside the application, load and save a new configuration. The property grid is for sure usefull to make such a framework, but it is only a part of it...
Til now I have found NINI which looks good. But it provides only to part of saving and loading...I search also the part of the graphical representation of the configuration data.
Best regards
Hansjörg
|
|
|
|
|
How do I go about getting 24bit audio to play using directSound? 8 and 16 bit audio plays fine, but when ever I go to play 24 bit audio, my program throws an 'Value does not fall within the expected range.' exception on:
sound = new SecondaryBuffer(dataGridResults.CurrentRow.Cells[3].Value.ToString(), d, dSound);
The creation and initialization:
private Device dSound;<br />
private SecondaryBuffer sound;<br />
private BufferDescription d = new BufferDescription();<br />
<br />
dSound = new Device();<br />
dSound.SetCooperativeLevel(this, CooperativeLevel.Priority);<br />
d.LocateInHardware = true;<br />
<br />
d.ControlPan = true;<br />
d.ControlVolume = true;<br />
d.ControlFrequency = true;<br />
d.ControlEffects = true;<br />
d.GlobalFocus = true;<br />
How do I fix this?
|
|
|
|
|
Is the file a Wav or an MP3?
|
|
|
|
|
The file is a wav recorded at 44100.
|
|
|
|
|
I remember reading something about this a loooooooong time ago, but I can't remember what and I can't for the life of me remember where. Bear with me while I try and see if I can dig it up.
One other question, does the DirectX sample application (included with the DX SDK) do the same thing when you try and play the file?
|
|
|
|
|
Thanks for any help you can give.
I tried the file in several of the sample applications, and they all give 'File to large. You should stream large files'. However, I get this message even with files that play correctly in my app.
|
|
|
|
|
I'm running into exactly the same problem here and I haven't worked it out yet.
Did you get anywhere with this?
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
I created a brand new project and open clissview diagram window. Then i added 2 class Person and Employee i want to add the inhertiance line to show the relationship but visual studio doesn't let me to drag and drop the inhertance symbol from the toolbox window.
I know If i create these two classes then i will automatically but i want to create class diagram first then actually creating classes.
Any help thanks
|
|
|
|
|
Don't drag and drop it, just click the inheritance tool and your cursor will now change on the designer. You then click on the child class and you will see a line start to draw. You finally click on your base class and the inheritance has thus been completed.
Hope that helped.
Also, quick question. Shouldn't the employee just be an enum of PersonType?
|
|
|
|
|
|
Hello,
I'm trying to eliminate a huge switch() block in my code by the use of Reflection. I added a dictionary to the class, and then tried populating it in a static constructor. The goal is that later I'll simply get delegates from this dictionary and use DynamicInvoke on them, which would replace the switch.
An example of what I'm trying to do:
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
ClassA a = new ClassA();
}
}
class ClassA
{
static ClassA()
{
foreach (MethodInfo mi in typeof(ClassA).GetMethods(BindingFlags.Instance | BindingFlags.NonPublic))
if (mi.ReturnType == typeof(UInt16))
{
ParameterInfo[] pis = mi.GetParameters();
if ((pis[0].ParameterType == typeof(String).MakeArrayType()) &&
(pis[1].ParameterType == typeof(Byte).MakeArrayType()) &&
(pis[2].ParameterType == typeof(Byte).MakeArrayType().MakeByRefType()) &&
(pis[2].IsOut))
{
CallbackMethods.Add(mi.Name, Delegate.CreateDelegate(typeof(CallbackMethodDelegate), mi));
}
}
}
private static Dictionary<string, delegate=""> CallbackMethods = new Dictionary<string, delegate="">();
private delegate UInt16 CallbackMethodDelegate(String[] header, Byte[] mgedDataIn, out Byte[] mgedDataOut);
private UInt16 Method1(String[] header, Byte[] mgedDataIn, out Byte[] mgedDataOut)
{
mgedDataOut = null;
return (UInt16)0;
}
}
}</string,></string,>
Executing this code gives me a TypeInitializationException when running the Delegate.CreateDelegate() method.
This is undoubtedly linked to the fact that I want to invoke instance methods, while the delegates are being created in a static constructor. In fact, if I copy and paste the code of my static constructor into an instance constructor, make the dictionary an instance variable, and call a different overload of CreateDelegate (the one that receives firstArgument, since I now have this ) it works.
So my question would be: is there a way to create these delegates in the static constructor, and then later when calling DynamicInvoke on them, bind them to the correct instance of the class?
Thanks in advance for any suggestions you can offer.
Leonardo Pelisoli
|
|
|
|
|
Instead of making a dictionary of method name to a delegate, why not make it a dictionary from name to method info? Then, just call the method later using reflection by calling MethodInfo.Invoke().
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
Skippums,
Thanks for your suggestion. I've indeed done as you said one time before, and it works. However, as far as I understand it, reflection done in this fashion is very slow when compared to a normal method call.
In this part of the application, I can't really afford the performance loss. That leaves me with delegates as my only choice since they are, as I understand it, much faster than reflection.
Leonardo Pelisoli
|
|
|
|
|
It is my understanding that delegates are by design bound upon creation. Therefore, you either need to have the object being bound in your static constructor, or you need to use reflection.
Another alternative that may help is a hybrid of the two, where you would add a value to the dictionary so you keep BOTH the delegate AND the method info. Then, whenever you call the method that needs to use the delegate, check if the delegate is null, and if so, bind the delegate at that time and save it in the dictionary. Since dictionary lookup is an O(1) operation, the only noticable performance penalty would occur the first time you called the method. Alternatively, you could do this work in the instance constructor for the class, which would eliminate the slight overhead in the methods that use the information. Anyway, let me know if this will work for you.
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
Skippums,
I ended up filling the dictionary in the instance constructor of the class, as you said, so that I can bind the delegates at that time. It works!
Thanks a lot for your help.
Leonardo Pelisoli
|
|
|
|
|
Hello,
Is there any way to disable the scrollwheel function for a ComboBox?
Thanks
R.Myers
|
|
|
|
|
The combobox has a MouseWheel event but it appears to have no way of altering the data (the properties are all read only) or cancelling.
You may have to invesigate in the API: WM_MOUSEWHEEL[^]
|
|
|
|
|
This works!
namespace WindowsFormsApplication1
{
public partial class Form1 : Form, IMessageFilter
{
private const int WM_MOUSEWHEEL = 0x20A;
public bool PreFilterMessage(ref Message m)
{
if (m.Msg == WM_MOUSEWHEEL && this.ActiveControl == comboBox1)
{
return true;
}
return false;
}
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
Application.AddMessageFilter(this);
}
}
}
|
|
|
|
|
Thanks! That worked great!
R.Myers
|
|
|
|
|
Does anyone know how to embed hidden characters in a rich text box? I am trying to do some custom advanced formatting, and I would like to embed hidden characters to trigger start and end formatting..
Thanks!
|
|
|
|
|
I hope you know how to use Google, since that's how you will find what you need[^] I guess.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Hi,
C# vs2005. Im creating a simple web page image upload program.
The user enters a local directory and the web page displays thumbnails of all the images in that directory.
This works fine if I create thumbnail files on the server and display the images using their virtual paths eg "/images/image1.jpg"
Copying the files can be time consuming so im trying to get the same result without creating my own thumbnail copies.
I create ImageButtons and set the image url to be the absolute location of the image on the client eg "c:\temp\images\image1.jpg"
When I run the app the images are not displayed. If I copy the generated html and load it in another instance of internet explorer the images are displayed fine.
How can I get images to be displayed using absolute paths when the images reside on the client?
Many thanks,
Chas
|
|
|
|
|
I have created an invoice like crystal reported,
Which gets it data from a stored procedure with 1 parameter which tells which invoice data to use.
Now the problem is that it always tryes to execute this stored procedure from the server it was created on, I have set the database login but it still doesnt execute from that database.
Now im either looking for a method of fixing this or another method to get the data in.
I have tryed using a dataset using the SetDataSource function but i have no idea how i can assign or even get the fields in the crystal report designer mode to there proper locations.
Thanks
ReportDocument Report = new ReportDocument();<br />
if (File.Exists("factuur.rpt"))<br />
{<br />
Report.Load("factuur.rpt", OpenReportMethod.OpenReportByTempCopy);<br />
}<br />
else if (File.Exists("..\\..\\factuur.rpt"))<br />
{<br />
Report.Load("..\\..\\factuur.rpt", OpenReportMethod.OpenReportByTempCopy);<br />
}<br />
else<br />
{<br />
MessageBox.Show("Factuur.rpt niet gevonden, opdracht kan niet uitgevoert worden");<br />
return;<br />
}<br />
Report.SetDatabaseLogon(settings.user, settings.password, settings.server, settings.db);<br />
Report.SetParameterValue("@FactuurID", ID);<br />
crystalReportViewer1.ReportSource = Report;<br />
<br />
|
|
|
|