|
Hi all,
did anybody experience problems after installing .NET 1.1 SP1?
First thing I noticed is that the text of goupboxes that are in an other groupbox is messed up(seems like the wrong font), when using visual styles.
The other thing is that I now get weird exceptions from the Windows.forms stuff, e.g.
Error creating window handle. at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
or
Object reference not set to an instance of an object. at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
or
Object reference not set to an instance of an object. at System.Windows.Forms.WndProc.Invoke(IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
Does anybody have similar problems?
This ServicePack really sucks!!!
Best Regards
-------------------------------------------
The light at the end of the tunnel has been switched off temporarily due to budget problems...
|
|
|
|
|
I haven't had any problems with it.
You didn't mention when you installed it, so forgive me for the is-it-plugged-in level question, but have you restarted your computer? Installing the service pack and running a .NET app without restarting first can cause all sorts of obscure exceptions in the framework.
Charlie
if(!curlies){ return; }
|
|
|
|
|
Haven't had any problems like your having. Actually, I haven't had any problems at all! It's actually fixed a couple of problems that I ran into with the Garbage Collector and VERY large object allocation.
Are you overriding WndProc in your app? What are you doing in your override?
What are you doing in the Load event of your Form? Also, are you checking to see if your controls actually have handles before doing anything with the handles?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
These problems occur on different computers. But they only appear if you install the .NET ServicePack.
For e.g. the "Error creating window handle" message occurs sometimes when my form calls the ShowDialog method.
But why should there be a problem now. It works fine if the ServicePack is not installed!
Well, ProjectManagement decided that our Software won't officially support the .NET Service Pack...
Best Regards
-------------------------------------------
The light at the end of the tunnel has been switched off temporarily due to budget problems...
|
|
|
|
|
i want to make a panel slide like the .net toolbars? can ne 1 give me some great looking code;) thanks?
|
|
|
|
|
i've implemented this by using Timers
Basically, the idea is something like this:
- Event is fired (Button click lets say)
- Start Timer
- On timer tick, resize/move control
- Once control reaches appropriate size stop timer
You can tweak the speed of your timer intervals to get a decent animation going.
I am sure there is a better way to do this using DirectX.
Jon G
www.Gizmocoder.com
|
|
|
|
|
Hi there, i have a trie to invoke a method via reflection from Events.dll (the method that tries to create an instant of the class containing the method also resides in Events.dll)
invoking method is :
private void execute(string actionname,string[] parameters){
Assembly a = Assembly.LoadFrom("Events.dll");
Type[] ts = a.GetTypes();
Type t=a.GetType("IOW.NET.Events.StartProgram");
MethodInfo runmethod = t.GetMethod("run");
object obj=Activator.CreateInstance(t);
runmethod.Invoke(obj,parameters);
}
Class StartProgram looks like this:
namespace IOW.NET.Events
{
public class StartProgram: Event
{
public StartProgram(){}
public void run(object[] parameters)
{
//do something
}
}
}
My Programs interrupts working when i call
runmethod.Invoke(obj,parameters);
any ideas where the error is? i just can´t find it.
Events.dll is in the right directory, otherwise it would give me an error when i load the assembly from file.
i can also read all types from the Assembly-object without problems.
thanks for any hints
best regards
jkersch
|
|
|
|
|
jkersch wrote:
any ideas where the error is? i just can´t find it.
I would suggest you put a check for null values along the way. Also, in particular, there is a overloaded method for creating a MethodInfo object that allows you to specify the BindingFlags via a bit mask, that could be your problem.
- Nick Parker My Blog | My Articles
|
|
|
|
|
What Nick said is the solution to the most likely problem. If run is not public, then you must use the overload with BindingFlags.NonPublic . If it's a static method, then you have to include BindingFlags.Static (perform a bitwise OR with flags). Using just GetMethod(string) uses BindingFlags.Public | BindingFlags.Instance .
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
i finally found the error.
my (public) run-method wanted to have object[] Myparameters as argument.
i wanted to invoke it with methodobject.invoke(classobject,object[] MyParameters).
i wrapped the object[]-array my method uses in a second object[] array
i.e. methodobject.invoke(classobject,new object[]{object[] MyParameters});
and it worked out of the box,
thank´s a lot nevertheless,
jkersch
|
|
|
|
|
Hello
I have a problem with the following code. It gives an error saying that the OleDb could not be found. I have included using System.OleDb at the top of my form. But still get the error.
[code=vb]
cnnTeacher.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\IBS Library System\LibrarySystem.mdb;Persist Security Info=False";
OleDbCommand cmdTeacher = cnnTeacher.CreateCommand();
cmdTeacher.CommandText = "Select * From Teacher Where TeacherID = txtIDNumber.text";
cmdTeacher.Parameters.Add("ID", OleDb.VarWChar, 40).Value = txtIDNumber.Text; //OleDb could not be found
OleDbDataAdapter daTeacher = new OleDbDataAdapter(cmdTeacher);
OleDbCommandBuilder cbTeacher = new OleDbCommandBuilder(daTeacher);
daTeacher.Fill(dtTeacher);
[/code]
Many thanks in advance,
Steve
|
|
|
|
|
I have just spent the last month fighting with OleDb, so you have my sympathy!
1) Have you tried "using System.Data.OleDb;" instead of "System.OleDb"? (If you're using VB.NET, doesn't it use the term "Imports" instead of "using"?)
2) Make sure the driver (in your case the MS Jet OleDb driver dll) has been installed on your system.
3) I have read that if you use a DataAdapter you do not need to do an explicit open on the connection (i.e. cnnTeacher.Open()), but if all else fails, I would give it a try.
Hope this helps!
|
|
|
|
|
Thanks for your help
I am using:
using System.Data.OleDb;
Opening the connection is not a problem.
But l am not sure about this OleDb driver dll, how would l know that I have it installed on my computer.
I hope you can help.
Thanks,
Steve
|
|
|
|
|
To determine if a driver is installed on your system, go to:
Control Panel,
Administrative Tools,
Data Sources (ODBC),
Select the "Drivers" tab.
If the driver is not listed, your best bet would be to download
and register the driver from Microsoft's site.
But, I think the problem could be punctuation ... there needs to be a semi-colon (";") on the inside of the ending quote mark of the connection string (as well as one outside the quote mark to end the command line). For example:
sConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=databaseName;";
If you are still having trouble, I would look at the "OleDb.VarWChar" variable in the Parameters statement where the error is occurring. I have not dealt with parameters, but I might hazard a guess that the the OleDb needs to be qualified (i.e. System.Data.OleDb.OleDbType.VarWChar). I have had items come up in intellisense, but did not run until qualified.
Hope this helps!
|
|
|
|
|
Hello,
Thanks for your help. I managed to find the answer. I don't need the line to add parameters. So l deleted it and made a few changes and now it works fine. Below is the correct code for your own review.
cnnTeacher.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\IBS Library System\LibrarySystem.mdb;Persist Security Info=False";<br />
OleDbCommand cmdTeacher = cnnTeacher.CreateCommand();<br />
cmdTeacher.CommandText = "Select * From Teacher Where TeacherID = '" + txtIDNumber.Text + "' ";<br />
<br />
OleDbDataAdapter daTeacher = new OleDbDataAdapter(cmdTeacher);<br />
OleDbCommandBuilder cbTeacher = new OleDbCommandBuilder(daTeacher);<br />
<br />
daTeacher.Fill(dtTeacher)
steve
|
|
|
|
|
Hi,
As a newbie, I was interested to read this article about creating a User Control.
support.microsoft.com/default.aspx?scid=kb;EN-US;323116
I copied the code from the webpage, compiled the user control code into a DLL, compiled the sample client application, and the progress bar worked fine.
I then started to tinker with it, and I found that my code did not work in all situations. I found that although the provided sample code drew the Progress Bar OK in the timer1Tick event handler, my button2Click event handler needed to call the Refresh method of the User Control. Without the refresh, the progress bar would not move at all until the "for" loop had finished, when it simply filled the whole bar. There was no progress at all, let alone smooth progress
The code I added to the sample on the MS site is below. Anyone know why this does not work without the Refresh? I'm guessing that maybe it's do do with the fact that in the supplied code, the Value is incremented once per event, whereas in my code, the increment from 1 to 100 is all in one event, and the repaint only occurs when the event handler completes. As I say, that's only a guess though.
Thanks in advance for any enlightenment.
Gary.
Here are the two Event Handlers.
void button2Click(object sender, System.EventArgs e)
{
for ( int i = 0; i <= 100; i++)
{
this.userControl12.Value = i;
// WHY DOES THIS NEED A REFRESH???
this.userControl12.Refresh();
}
}
void timer1Tick( object sender, EventArgs e )
{
if (this.userControl11.Value <= 100)
{
this.userControl11.Value++;
// BUT THIS DOESN'T???
}
else
{
this.timer1.Enabled = false;
}
}
|
|
|
|
|
|
This has to do with when Windows decides to repaint your form. Windows does not repaint until your application is idle. You have seen this before with programs that do heavy processing. Have you ever used a program and all the graphics went to a white screen, and you end up having to wait a few seconds to get the graphics back? That's the same principle. Here you are forcing the graphics to refresh on your own, without waiting for it to be called automatically by Windows. If you take out the refresh,then when you exit the button2click function, Windows calls a refresh automatically on your usercontrol, but by then the value is 100. So what you see is the progress bar at 100.
|
|
|
|
|
Hi,
I have a little problem when I am trying to use the SoapClient class from WSE 2.0 sp 1. I have to write a .NET application that must access some webservices written in Perl. I respect with the MS QuickStart samples the code that I wrote look like this:
Uri destUri = new Uri(http://82.77.28.243/site/arl/soap.tr/arac/tkn.ars);
ADotNetClient client = new ADotNetClient(destUri);
where:
[SoapService("http://schemas.company.net/arl/soap.tr/arac")]
public class ADotNetClient : SoapClient
{
public LoginClient(Uri to) : base(to)
{
}
[SoapMethod("http://schemas.company.net/arl/soap.tr/arac/tkn")]
public SoapEnvelope LoginSoap(SoapEnvelope envelope)
{
return base.SendRequestResponse("http://schemas.company.net/arl/soap.tr/arac/tkn#Get", envelope);
}
}
When a try to call LoginSoap I receive an error. Trying to solve the problem I traced the message which sent to the PerlWebServer and I found somehow the problem which appear to be in the HTTP header. Normally the first line of the http header should lool like this:
POST /vonc/arl/soap.tr/arac/tkn HTTP/1.1
but in my case look like this:
POST http://82.77.28.243/vonc/arl/soap.tr/arac/tkn HTTP/1.1
Pls explain to my why appear this and how can possibly solve the problem.
|
|
|
|
|
i would ask u 1 question in every tutorial has properties i see the get and set methods then in set it says MyString =
value ; in any tutorial it is value so what it means and is it a default one?
|
|
|
|
|
value is the implicit parameter used in setting accessors and to add or remove event handlers.
www.troschuetz.de
|
|
|
|
|
It lets you easily define access functions for a variable
In C++ you'd have something like
private:
int myint;
public:
int myint_get()
{
return myint;
}
void myint_set(int newval)
{
if( do some kind of check to make sure the value is valid )
{
myint = newval;
do any processing that has to happen if myint changes
}
}
so in the main code, if you want to increment the value of myint you'd have to do something like obj.myint_set(obj.myint_get()+1); which is somewhat messy
In C# access functions are made much tidier, like so
private int myint;
public int MyInt
{
get
{
return myint;
}
set
{
if( do some kind of check to make sure the value is valid )
{
myint = value;
do any processing that has to happen if myint changes
}
}
}
in other words, to answer your question value is whatever gets passed into the set function, i.e. obj.MyInt = 42; --then value would be 42
this lets you do stuff like obj.MyInt++; and treat it as if you'd just declared a public variable in the first place (without any of the worry about messing up your value)
You can make a read only variable by omitting the set{} part, or make it write only by omitting the get{} part if you so desire
NOTE: This code was just written off the top of my head - it's not expected to actually compile
--
Help me! I'm turning into a grapefruit!
Phoenix Paint - back from DPaint's ashes!
|
|
|
|
|
I just wanted to include that if you look at any property that is generated with a setter method, the parameter name of the variable is always generated as value . For example, if you look at the InnerXml property of the XmlElement class (randomly chosen) you will see the following:
public override void set_InnerXml(string value)
{
this.RemoveAllChildren();
XmlLoader loader1 = new XmlLoader();
loader1.LoadInnerXmlElement(this, value);
}
With this logic you will see that the properties in C# simply generate getter and setter method with method signatures like set_[PropertyName] and get_[PropertyName].
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hı, My name is sait. I have a problem for this Registry and Eventlog.
in this way, now I haven't logon administration. but I want to while not have an admin to know write and Read to Registry and Eventlog file? Do you understant me? sorry I little speak and write english!
thank you very much... I wait to your answer...
Good evening...
|
|
|
|
|
You can read and write to certain areas of the eventlog and registry even if you are not logged in as an administrator.
For registry you can always read and write to HKEY-CURRENT-USER.
With the event log only administrators have access to the Security Log.
Does this help a little?
|
|
|
|