|
Argh. Reflector confirms what I suspected, that WebClient and WebRequest.GetResponse() both depend on WebRequest.BeginGetResponse(), which requires at least two free threads in the system threadpool.
That's pretty annoying. But not as annoying as how WebClient and WebRequest/WebResponse don't have a satisfactory overlap in power. WebClient makes certain common things easy, like POSTing data. WebRequest/WebResponse allow for certain things like changing the TransferEncoding or setting timeouts, but then I have to write my own UploadValues() for WebResponse, and all of the URL encoding functions are private. Useless!
|
|
|
|
|
hello,
i want to create a dialoge box and then dispose or close it, how can i do this in c#? can i?
ASIM
Asim
|
|
|
|
|
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace SolidAvatar
{
public class Form2 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button cmdOK;
private System.Windows.Forms.Button cmdCancel;
private System.ComponentModel.Container components = null;
public static DialogResult DoShowDialog(IWin32Window owner)
{
Form2 myForm = new Form2 ();
return myForm.ShowDialog (owner);
}
private Form2()
{
InitializeComponent();
}
protected override void Dispose( bool disposing )
{
if( disposing )
if(components != null)
components.Dispose();
base.Dispose( disposing );
}
private void InitializeComponent()
{
this.cmdOK = new System.Windows.Forms.Button();
this.cmdCancel = new System.Windows.Forms.Button();
this.SuspendLayout();
this.cmdOK.DialogResult =
System.Windows.Forms.DialogResult.OK;
this.cmdOK.Location = new System.Drawing.Point(112, 200);
this.cmdOK.Name = "cmdOK";
this.cmdOK.TabIndex = 0;
this.cmdOK.Text = "OK";
this.cmdCancel.DialogResult =
System.Windows.Forms.DialogResult.Cancel;
this.cmdCancel.Location = new System.Drawing.Point(208, 200);
this.cmdCancel.Name = "cmdCancel";
this.cmdCancel.TabIndex = 1;
this.cmdCancel.Text = "Cancel";
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.cmdCancel, this.cmdOK});
this.Name = "Form2";
this.Text = "Form2";
this.ResumeLayout(false);
}
}
}
α.γεεκ Fortune passes everywhere. Duke Leto Atreides
|
|
|
|
|
If you just want to display a message, use
MessageBox.Show("message", "heading").
-or-
Create the form and call it using ShowDialog() instead of Show().
You can have the form return you Yes or No (or Cancel) by setting a value like
like
this.DialogResult = DialogResult.OK
And then the form that called it can retrieve it by:
if(myDialogBox.DialogResult == DialogResult.OK)
{
//code here to act on that.
}
hope that helps
|
|
|
|
|
In C++ the OnIdle() function is available from CView. How can I gain access to it in C# for a Windows based application. A simple application with one form.
thanks
|
|
|
|
|
Subscribe to the System.Windows.Forms.Application.Idle event.
α.γεεκ Fortune passes everywhere. Duke Leto Atreides
|
|
|
|
|
private void Form1_Load(object sender, System.EventArgs e)
{
Application.Idle+= new EventHandler(this.OnIdle);
}
private void OnIdle(object sender, System.EventArgs e)
{
// Spams you with message boxes.
System.Windows.Forms.MessageBox.Show(this, "Idling");
}
|
|
|
|
|
That:
McGahanFL wrote:
// Spams you with message boxes.
...would be my expectation. As I am not a MFC programmer, I do not know what the OnIdle() function does. I was guessing that the Idle event is the equivalent.
The help file for the Idle event states: Occurs when the application finishes processing and is about to enter the idle state. This seems to occur rather frequently.
α.γεεκ Fortune passes everywhere. Duke Leto Atreides
|
|
|
|
|
I would like to create a .NET application using C# language since C# seems good for rapid application development. I would also like to create the GUI using the C# application wizard. (not MFC, or WTL!!!)
How can I use DirectShow AND the Microsoft Speech .NET SDK within the same application? All the DirectShow SDK examples are written in C++. All the .NET speech examples are written in C#. I've read that some people use "wrapper classes" to use C# with C++.
Can I write the bulk of my application in C# and use C++ only for the DirectShow portion of it? Is approach possible as well?
Also, I'd like to "skin" my application, or in the very least give it some "personality" with rounded buttons and some custom controls that I create myself. Can I still use the Win32 API and the "layered" windows feature to skin a GUI created with C#? Is there any other way of creating that "custom" look?
I'm new to this stuff and I'm really confused. What's worse, is that I read all kinds of information about "managed code" and how "...DirectShow does not use managed code.....DirectShow is built upon COM objects.... .NET allows one to mix managed and unmanaged code in the same application..." blah blah blah....it can get very confusing.
All I want is some direction and advice on what to do 1st, 2nd, 3rd... I just don't know where to start... I don't want to read a 400 page book on ATL and COM if I'll be using C# which hides the COM internals... you know what I mean?
|
|
|
|
|
I show you two links in CodeProject about DirectShow in C#. Did you see them?
Mazy
No sig. available now.
|
|
|
|
|
I've seen all the links in CodeProject.... CodeGuru.... DeveloperFusion.... Develop... blah blah blah....there's so many.... enough to confuse me... trust me.... I'm new to this stuff... I need a little direction on what to read....
For example: Can I create a C# forms application, then "wrapper" all the C++ unmanaged Directshow stuff into C# managed code? And also incorporate the speech SDK into the same application.
If the answer is "yes", then how much work am I looking at?
Thanks.
Brian
|
|
|
|
|
Brian JR wrote:
Can I create a C# forms application, then "wrapper" all the C++ unmanaged Directshow stuff into C# managed code? And also incorporate the speech SDK into the same application
Yes you can. You have to write them in a dll and use them in your C# application. I think thats really hard work,but doable. Do you know how to use win32 API in C#? you can use your Dll,the same way as you use win32 API in C#,again there lots of articles about the topic like this one:
http://www.codeproject.com/csharp/c__and_api.asp[^]
Thasts all I can show you because I don't have experience of useing Directshow. Hope it helps.
Mazy
No sig. available now.
|
|
|
|
|
Oh God... you're scaring me...
|
|
|
|
|
OK. I found this type library for DirectShow: Seems like no one else has taken this approach. Do you know why?
http://www.kohsuke.org/dotnet/directshowTypelib/
Does this type library solve my problem of working with DirectShow in .NET? So I can use the type library to do MC++ and C# programming?
Brian
|
|
|
|
|
|
Ahhh... now I think it's starting to make sense! Thank you!
But how do I "derive" a C# class from a Managed C++ class?
"2. You can create GUI in C#, it's easy enough even for beginner. But if you want to create custom controls, I wouldn't advice.
The fastest way is to use controls created by someone or just "skin" your application as it's normally done with multimedia applications.
These "custom" controls - are you talking about ActiveX controls? Where do I get these custom controls? Can I put these custom controls into the C# form that I created?
Could you elaborate on the skinning process? What happens to the C# form I created when I perform the skinning process? Can the C# form and the skinning process co-exist? Also, when I trigger a menu item on my "skinned" application, and a submenu pops up, then how do I process to skin the submenu? That's what I'm confused about.
Any help would be greatly appreciated. Sounds like you are familiar with this process.
Brian
|
|
|
|
|
OK. I found this template library for DirectShow: Seems like no one else has taken this approach. Do you know why?
http://www.kohsuke.org/dotnet/directshowTypelib/
Does this template library solve my problem of working with DirectShow in .NET? So I can use the template library to do MC++ and C# programming?
Brian
|
|
|
|
|
Hello all,
who can tell me how I can Set a Key in a ImageList?
thanks for all answers!
cu
Acid
|
|
|
|
|
Hi,
I'am looking for examples or articles concerning following :
N-tier application :
Data layer -> gives datasets to the business layer
In the business layer we make collections (each row in dataset is an object in the collection).
Business layer and UI works with the collections.
Lets say in the UI we have a grid with all the objects of the collection. In this grid we can add, update and delete (objects in the collection).
What is the best way to go from the collection to the database?
Do I have to mentioned in each object if it is added, updated, deleted or not changed? Also each object have a timestamp to look if there are no changes in the database.
So, al the features of ADO.NET I can't use, because of the collection.
Is there someone who have any idea's?
Thanks in advance,
Vic
|
|
|
|
|
I am trying to get the ClassName of the Opera browser and then read the url from the address bar but I can't seem to get the name of the address bar. What is it? I am using Spy++ and no luck. Other browsers' address bars are typically called "Edit" but not in Opera.
[code]
Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
[/code]
|
|
|
|
|
|
Hi there,
I am havin an enormous amount of c++ comments
/**
blabla
**/
to be translated into xml tags
///<summary>
/// blabla
///</summary>
is there a way to automate this in vs .net 2003
thaks,
stonee
|
|
|
|
|
stonee74 wrote:
is there a way to automate this in vs .net 2003
Macros.
ORACLE One Real A$#h%le Called Lary Ellison
|
|
|
|
|
You could do it with macros, but I don't think I would. I'd be more likely to write a C# program that opened the file and used regex to do the replacements. I'd use a regex something like:
Regex regex = new Regex(@"
/\*\* # start of comment
\s+
(?<comment> # capture to named Comment
.+?\s+ # comment text
) # end of capture
\s+
\*\*/ # end of comment.",
RegexOptions.Singleline |
RegexOptions.IgnorePatternWhitespace);
and then use a MatchEvaluator function like:
static public string Evaluator(Match match) {
string[] lines = match.Groups["Comment"].Value.Split('\n');
for (int i = 0; i < lines.Count; i++)
lines[i] = "///" + lines[i];
return String.Join("\n", lines);
}
|
|
|
|
|
If you put a WebBrowser control in a Form, and then put that Form inside another Form (set it's Parent to the other form and set TopLevel to false, which is perfectly legal according to the docs), then when you quit your application (close the outer Form), it will stay resident in memory and eat up 100% of CPU time. (You can see it doing this in the Task Manager). This is probably caused by that OLEinPlace stuff somehow but I don't know OLE so that's totally a guess.
This is a HUGE problem for me. MASSIVE!!
"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
-Groucho Marx
|
|
|
|