I have been playing in the Block UI Styler and I am getting the error "exception while invoking method in managed code" after launching a dll from a button press on my Block UI block. The dll being launced runs fine when executed on its own. When launched through the Block Styler it starts the dll fine, but once a valid target is selected for that dll(in this case an IDSymbol is selected to be moved) I get an error and am kicked back to the main Block Styler page.
This is the code from the Block Styler to launch the dll:
ElseIf block Is buttonMove Then
Try
Dim fullpath As String = "c:\DRAG.dll"
Dim nada() As Object = {} ' Main doesn't take any arguments
tS.Execute(fullpath, "NXJournal", "Main", nada)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
The dll itself asks the user to select an IDSymbol with an origin associative to a dimension, allows the user to "drag" the IDSymbol, reattaches the symbol to the dimension, and then asks the user to select another IDSymbol. The program is crashing once it gets a valid symbol to "drag".
Is there something obvious that I am missing? Like I said earlier, the dll for the move function works fine on its own.
2nd Dialog in DLL launched from Block Styler
I finally managed to see what the actual error I was getting was:
"Dialog area 2 is not currently available"
A quick search of GTAC lead me to this article:
http://solutions.industrysoftware.automation.siemens.com/view.php?sort=d...
So I am guessing that it is related to my dll trying to call a second dialog box(movement) even though it closes the first (selection dialog). I am still on 7.5. Can anyone say for sure if this has been addressed in 8 as the GTAC article suggests?
re: block styler
Unfortunately, I don't have access to a blockstyler license. Hopefully someone who does will drop in and comment.