|
Several people at work have done .NET courses. My advice - buy Programming the .NET Framework, Inside C#, and the ADO.NET and ASP.NET books from Microsoft. You'll learn more and it will cost less.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
I am unsuccessful in inheriting from this class. ControlBindingsCollection inherits from it and it has protected internal members implying it was designed to be inherited from. Yet, the compiler says there is no access to the constructor and the object browser does not show a constructor.
Alan
|
|
|
|
|
Shawn Wildermuth *just* answered your question, but I'll repost it here for those not on the DOTNET-WINFORMS[^] mailing list.
"The constructor is marked internal...that's how the ControlBindingsCollection inherits from it."
James
- out of order -
|
|
|
|
|
How do I determine when to stop reading from the response stream on a webrequest? It seems that if I do
while (bytesread > 0)
bytesread = bufferedrdr.Read(buffer, 0, buffer.Length);
I'll get incomplete files. Looks like the stream returns 0 bytes read whenever the internet connection lags. Most of the example code does use a 0/-1 return code to determine when to stop reading.
The read method doesn't wait until there is new data in the stream does it? Confused as to how to determine when the end of the file is downloaded.
|
|
|
|
|
It uses an asynchronous callback system. More info here[^].
Back to real work : D-21.
|
|
|
|
|
Is there any adavantage of using begininvoke/endinvoke? I already have each download running in a seperate thread.
|
|
|
|
|
Anonymous wrote:
Is there any adavantage of using begininvoke/endinvoke?
I am afraid not since that's what is done already. By the way, you should also know that the underlying connection is multi-threaded too (with an upperbound I can't remember at the moment).
I believe the only way to cope with the problem you are facing is to write your own httpweb request stuff. The funny thing is the http web request itself is bad only because it doesn't provide configuration capabilities over the underlying connection. There is a lot of application logic underneath.
Which is equivalent to say the people at MS who created it thought developers were ready to do web requesting on a fire and forget basis. That's a stupid assumption of course...
Back to real work : D-21.
|
|
|
|
|
Ok, thanks everyone, but I have one more question.
To gett callback of my modal dialog I use this code:
ModalDlgClass myDlg = new ModalDlgClass();
if(myDlg.ShowDialog() == DialogResult.OK)
{
//Do smf.
}
But in the modal dialog there is a small problem ...
I need to check something before close it.
if(textBox1.Text.Length == 0)
{
//cheking and need returf focus to modal dialog
}
else
{
//do smf else, then
this.Close(); // I need 2 close it ONLY if textBox1 is not emty
}
But if my textBox1 is empty after checking modal dialog is closing ... is there any way not to close it?
thanks
=====================
http://wasp.elcat.kg
|
|
|
|
|
Hello, the codegurus around the world.;)
If you work for MFC, you will figure it out.
Maybe, you just declare MyDialog_OnClose message method, and filter
the textbox input.
And, if there is no input, just return before the base class Close is called.
Just put "return".
I believe that this works.
Please, don't send me your email about your questions directly.
Have a nice day!
Sonork - 100.10571:vcdeveloper
-Masaaki Onishi-
|
|
|
|
|
I deed, but it, not working.
I have modal dialog. And it's closing even if i put 'return'.
Maybe it is becourse I click on button with 'OK' dialog properties?
But is it only way to get response from my Modal dialog?
=====================
http://wasp.elcat.kg
|
|
|
|
|
Hello, the codegurus around the world.;)
Oooops, you're right because I got the same result.
So, I asked "HELP" of VC#.
1) Use DialogResult.NONE
protected void btnOK_Click (object sender, System.EventArgs e)
{
strMessage = txtMessage.Text;
if(strMessage == "")
{
MessageBox.Show(this, "Error");
DialogResult = DialogResult.None;
}
}
2) Disable OK button if TextBox is empty
private void Msg_TextChanged(object sender, System.EventArgs e)
{
if(txtMessage.Text == "")
btnOK.Enabled = false;
else
btnOK.Enabled = true;
}
Please, don't send me your email about your questions directly.
Have a nice day!
Sonork - 100.10571:vcdeveloper
-Masaaki Onishi-
|
|
|
|
|
Yah!!! thanks,
Nice idea to lock button till text is empty!
=====================
http://wasp.elcat.kg
|
|
|
|
|
I had to do this in VB.NET. What I did was I didn't "HardCode" the "Dialog Result Codes" into my Command Buttons. When the User clicked the "Login" Button of my Form, I would Validate the Login info, if it was Correct, I would just Type "Return DialogResult.OK", otherwise I would not return anything.
|
|
|
|
|
Hi I'm havinh real trouble using this one OpenGL function I'm trying to import into my app. The C function is declared as this:-
void gluTessCallback(GLUtesselator* obj, GLenum type, void(*fn)());
I know that GLUtesselator* is basically just an IntPtr, as I've imported other functions with it in, and they've worked fine. Similarly, GLenum is just a UInt. But what do I do with the void function pointer?
I have declared delegates for all of the possible function types it could be, (depending on the 'type' variable), but I don't know where to go from there.
MSDN only has info for function pointers that are always a set type, but with this function, the pointer can be to a number of different types of function.
Please help me out here!
Thanks in advance
Dave
Dave Kerr
focus_business@hotmail.com
www.focus.esmartweb.com
|
|
|
|
|
Dave Kerr wrote:
declared as this:-
void gluTessCallback(GLUtesselator* obj, GLenum type, void(*fn)());
....
I don't know where to go from there.
Is C# really that much different from C++??
GLUtesselator* gPtr =...;
GLenum gType =...;
void(* gFuncPtr )(void);
gFuncPtr = ...;
gluTessCallback(gPtr, gType, gFuncPtr);
wont compile under C#??
|
|
|
|
|
Did you give a look at this[^] ?
To ease the marshaller's job, you may also add this attribute : [MarshalAs(UnmanagedType.FunctionPtr)]
Back to real work : D-21.
|
|
|
|
|
is it possible to build an MDI application in C#, especially using VS.NET?
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
You've got a MDI sample written in C# in your .NET framework samples : SDK\Samples\Quickstart\Winforms\samples\mdi.
Back to real work : D-21.
|
|
|
|
|
|
If you go to http://www.csharp.net, in the 'Code' section there's a library that I think does this. IIRC, it's called Genghis.
|
|
|
|
|
Hi, Does anyone know here how to make a file with C# that has a wrong size. Say 10TB, but a single file that actually only takes a few bytes on the drive?
Thanks
K.D.
|
|
|
|
|
You can see if a file or directory is a Sparse File[^] in c# by examining the file attributes.
Using win32 and unmanaged code, you'd mark a file / dir as sparse using DeviceIoControl passing in FSCTL_SET_SPARSE as the i/o control mode, that is, after you've confirmed the file system supports sparse files. FSCTL_SET_SPARSE[^].
There doesn't appear to be a managed version.
|
|
|
|
|
I have been reading alot about C# determinism, and most of the literature addresses destructors. I understand that the garbage collection is now responsible for calling the class destructor, and the GC is undeterministic. I have read recommendations to implement IDispose and have the client call Dispose(), but what about client server architectures. If I have one C# server connected to multiple clients, which client calls Dispose()? Isn't this why reference counting was invented?
My biggest concern is whether or not my C# server will contain a message pump - someone alluded earlier that it will. Anyone who has created a COM STA server will know that message pumps make your code slow and VERY undeterministic. How to you create a message pump free C# server (something equivilent to a MTA server in COM)?
Thanks,
Aaron
|
|
|
|
|
I created a Windows Application project in C#.
I created a number of forms that are inherited forms.
If I keep the original form in the project, I can only set that form as the Startup object, and it goes without saying that if I remove it, I cannot set anything to the Startup object. (compile says myNamespace.formname does not exist if I manually enter the inherited form name)
Why can't I set an inherited form as a Startup object and how do I get around this???? Even if I add a normal form (not inherited) after my inherited forms it does not allow me to set even that normal form now. In fact, I get no dropdown box in the StartObject property of the project!!!!!
_____________________________________________
I have a tendancy to where my mind on my sleeve I have a habit of losing my shirt...
|
|
|
|
|
Never mind. I found my problem....I have to add the following section to my code manually:
<br />
[STAThread]<br />
static void Main() <br />
{<br />
Application.Run(new myForm());<br />
}<br />
_____________________________________________
I have a tendancy to where my mind on my sleeve I have a habit of losing my shirt...
|
|
|
|