Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Computer Aided Design - CAD > Programming with Microstation > Creating a Type...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 421 of 451
Post > Topic >>

Creating a Type 66 STartup Element

by "Wombat" <andrew.womsley@[EMAIL PROTECTED] > Jan 4, 2007 at 06:40 AM

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.




 1 Posts in Topic:
Creating a Type 66 STartup Element
"Wombat" <an  2007-01-04 06:40:27 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 4 22:37:04 CDT 2008.