Creating a Type 66 STartup Element

  • Follow


Hi, I wonder if anybody can help.
I'm presently trying to create a Type 66 Startup Element in a design
file.
A little history here:- We have a legacy MDL application within the
organisation that relies upon a type 66 startup element in the seed
file to fire the application whenever a design file created with this
seed file is opened.  We need to rename the MDL executable (.ma file)
and as such need to delete and recreate the type 66 element in the seed
file.

So far I have found the MDL function :
    mdlSystem_CreateStartupElement
    mdlSystem_deleteStartupElement function

and also the associated wrappers to utilise the functions in VBA:
    Declare Function mdlSystem_createStartupElement Lib
"stdmdlbltin.dll" ( ByVal outElemP As Long , ByVal startupString As
String ) As Long
    Declare Function mdlSystem_deleteStartupElement Lib
"stdmdlbltin.dll" ( ByVal programNameP As String ) As Long

I need to be able to perfrom this function in VBA as I am not an MDL
programmer.

I have tried to utilise the above functions in a VBA module (see below)
and every time I run it I get an exception error with the option of
Igonre, Retry or Abort (but only Abort will do anything) resulting in
Microstation exiting with a error dump.
#-------------------------code-------------------------------------------------------#
Declare Function mdlSystem_createStartupElement _
        Lib "stdmdlbltin.dll" (ByVal outElemP As Long, _
        ByVal startupString As String) As Long

Declare Function mdlElement_add _
        Lib "stdmdlbltin.dll" (ByVal element As Long) As Long

Sub Add_StartupElement()
    Dim res As Long
    Dim oElem As element
    Dim elemP As Long

    res = mdlSystem_createStartupElement(elemP, "AppNameHere.ma")
    res = mdlElement_add(elemP)
End Sub

#-------------------------------------------------------------------------------------#

I understand I've got something wrong but I don't know what....
Any help will be gratefully received.

0
Reply Wombat 1/4/2007 2:40:27 PM


0 Replies
337 Views

(page loaded in 0.007 seconds)

Similiar Articles:













7/24/2012 6:13:33 PM


Reply: