.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Exit a dll loaded

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
muthineni
653 Views, 4 Replies

Exit a dll loaded

I have created a dll using vb.net and i am performing some validations in middle. If version is mismatching in program and database, i need to exit the application. Can anyone help me with the code on how to exit the application and stop the command functionality? Thank you.
4 REPLIES 4
Message 2 of 5
arcticad
in reply to: muthineni

Not quite sure what your asking. If you want to stop the DLL,

you would have to close out of AutoCAD.

Make your changes and then reload AutoCAD and load your DLL.

 

There isn't a netUNload command.

---------------------------



(defun botsbuildbots() (botsbuildbots))
Message 3 of 5
muthineni
in reply to: arcticad

sorry, i think i am not clear about my issue, Suppose, in vb.net code, i am checking the user validation,if the user system name exists in the database, then only the dll should run. When the user enters runVB, then the validation should occur, so i have wrote the following code, _ Public Sub routine1() if User() then 'Remaining code else 'Should display message and the command execution. ie, exit sub. end if end sub My problem is, if i write exit sub, the command execution is not stopped. How to go back to the command: prompt in autocad after displaying message box.
Message 4 of 5
Alfred.NESWADBA
in reply to: muthineni

Hi,

 

>> if i write exit sub, the command execution is not stopped

Sorry, I don't understand what the command does other than stopping. Could you describe what happens (show the content of the commandline area).

 

Anyway I (personally) hate things like Exit Sub or Goto as there may be things lost like disposing transactions, closing files, ...

Why not running in that way:

 

<Command Method("myCommand1")> _
Public Sub myCommand1
  if checkUser then
    'do your command-handling here
  else
    call MsgBox("You are not authorized, contact your admin")
  end if
End Sub

 There is no Exit Sub necessary for that 😉

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 5 of 5
muthineni
in reply to: Alfred.NESWADBA

sorry, i got it, i have wrote the user check function in a separate function and i did not pass the value properly. Now it is working fine. Thank you.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost