error: no function dcl_messagebox

Started by andrew · 2012-02-28 21:29 UTC · 6 replies · SMF topic #1763

I have the following in a custom lisp

(defun yes_no_cancel (/)
;; Ensure OpenDCL Runtime is (quietly) loaded
(setq cmdecho (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
(command "_OPENDCL")
(setvar "CMDECHO" cmdecho)

(setq yn (dcl_MessageBox "File has been changed, do you want to save changes?" "Save Drawing?" 6 1))
  (if (= yn 6)
    (nclose)
  )
  (if (= yn 7)
    (nquit)
  )
)


when i first launch acad i get this error message.
I just upgraded to 2012 from 2009, there is no problem with this code in 2009
even after uninstalling opendcl and reinstalling it, i still get error.

am i missing something?

Please  clarify the statement ..

>>
when i first launch acad i get this error message.


Do you get the message without running the routine ? or is the routine called from a reactor in some way'

just for info :  this works for me.
note the method name dcl_MessageBox  is blue in the IDE after the file is loaded into AutoCAD.
Attachments
author=Kerry link=topic=1763.msg8648#msg8648 date=1330468686 wrote:

Please  clarify the statement ..

>>
when i first launch acad i get this error message.


Do you get the message without running the routine ? or is the routine called from a reactor in some way'


when i first launch acad it opens into a blank dwg (startup set to 0)
and it gives the error.
if i set my startup to 1 and use the dialog box to open my dwg i dont get this however, a few coworkers dont like to use that.

and that code is in separate file loaded from acaddoc
You may need to put your startup code in the S::STARTUP function so that it waits to execute until the AutoCAD editor is fully initialized.
author=owenwengerd link=topic=1763.msg8654#msg8654 date=1330540982 wrote:
You may need to put your startup code in the S::STARTUP function so that it waits to execute until the AutoCAD editor is fully initialized.


i have it loading in the startup, still get the error

also i have a separate project that i have loading on every dwg and often it locks up my acad 2012 to the point where i have to bring up the task manager to end the acad process to get out of it.

i would like to think its the coding, but most of it Fred did for me and i didnt have these issues with it loading in acad 2009
author=andrew link=topic=1763.msg8658#msg8658 date=1330615201 wrote:
[quote author=owenwengerd link=topic=1763.msg8654#msg8654 date=1330540982]
You may need to put your startup code in the S::STARTUP function so that it waits to execute until the AutoCAD editor is fully initialized.


i have it loading in the startup, still get the error

also i have a separate project that i have loading on every dwg and often it locks up my acad 2012 to the point where i have to bring up the task manager to end the acad process to get out of it.

i would like to think its the coding, but most of it Fred did for me and i didnt have these issues with it loading in acad 2009


Andrew, the the S::STARTUP function is different to loading from the startup suite.
Which are you doing ?

Is the thread about start reactors at theSwamp yours ? If so, be aware that you can't include 'commands' in a reactor callback.

Regards
author=Kerry link=topic=1763.msg8659#msg8659 date=1330630670 wrote:
[quote author=andrew link=topic=1763.msg8658#msg8658 date=1330615201]
[quote author=owenwengerd link=topic=1763.msg8654#msg8654 date=1330540982]
You may need to put your startup code in the S::STARTUP function so that it waits to execute until the AutoCAD editor is fully initialized.


i have it loading in the startup, still get the error

also i have a separate project that i have loading on every dwg and often it locks up my acad 2012 to the point where i have to bring up the task manager to end the acad process to get out of it.

i would like to think its the coding, but most of it Fred did for me and i didnt have these issues with it loading in acad 2009


Andrew, the the S::STARTUP function is different to loading from the startup suite.
Which are you doing ?

Is the thread about start reactors at theSwamp yours ? If so, be aware that you can't include 'commands' in a reactor callback.

Regards



no this doesnt have anything to do with reactors, two different things...
i did get it to work, i had to adjust my code to load the open dcl first before loading my functions. it seems to be working as it should now thanks for the replies