Error al abrir una pantalla dynamics sl 2018.x desde visual studio 2015

Hilo iniciado por samuel infante el 7 de mayo de 2019

Viendo 1 entrada (de un total de 1)
  • Autor
    Entradas
  • #16221
    Rangosamuel infantesamuel infante
    Participante
    APRENDIZ
    50 Rincoins

    Hola

    Estoy ejecutando en visual studio 2015 el siguiente procedure:

    Sub CrearProyecto1(ByVal Proyecto As String)
    Dim iSolerr As Short
    Dim iOSerr As Long
    Dim screen As String
    SIVApp = Nothing

    screen = "PAPRJ00.exe"
    Try
    SIVApp = StartAppAndAutomate(screen.ToString(), iSolerr, iOSerr)
    SIVApp.[New]("Project")
    SIVApp.Controls("cproject").Value = Trim(Proyecto)
    SIVApp.Controls("cmanager1").Value = "00"
    SIVApp.Controls("cgl_subacct").Value = "00000"
    SIVApp.Controls("cproject_desc").Value = "Expediente Nro " + Trim(Proyecto)
    SIVApp.Controls("cpjt_entity").Value = "O"
    SIVApp.Controls("cpjt_entity_desc").Value = "Actividad 1"
    SIVApp.Save()

    Catch ex As System.Runtime.InteropServices.COMException
    Dim lErrNumber As Integer
    If ex.Source.Contains("Solomon") = True Or ex.ErrorCode - vbObjectError > 0 Then

    If ex.Source.Contains("Solomon") = True Or ex.ErrorCode - vbObjectError > 0 Then
    lErrNumber = ex.ErrorCode - vbObjectError
    Else
    lErrNumber = ex.ErrorCode
    End If
    End If

    Select Case lErrNumber
    Case 2048 'non-fatal exception '(Message event has just fired before this)
    iSolerr = Val(Err.Description)
    Select Case iSolerr
    Case 9 'Not found 'fix problem or give up

    Case 15 'value was too small 'fix problem or give up

    Case 23 'Wrong GL Period
    MessageBox.Show("Error 23, Periodo en GL errado")


    End Select

    Case 7500 'Already logged in
    Case 7501 'System Database Name > 20 Characters
    Case 7502 'Wrong System Database Server Database Name
    Case 7503 'Incorrect Company ID, User ID, or Password
    Case 7504 'System Database Does Not Exist
    Case 7505 'Interactive User ID <> Client Login
    Case Else
    MsgBox(ex.Message, MsgBoxStyle.Exclamation, String.Format("{0} Error {1}", ex.Source, lErrNumber.ToString()))
    End Select

    Catch ex As Exception
    'do work
    'MsgBox(ex.Message, MsgBoxStyle.Exclamation, String.Format("{0} Exception", ex.Source))

    Finally
    Dim lErrNumber As Integer
    'SIVApp.Visible = "True"
    'MessageBox.Show("Now Quiting application screen " + screen.ToString())
    Try
    SIVApp.Cancel()
    SIVApp.Quit()
    SIVApp.Dispose()
    Catch ex As Exception

    MsgBox(ex.Message, MsgBoxStyle.Exclamation, String.Format("{0} Error {1}", ex.Source, lErrNumber.ToString()))

    Finally
    GC.Collect()
    GC.WaitForPendingFinalizers()
    GC.Collect()

    'MessageBox.Show("Done with Automation of screen " + screen.ToString())
    End Try

    End Try
    End Sub

    pero al ejecutarlo me muestra el siguiente error: "Referencia de objeto no establecida como una instancia de un objeto"
    
    esta rutina funciona en visual studio 2008 y en sl 7.x, pero en visual studio 2015 en sl 2018.x no, la aplicación en vs2015 está compilado con .net framework 4.5.2.

    Saludos
Viendo 1 entrada (de un total de 1)
  • Debes estar registrado para responder a este debate.
Carrito de compra