Why does this error occur using 'OnInitialize'

Started by JustCurious, May 08, 2023, 12:35:22 AM

Previous topic - Next topic


Hello everyone,

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

; ----- Error around expression -----
; 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.

It is obiously invoked by this piece of code:

(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