On Jul 25, 2006, at 4:52 PM, Theodore H. Smith wrote:

In regards to logging, yes I have been using a combination of REALbasic System.DebugLog and DebugStr. In REALbasic a System.DebugLog msg is right before the call to the method and it outputs to the Console as expected. In the method, I have a DebugStr call which is never printed,

At the very start of the function?

Yes. The app crashes before the DebugStr from the C plugin. It crashes here:

  If (ImageFX Is Nil) Then ImageFX = New PictureFX(Image)
  System.DebugLog "PictureFX object created."
  If (ImageFX Is Nil) Then System.DebugLog "ImageFX is Nil"

  System.DebugLog "Picture Width is " + Str(ImageFX.Width)
  System.DebugLog "Picture Height is " + Str(ImageFX.Height)
  System.DebugLog "Picture Depth is " + Str(ImageFX.Depth)

  ImageFX.InvertRGB    <<<<<<<<<<<<<<<<<<< CRASH ON CALL
  System.DebugLog "InvertRGB completed."

  Image = ImageFX.ToPicture
  System.DebugLog "PictureFX to Picture conversion completed."

--------------------
CONSOLE OUTPUT:
--------------------

PictureFX object created.
Picture Width is 512
Picture Height is 512
Picture Depth is 32
Jul 25 18:52:45 ag4 crashdump[13015]: TestApp.debug crashed


so the crash seems to be occurring somewhere in the framework even before my plugin method is getting called. There doesn't seem to be anything else that I can do to isolate this.

Then perhaps the function is declared wrong.

I hope so, but I cannot figure out how.

The fact that you are define the the REALClassDefinitions and all theo other data in .h files can't help. You should define them in a .cpp file. This way data doesn't get duplicated across multiple files that include the .h file.

#include is nothing more than a dumb preprocessor you see. So anything in a .h file gets put into all the .cpp files that include it. So you've got the same data defined multiple times now if you have multiple .cpp files that include that .h of yours. If it's only 1 .cpp it might not be a problem, but I'd really avoid it if I were you just on good coding practice grounds.

That is a good idea... I have an #ifndef condition in that .h file, but I had the #endif only protecting calls into other header files. I moved the #endif to the last line in the .h file and ran the plugin again with the same result.


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to