on 04-16-2012 3:58 PM
Hi Friends
I'm an addon DEVELOPING SAP 8.81, when generating an error generatedOpenFileDialog
El subproceso actual debe establecerse en el modo de subprocesamiento controlado simple (Single Thread Apartment, STA) para poder realizar llamadas OLE. Asegúrese de que la función Main tiene marcado STAThreadAttribute. Esta excepción sólo se desencadena
My code is as follows
Public Function abrirOpenFileDialog()
Try
Dim MyTest As New OpenFileDialog
Dim MyProcs As Process()
MyProcs = Process.GetProcessesByName("SAP Business One")
If MyProcs.Length > 0 Then
'For i As Integer = 0 To MyProcs.Length - 1
'Dim MyWindow As New WindowWrapper(MyProcs(i).MainWindowHandle)
Dim MyWindow As New WindowWrapper(MyProcs(0).MainWindowHandle)
MyTest.Filter = "Text Documents (*.txt)|*.txt"
If MyTest.ShowDialog(MyWindow) = DialogResult.OK Then
coForm.DataSources.UserDataSources.Item("txt_archiv").Value = MyTest.FileName
System.Windows.Forms.Application.ExitThread()
Else
System.Windows.Forms.Application.ExitThread()
End If
'Next
Else
oAplicacionSBO.SetStatusBarMessage("No SBO instances found.")
End If
Catch ex As Exception
oAplicacionSBO.MessageBox("Error al Abrir OpenFileDialog. " & ex.Message)
End Try
End Function
Help Me!
Sorry, but you posted into an incorrect Discussion Forum. See from the Overview of this forum:
This space is dedicated to development and deployment of .NET applications that connect and interact with SAP BusinessObjects Enterprise, SAP BusinessObjects Edge, or SAP Crystal (Reports) Server. This includes the development of applications using the BusinessObjects Enterprise, Report Application Server, Report Engine, and Web Services SDKs.
To find the correct forum for your issue, please consult the Forum Finder for the New SCN documentation.
- Ludek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.