on 01-20-2009 6:39 PM
Hola buen dia...
Como ya es costumbre estoy acá pidiendoles ayuda acerca de un problema que me surge al momento de mostrar un Openfiledialog.
Para este addon tengo un modulo que tiene el "sub mail" el cual tiene el Application.Run()... ahora bien... ya después cuando trato de llamar el diálogo me envia la siguiente excepción:
Current thread must be set to single thread apartment (STA) mode before OLE calls can be made.
Ensure that your Main function has STAThreadAttribute marked on it. This exception is only raised if a debugger is attached to the process.
Como podrán ver es algo extensa... ya intenté colocarle esta línea:
System.Threading.Thread.CurrentThread.SetApartmentState(Threading.ApartmentState.STA)
pero al momento del "ShowDialog " ya tiene valor MTA... y cuando trato de colocarle STA antes del showdialog me tira otra excepción:
Failed to set the specified COM apartment state.
Entonces quisiera saber si alguien me puede ayudar a arreglar esto.. acá está el código de la llamada:
Dim Dialogo As Windows.Forms.OpenFileDialog
Try
Dialogo = New Windows.Forms.OpenFileDialog
Dialogo.ShowDialog()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Carga de Datos")
End Try
En el showdialog es donde falla, gracias de antemano.
Edited by: Rudy Castaneda on Jan 20, 2009 7:40 PM
Hola Rudy, revisa los siguiente threads, puede que sean de tu ayuda.
http://bytes.com/groups/net-vb/488099-openfiledialog-crashes-no-reason
suerte
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.