Problem with dcl_Control_GetPicture

Started by hmspe, October 07, 2012, 10:07:42 PM

Previous topic - Next topic

hmspe

I did an upgrade to my production computer that led to a reformat of the hard drive.   After a fresh install of Win7 64bit Home Premium, Bricscad 12.2.18, and OpenDCL 7.0.0.8 I'm having trouble with an OpenDCL modeless dialog.  The dialog worked properly before the reformat and the same routine, loaded from a network drive, runs properly on another computer in the office with the same OS and Bricscad versions.  When the ODCL file loads I get 13 pop-ups that read:

   An OpenDCL function argument processing exception has occurred!
   Error: Nil value not allowed
   Function: dcl_Control_GetPicture
   Argument: 1

There are 13 buttons on the dialog.  All of the buttons have similar code to:

  (if (= (vlax-variant-value (vla-getvariable acaddoc "ORTHOMODE")) 1)
    (if (= (dcl_Control_GetPicture ModeBar_ModeBar_OrthoButton) 100)
      (dcl_Control_SetPicture ModeBar_ModeBar_OrthoButton 101)                 ; ortho down
    )
    (if (= (dcl_Control_GetPicture ModeBar_ModeBar_OrthoButton) 101)
      (dcl_Control_SetPicture ModeBar_ModeBar_OrthoButton 100)                 ; ortho up
    )
  )


I've uninstalled and reinstalled both Bricscad and OpenDCL with no change.  I rebuilt the picture folder for the routine wth bitmaps that are in the Bricscad path, but no change.  The I have the same problem whether I run a local copy or a network copy of the OpenDCL program.  All the other OpenDCL functions I run are working well.     

Things like this usually mean I missed something simple.  Any suggestions on how to fix this would be appreciated.







owenwengerd

Open your .odcl file in Studio and get the correct symbol name for the picture control (an easy way is to open Control Browser and click on the Picture property), then update your code so the two match.
Owen Wengerd (Outside The Box) / ManuSoft

hmspe

Thanks for the reply, Owen.

Before I posted I had done what you suggested.  The text in the lisp file exactly matches the symbol name from the control browser in each case.  As I said, the exact same code (both the .odcl file and the .lsp file) runs on another computer here, so I am reasonably sure that the code is OK.

Based on the Nil value returned in the error message I'm thinking that this may be a problem with the .odcl file loading.  My guess is that the Nil means the "ModeBar_ModeBar_OrthoButton" was not found.  Since the new computer is faster (Intel i7-3770K instead of E8400) my though is that there could be a timing issue, but that is only a guess.

Martin

owenwengerd

Does (dcl_Form_Show) succeed? The .odcl file is loaded correctly if it does.
Owen Wengerd (Outside The Box) / ManuSoft

hmspe

Thanks for the gentle nudge.  The problem was in the routine that calculates the location of the modeless dialog box.  That code was in the same defun that did the dcl_form_show, and dcl_form_show was not getting called.  Off to find a more reliable way to determine the screen size in pixels....