Jump to content
Sign in to follow this  
RTollison

Calling a dll to display a calendar BUT need to stop processing windows messages

Recommended Posts

i have a calendar dll that pops up on the center of the form where it is called from. works fine but there is an issue. the calendar control is from TMS Software and i have worked with them but the issue doesn't happen to them. on the calendar control there are navigation buttons at the top of the control (previous year, previous month, next month and next year. The calendar is set to popup center of form (long story best solution) so if a developer of the application form put a button in a select spot on their form when calling the dll to popup the calendar IF the MOUSE is OVER any of the prev, next buttons i get an memory access violation, click ok and the calendar works great. move along. since that window are is limited if the user, say clicks the bottom right of a button then no error. But if they click the middle then the error pops up. So i know it has something to do with probably trying to get/display the Hints (my guess). i have sent a sample project to TMS and they don't get the error. so they sent me back the compiled project and I also don't get the error. Made sure that we are on the same version and we are. 

Now my question is this, is the a way to stop the processing of the hint while the control/form is being created.

First thing the dll does is

    frmCalendar := TfrmCalendar.Create(nil);

is there a way to stop hint message, create the control then enable hint messages?

Share this post


Link to post

I managed to modify the source for the plannercalendar control and commented out the offending code without affecting the control (on the surface) but it is working within my code and it suits my purposes.

have tested in multiple projects with the plannercalendar and it is working fine everywhere that i use it.

 

Thanks.

Share this post


Link to post

Could be anything. Could be that you are splitting a vcl app between an exe and a dll. Sounds like you haven't diagnosed the problem yet. That's what I would try to do first rather than trial and error ideas like you are asking us for help with. 

Share this post


Link to post

We had a similar error with TMS TPlannerCalendar: The TMS code had an assumption, that mouse events are always processed after the paint message (where FCanvas was set). But this did not always hold true, eg if the control was created invisible.

 

Our workaround was to force a call to Paint in FormCreate of the form holding the planner control:

 

procedure WorkaroundPlannerCalendarCanvasAccessViolation(ACalendar: TPlannerCalendar);
begin
    ACalendar.BeginUpdate;  
    TPlannerCalendarCracker(ACalendar).Paint();  //forces initialization of TPlannerCalendar.FCanvas
    ACalendar.EndUpdate;
end;

 

Edited by yonojoy
spelling

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×