Error occur when pressing delete key to clear the date value of the datetimepicker control


Error occur when pressing delete key to clear the date value of the...
Author
Message
Jeff Pagley
Jeff Pagley
StrataFrame User (467 reputation)StrataFrame User (467 reputation)StrataFrame User (467 reputation)StrataFrame User (467 reputation)StrataFrame User (467 reputation)StrataFrame User (467 reputation)StrataFrame User (467 reputation)StrataFrame User (467 reputation)StrataFrame User (467 reputation)
Group: StrataFrame Users
Posts: 223, Visits: 893
Hi Strataframe Team,

After I upgraded to the 1.6.5, I get the error below when I press the delete key to clear the date value of the datetimepicker control which is bound to a date field of a business object.   Although I get this error, the database is being updated properly.  Why is this error is occurring?

=======================================================================

Object reference not set to an instance of an object.
  Exception (NullReferenceException): Source="MicroFour StrataFrame UI"; Target=null; Tag=null;
    Message = "Object reference not set to an instance of an object."
  Environment: ThreadIdentity="" DateTime=["2008-04-29 16:31:15.908"] ThreadName=null WindowsIdentity="STRUSS\JPagley" ThreadId="10" DomainName="CMPR.vshost.exe" OSVersion=["Microsoft Windows NT 5.1.2600 Service Pack 2"] MachineName="1LPJPAGLEY"
    UserName="JPagley"
  Remaining Stack Trace  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    at MicroFour.StrataFrame.UI.Windows.Forms.DateTimePicker.CreateManualCaret()
    at MicroFour.StrataFrame.UI.Windows.Forms.DateTimePicker.OnGotFocus(EventArgs e)
    at System.Windows.Forms.Control.WmSetFocus(Message& m)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.DateTimePicker.WndProc(Message& m)
    at System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m)
    at System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m)
    at System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Replies
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
A lot of logic was added to the DateTimePicker in 1.6.5 to make entry available while "cleared."  It looks like you are having an API issue.  We call the Windows API to create a Caret and display it within the control...it would appear that your environment doesn't like this API call.  You can open the source and comment out this line (CreateManualCaret) to see if the error persists since this is where your stack trace stops.
Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Trent,

FYI, I also got this one.  I am running Windows Vista 64.  I have not tried your solution since I really don't know how to build the dll from the source code without messing the current SF installation.

NullReferenceException
  Object reference not set to an instance of an object.

Source     : MicroFour StrataFrame UI

Stack Trace:
   at MicroFour.StrataFrame.UI.Windows.Forms.DateTimePicker.CreateManualCaret()
   at MicroFour.StrataFrame.UI.Windows.Forms.DateTimePicker.OnGotFocus(EventArgs e)
   at System.Windows.Forms.Control.WmSetFocus(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.DateTimePicker.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m)
   at System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)



Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
V64 doesn't make any difference.  I haven't had any luck with the issue that you are running into...however I did find something that I had to fix BigGrin  Give me a quick sample that reproduces the issue so I know that the properties are set the same....sometimes it is just a matter of setting up the test bed the same.  Thanks.
Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Trent,

Here is a 2 for 1 quick sample project Hehe

You will find 2 forms, one for testing the datetime picker problem when you try to delete its value and the other will show you the problem with the ListView Add button which will always stay Enabled when there is not parent record.



Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
I saw something that could produce an error within certain environments.  Give this assembly a shot...I think that it will resolve your problems.  It had to do with how the API interprets bitmaps and the integer pointer.

Note: You will need to be on the 1.6.6 beta in order for this assembly to properly work.

Attachments
MicroFourStrataFrameUI.zip (95 views, 743.00 KB)
Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Trent L. Taylor (04/30/2008)
I saw something that could produce an error within certain environments.  Give this assembly a shot...I think that it will resolve your problems.  It had to do with how the API interprets bitmaps and the integer pointer.

Note: You will need to be on the 1.6.6 beta in order for this assembly to properly work.

Hi Trent,

Yes, this assembly fixed the datetimepicker delete value problem.

Thanks.

P.S.

Where you able to test the 2nd form for the ListView issue? even thought it does not belong to this thread Smile

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Look here: http://forum.strataframe.net/FindPost16017.aspx

I didn't run your sample as I already knew what you were trying to accomplish, so I haven't even tested it at this point.  But you can load the assembly and see if you get what you want.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search