PDA

View Full Version : stop process to show forms in dll



inner
2004-08-04, 07:07 PM
thats another problem i have when changing code from vba to vb in dll
if you show a form in a vba, autocad automatically stop the execution of code and wait the me.hide of form to continue, but now in the dll it show the form and continue the rest of the code as two separate and simultaneous process
how can i manage this to make a lineal process? i need some user actions in the form before continue the code
thanks in advance

RobertB
2004-08-04, 10:41 PM
All the work should be done in the .dll. The only code in the .dvb should be a initialization/front end into the .dll.

richard.binning
2004-08-04, 10:41 PM
thats another problem i have when changing code from vba to vb in dll
if you show a form in a vba, autocad automatically stop the execution of code and wait the me.hide of form to continue, but now in the dll it show the form and continue the rest of the code as two separate and simultaneous process
how can i manage this to make a lineal process? i need some user actions in the form before continue the code
thanks in advance
Modify your code so that the continuation occurs in a different function or subroutine. In other words have you code run so that the last command in a subroutine or function calls the form. then have the "OK" button or form unload event continue the rest of the program by calling a new subroutine or function.

inner
2004-08-05, 08:22 AM
Modify your code so that the continuation occurs in a different function or subroutine. In other words have you code run so that the last command in a subroutine or function calls the form. then have the "OK" button or form unload event continue the rest of the program by calling a new subroutine or function.

it would be hard to do as i show the form lot of times in all the code, but it seems 'vbapplicatonmodal' of msgbox cant be used with forms, i really created the form because the appearance of msgbox is so... simple
so coming back to msgbox's

jwanstaett
2004-08-06, 01:19 PM
you need to show your form in modal style


---------- From the MSDN Library----------
object.Show style, ownerform
The Show method syntax has these parts:

Part Description
--------------------------------------------------------------
object Optional. Anobject expression that evaluates to an object in the Applies To list. If object is omitted, the form associated with the active formmodule is assumed to be object.
----------------------------------------------------------
style Optional. Integer that determines if the form ismodal ormodeless. If style is 0, the form is modeless; if style is 1, the form is modal.
------------------------------------------------------------------
ownerform Optional. Astring expression that specifies the component which "owns" the form being shown. For standard Visual Basic forms, use the keyword Me

-----------------------------------------------------
When Show displays a modeless form, subsequent code is executed as it's encountered. When Show displays a modal form, no subsequent code is executed until the form is hidden or unloaded.

When Show displays a modal form, no input (keyboard or mouse click) can occur except to objects on the modal form. The program must hide or unload a modal form (usually in response to some user action) before input to another form can occur. An MDIForm can't be modal

--------
note:
Vba for AutoCad allway use modal style when showing forms

inner
2004-08-06, 01:53 PM
ok, thanks, finally im using something like this in the dll

Public Sub mostrar (x As Variant)
Me.Show vbModal
End Sub
Private Sub Command1_Click()
Me.Hide
End Sub