Plugin Area crashing on Windows

View: New views
3 Messages — Rating Filter:   Alert me  

Plugin Area crashing on Windows

by Jon Thelin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have an old Plugin Area that was built with the 4D 2004 SDK and then compiled using Visual Studio 2005 on windows.  It runs in compatability mode in 4D v11.

When I open a form with the plugin area on it and attempt to pass values to the plugin (for drawing) from code, it crashes. with this error:  "Unhandled exception on 0x0f08245b in 4D.exe.  0xC0000005: Access violation reading location 0x00000000."

When I drop into the visual studio debugger, it stops here:

   void * __cdecl _malloc_base (size_t size)
   {
       void *res = NULL;

       //  validate size
       if (size <= _HEAP_MAXREQ) {
           for (;;) {

               //  allocate memory block
stops here===>    res = _heap_alloc(size);

               //  if successful allocation, return pointer to memory
               //  if new handling turned off altogether, return NULL

I have determined that the crash only occurs if the 4D process that opens the form is a new process.  It works ok in the Main process.  The macintosh version of the plugin area functions properly whether or not it is the main process or a new process.

Has something changed on the Windows side of 4D v11 that causes old Plugin Areas running in compatability mode to crash in new processes in 4D?

Jon Thelin

Re: Plugin Area crashing on Windows

by Jon Thelin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


> I have determined that the crash only occurs if the 4D process that opens the form
> is a new process.  It works ok in the Main process.  The macintosh version of the
> plugin area functions properly whether or not it is the main process or a new process.
>
> Has something changed on the Windows side of 4D v11 that causes old Plugin Areas
> running in compatability mode to crash in new processes in 4D?

I think I have determined what is causing the problem.  I am making a plugin call to perform some setup of the plugin area in the 'On Load' phase of the form event.  Normally, this works fine.  However, in 4D v11.4 under Windows, the eAE_InitArea event in the plugin is not being called before the 'On Load' form event!  So the plugin area has not done any of it's initialization that is needed before my setup call in the On Load form event.  My workaround for now is to move my setup call of the plugin to the On Activate form event (and flag it to only run the first time an On Activate event occurs).  This may be only happening with Plugin Areas running in Compatability mode.  I don't have a new 3rd party plugin to test with.

Jon Thelin




4D Plug-in SDK is Now Open Source

by Francois Marchal :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

To the delight of 4D plug-in developers in the audience and beyond,
Christophe Keromen announced during the Welcome keynote at 4D Summit
2009 the open source availability of 4D Plug-in SDK.


"Now, sources will be publicly hosted at sources.4d.com," said Keromen.
"All the documentation will be available there. And all of the source
code will be available through Subversion Client. You can use free
clients like Tortoise on Windows and svnX on Mac OS X."


You may see a video of the entire announcement at:
http://vimeo.com/7393991


Sources are hosted at: http://sources.4d.com and Subversion access URLs
are provided at the same location.
The site provides a Wiki, submission guidelines, and of course, access
to the source, at http://sources.4d.com/trac/4d_4dpluginapi/browser

Discussions take place on the existing 4D Plug-in Mailing List 4D
Plug-in Mailing List at http://old.nabble.com/4D-Plug-Ins-f15655.html

4D Plug-in SDK is distributed under the MIT (X11) license.

**********************************************************************
4D Plugins hosted by 4D, Inc.                      http://www.4D.com/

    Register for 4D Summit 2009 Today
    http://www.4D.com/summit

To Unsubscribe:                      mailto:4D-Plugins-off@...
***********************************************************************