Error - calling a class from aspx

Discussion in 'ASP.NET / ASP.NET Core' started by sephib, Aug 4, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi,

    I have compiled the following code into a dll, (wich is instantiated by one empty sub) to be called from a web page. i create an object from the class and then call the sub (see code below). However I am getting an error ( see below), from my web search i think it is since i'm calling a window application from an aspx web form -

    Code:
     
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 
          On Error GoTo err 
          'Declare an instance of the object 
          Dim SC As New ChangeScene.ChangeScene 
    
          ' Invoke the  Method -: 
          SC.ChangeSceneSub()  ' THIS IS WHERE I GET THE ERROR 
          TextBoxResult.Text = "Sub DID  WORKed  !!!" 
    
    err: 
          'if no success 
          TextBoxResult.Text = Err.Description 
    
      End Sub 
    
    
    
    Code:
       Public Sub ChangeSceneSub() 
           ' Check if there is an arcScene license 
           Dim getExtension As Boolean = GetArcSceneLicense() 
           If (getExtension) Then ' if there is a license 
               pThisApp = GetApplicationFromDocument(SxdPath) 
               '[..] more code 
           End If 
       End Sub 
    
    
    I think that the problem is in the following function inside the compiled dll - this must require to open an application window 
    
    Code:
      Private Function GetApplicationFromDocument(ByVal sSXDFilename As String) As ESRI.ArcObjects.Sx.ISxApplication 
           On Error Resume Next 
           Dim pApp As ESRI.ArcObjects.Sx.ISxApplication 
           Dim pDoc As esriCore.IDocument 
           'get the sxd file - this calls an ArcScene application window to pop up 
            pSxDoc  = GetObject(sSXDFilename)   
            [...  more code...] 
           GetApplicationFromDocument = pApp 
       End Function 
    
    
    
    THIS IS THE Error 
    [Code] 
    It is invalid to show a modal dialog or form when the application is not running in UserInteractive mode. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application. 
    
    Do you identify different problems. 
    Do you have any ways to by pass this issue. 
    
    Any comments on any above points would be greatly appreciated - 
    THANK YOU AGAIN FOR YOU TIME , 
    
    JB
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    i do not think you can invoke some winform namespace with asp.net


    quote:Originally posted by sephib

    Hi,

    I have compiled the following code into a dll, (wich is instantiated by one empty sub) to be called from a web page. i create an object from the class and then call the sub (see code below). However I am getting an error ( see below), from my web search i think it is since i'm calling a window application from an aspx web form -

    Code:
     
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 
          On Error GoTo err 
          'Declare an instance of the object 
          Dim SC As New ChangeScene.ChangeScene 
    
          ' Invoke the  Method -: 
          SC.ChangeSceneSub()  ' THIS IS WHERE I GET THE ERROR 
          TextBoxResult.Text = "Sub DID  WORKed  !!!" 
    
    err: 
          'if no success 
          TextBoxResult.Text = Err.Description 
    
      End Sub 
    
    
    
    Code:
       Public Sub ChangeSceneSub() 
           ' Check if there is an arcScene license 
           Dim getExtension As Boolean = GetArcSceneLicense() 
           If (getExtension) Then ' if there is a license 
               pThisApp = GetApplicationFromDocument(SxdPath) 
               '[..] more code 
           End If 
       End Sub 
    
    
    I think that the problem is in the following function inside the compiled dll - this must require to open an application window 
    
    Code:
      Private Function GetApplicationFromDocument(ByVal sSXDFilename As String) As ESRI.ArcObjects.Sx.ISxApplication 
           On Error Resume Next 
           Dim pApp As ESRI.ArcObjects.Sx.ISxApplication 
           Dim pDoc As esriCore.IDocument 
           'get the sxd file - this calls an ArcScene application window to pop up 
            pSxDoc  = GetObject(sSXDFilename)   
            [...  more code...] 
           GetApplicationFromDocument = pApp 
       End Function 
    
    
    
    THIS IS THE Error 
    [Code] 
    It is invalid to show a modal dialog or form when the application is not running in UserInteractive mode. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application. 
    
    Do you identify different problems. 
    Do you have any ways to by pass this issue. 
    
    Any comments on any above points would be greatly appreciated - 
    THANK YOU AGAIN FOR YOU TIME , 
    
    JB
    </blockquote id="quote"></font id="quote">
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page