Author Topic: Why does this error occur using 'OnInitialize'  (Read 109 times)

JustCurious

  • Member
  • *
  • Posts: 1
Why does this error occur using 'OnInitialize'
« on: May 08, 2023, 12:35:22 AM »

Hello everyone,

I wonder what this message means when loading an ODCL project into BricsCAD V.23:

Code: [Select]
; ----- Error around expression -----
; (AL_EXECUTEADSDEFUN "DCL-FORM-SHOW" REST)
; in file :
; C:\Program Files (x86)\Common Files\OpenDCL\OpenDCL.x64.23.brx
;
; error : bad argument type <#<<FUNCTION> #x40 @1000c71e36>> ; expected <FUNCTION> at [funcall]
;
; error : during LISP function [c:myProject/myDialog#OnInitialize] invoke from BRX/SDS interface,
          please check Lisp function definition and call arguments.
: VLIDE

It is obiously invoked by this piece of code:

Code: [Select]
(defun c:myProject/myDialog#OnInitialize (/)
  (dcl-MessageBox "To Do: code must be added to event handler\r\nc:myProject/myDialog#OnInitialize" "To do")
)

But since this code does not do anything as it comes out of the box, I feel there may be wrong something else...

The onInitialize function itself, in my "program" it does not seem to be necessary but I believe it is somehow mandatory, the help file does not provide the