Error occur when pressing delete key to clear the date value of the datetimepicker control
 
Home My Account Forum Try It! Buy It!
About Contact Us Site Map
StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Error occur when pressing delete key to clear...Expand / Collapse
Author
Message
Posted 04/29/2008 3:47:17 PM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: StrataFrame Users
Last Login: 05/01/2008 12:27:38 PM
Posts: 35, Visits: 74
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)

Post #15994
Posted 04/29/2008 4:05:29 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 1:38:37 PM
Posts: 3,775, Visits: 3,950
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.
Post #15997
Posted 04/29/2008 9:19:35 PM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Today @ 2:40:45 PM
Posts: 305, Visits: 1,197
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
Progytech (Computer Consultants)
Post #16010
Posted 04/29/2008 10:32:51 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 1:38:37 PM
Posts: 3,775, Visits: 3,950
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   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.
Post #16014
Posted 04/30/2008 8:14:30 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Today @ 2:40:45 PM
Posts: 305, Visits: 1,197
Hi Trent,

Here is a 2 for 1 quick sample project

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
Progytech (Computer Consultants)


  Post Attachments 
ClearCalendarValueTest_And_ListViewAddButtonEnabledTest.zip (2 views, 791.53 KB)
Post #16015
Posted 04/30/2008 9:40:42 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 1:38:37 PM
Posts: 3,775, Visits: 3,950
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.

  Post Attachments 
MicroFourStrataFrameUI.zip (2 views, 743.52 KB)

Post #16016
Posted 04/30/2008 9:59:08 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Today @ 2:40:45 PM
Posts: 305, Visits: 1,197
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

Edhy Rijo
Progytech (Computer Consultants)
Post #16018
Posted 04/30/2008 10:01:03 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 1:38:37 PM
Posts: 3,775, Visits: 3,950
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.

Post #16019