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.