Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - Event resize AccessViolationException
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Event resize AccessViolationException

 Post Reply Post Reply
Author
Message
WaaZ View Drop Down
Senior Member
Senior Member


Joined: 31 January 2006
Location: United Kingdom
Status: Offline
Points: 103
Post Options Post Options   Thanks (0) Thanks(0)   Quote WaaZ Quote  Post ReplyReply Direct Link To This Post Topic: Event resize AccessViolationException
    Posted: 22 February 2006 at 10:50am

Hi,

I am having a problem when I resize an event, an AccessViolationException is raised and is unhandled. I am using C# and I really cannot find out which statement is raising this since it does not crash on any of my written codes.

I have implemented EventChanged and before_edit in the code.

Thanks

WaaZ

Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 23 February 2006 at 9:32am
Hi,

Please try to localize a problem.
 
For that you can comment EventChanged and before_edit.
If a problem went out - uncomment some piece of code and test again.
Using this way you can localize it.
May be a problem is not in those handlers, remember what have you changed before it appeared.
 
Also can you send me the code of your EventChanged and before_edit handlers to analyze.

--
WBR,
Serge
Back to Top
WaaZ View Drop Down
Senior Member
Senior Member


Joined: 31 January 2006
Location: United Kingdom
Status: Offline
Points: 103
Post Options Post Options   Thanks (0) Thanks(0)   Quote WaaZ Quote  Post ReplyReply Direct Link To This Post Posted: 08 March 2006 at 12:02pm

Is it possible that if the beforeEditOperation trigger and the EventChanged one cause the accessviolation trigger because some objects are locked.

The two mentionned triggers have some quite complex implementations for me. The EventChanged for instance has operations that do take a lot of time because of network and database operations that need to be completed.

is it possible that if I make changes very quickly.. changes like dragMove and drag_resize that the triggers are called so quickly that an access violation problem is raised? ... maybe because they are trying to reach an object simultaneously

Back to Top
WaaZ View Drop Down
Senior Member
Senior Member


Joined: 31 January 2006
Location: United Kingdom
Status: Offline
Points: 103
Post Options Post Options   Thanks (0) Thanks(0)   Quote WaaZ Quote  Post ReplyReply Direct Link To This Post Posted: 08 March 2006 at 12:27pm

the code crash because of this line on the AccessViolationException:

Application.DoEvents();

quite strange..

Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 09 March 2006 at 7:09am
Hi,

EventChanged is fired only once for one dragging operation - in its finish to commit changes.
 
BeforeEditOperation is fired for each mouse move for dragging(/resize) operation.
It is called from OnMouseMove window message handler.
 
When you call DoEvents inside BeforeEditOperation, window messages are processed from the message queue and you can enter into OnMouseMove method again and into BeforeEditOperation and again call DoEvents.
 
The call stack is like:
    ...
    DoEvents
    BeforeEditOperation

    OnMouseMove
    DoEvents
    BeforeEditOperation
    OnMouseMove //- initial message
 
I am not sure how DoEvents process messages but you may have stack overflow.
Please check whether is it true or not.
 
Other problem is that CalendarControl::OnMouseMove is not re-enterable.
Each call of OnMouseMove may change dragging context and when we return from subsequent call of BeforeEditOperation the context may be unexpectedly changed. For example we perform dragging but inside BeforeEditOperation OnLButtonUp was processed and the dragging was finished.
 
We do not expect such situation and I am not sure that this is a good way to make OnMouseMove as re-enterable.
 
Do you really need to call DoEvents from BeforeEditOperation each time?
Is it possible to cache some your data once when dragging started? (and so far call DoEvents only once for an operation).
See also IsEditOperationDisabled which is called before dragging started.
 
To avoid such re-entering sometimes one can use a short timer (10-100 ms). I mean that some handler set the request using timer and in the OnTimer I can perform some actions which were not allowed or just not fine inside that handler. I am not sure can this help you or not, but just in case....
 
If the information above was not helpful, please send more details about your logic for EventChanged and BeforeEditOperation methods.

--
WBR,
Serge
Back to Top
WaaZ View Drop Down
Senior Member
Senior Member


Joined: 31 January 2006
Location: United Kingdom
Status: Offline
Points: 103
Post Options Post Options   Thanks (0) Thanks(0)   Quote WaaZ Quote  Post ReplyReply Direct Link To This Post Posted: 13 March 2006 at 9:46am

This is caused, in fact, by Application.doevents() in C#. There may be some concurency control which is going wrong, if multithreading is being used by the activex control.

Thnks

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.250 seconds.