POV-Ray : Newsgroups : povray.programming : Invoking POV-Ray via GUI Extension : Invoking POV-Ray via GUI Extension Server Time
29 Jul 2024 00:32:01 EDT (-0400)
  Invoking POV-Ray via GUI Extension  
From: Ryan Hagelstrom
Date: 5 Mar 1999 02:14:49
Message: <36DF8346.9B5D482F@silver.sdsmt.edu>
I'm am currently working on a GUI Extension for our senior design
project. I'm having a problem with getting the GUI extension invoking
the POV-Ray Render routine.

The function runs fine if I call it within the DLL, like if I call it
from the required GUIExt About box. It GPF's when it is called from an
external program. This leads me to believe that InitStruct is not
pointing to the same memory because,  which it should because I have it
defined within the data_seg and specify it as shared.

Any help would be greatly appreciated. If you would like to see my full
source, let me know.

Thanks Ryan

My render function is as follows


//Globals
#pragma data_seg ("shared")

ExternalVarStruct POVVarsStruct = {NULL} ;
GuiExtInitStruct *InitStruct = NULL ; // Points to the Initstruct that
POV Loads

#pragma data_seg ()

EXPORT BOOL CALLBACK RenderStart(PSTR pSource, PSTR pCommand)
{

 //Initialize the POVVarsStruct
  POVVarsStruct.RecSize = sizeof(ExternalVarStruct);

 //Loads the current Pov Vars into POVVarsStruct
 InitStruct->ExternalRequest (RequestGetVars, &POVVarsStruct );

 //Change to the source file that we wish to render
 strcpy(POVVarsStruct.source_file_name,pSource);

  //If we have command line swiches, change them too
  if (pCommand != NULL)
 strcpy(POVVarsStruct.command_line, pCommand);

 // Set the POV vars to what we want
 InitStruct->ExternalRequest (RequestSetVars, &POVVarsStruct);

 // Start the POV rendering
 if(ExRequestOK != InitStruct->ExternalRequest
(RequestStartRendering,NULL))
 {
  InitStruct->ExternalRequest(RequestStartRendering,NULL);

  return FALSE;
 }
 else
  return TRUE;
}


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.