Visualizzazione dei risultati da 1 a 10 su 10
  1. #1
    Utente di HTML.it
    Registrato dal
    Dec 2007
    Messaggi
    489

    c# .net timer da i numeri su unsolo pc

    ciao a tutti!

    ho scritto un software e uno delgi utenti ch elo utilizza ha il seguente errore.

    lo script non ´´e altro che un timer su un form che esegue delle semplici azioni a intervalli regolari.

    sapete dirmi cosa potrebbe causare il problema e perche solo a lui? .net installato, niente programmi strani, non riesco a trovare la causa.

    grazie

    ciao

    igor

    codice:
    See the end of this message for details on invoking 
    just-in-time (JIT) debugging instead of this dialog box.
    
    ************** Exception Text **************
    System.NullReferenceException: Object reference not set to an instance of an object.
       at Renderviews.Form1.timer1_Tick(Object sender, EventArgs e)
       at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    
    
    ************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
        CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
    ----------------------------------------
    UIFrameworkInterop
        Assembly Version: 0.0.0.0
        Win32 Version: 20120221_2030(x64)
        CodeBase: file:///C:/Program%20Files/Autodesk/Revit%20Architecture%202013/Program/UIFrameworkInterop.DLL
    ----------------------------------------
    UIFramework
        Assembly Version: 2013.0.2012.221
        Win32 Version: 2013.0.0.0
        CodeBase: file:///C:/Program%20Files/Autodesk/Revit%20Architecture%202013/Program/UIFramework.DLL
    ----------------------------------------
    AdWindows
        Assembly Version: 3.5.19.0
        Win32 Version: 3.5.19.0
        CodeBase: file:///C:/Program%20Files/Autodesk/Revit%20Architecture%202013/Program/AdWindows.DLL
    ----------------------------------------
    System
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    PresentationFramework
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework/v4.0_4.0.0.0__31bf3856ad364e35/PresentationFramework.dll
    ----------------------------------------
    WindowsBase
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/WindowsBase/v4.0_4.0.0.0__31bf3856ad364e35/WindowsBase.dll
    ----------------------------------------
    PresentationCore
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_64/PresentationCore/v4.0_4.0.0.0__31bf3856ad364e35/PresentationCore.dll
    ----------------------------------------
    System.Xaml
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xaml/v4.0_4.0.0.0__b77a5c561934e089/System.Xaml.dll
    ----------------------------------------
    System.Xml
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------
    UIAutomationTypes
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/UIAutomationTypes/v4.0_4.0.0.0__31bf3856ad364e35/UIAutomationTypes.dll
    ----------------------------------------
    UIFrameworkServices
        Assembly Version: 0.0.0.0
        Win32 Version: 20120221_2030(x64)
        CodeBase: file:///C:/Program%20Files/Autodesk/Revit%20Architecture%202013/Program/UIFrameworkServices.DLL
    ----------------------------------------
    UIFrameworkRes
        Assembly Version: 2013.0.2012.221
        Win32 Version: 2013.0.0.0
        CodeBase: file:///C:/Program%20Files/Autodesk/Revit%20Architecture%202013/Program/UIFrameworkRes.DLL
    ----------------------------------------
    System.Core
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
    ----------------------------------------
    System.Drawing
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    PresentationFramework.Aero
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework.Aero/v4.0_4.0.0.0__31bf3856ad364e35/PresentationFramework.Aero.dll
    ----------------------------------------
    AdApplicationFrame
        Assembly Version: 0.0.0.0
        Win32 Version: 3.5.19.0
        CodeBase: file:///C:/Program%20Files/Autodesk/Revit%20Architecture%202013/Program/AdApplicationFrame.DLL
    ----------------------------------------
    AddInManagerUI
        Assembly Version: 2013.0.0.0
        Win32 Version: 20120221_2030(x64)
        CodeBase: file:///C:/Program%20Files/Autodesk/Revit%20Architecture%202013/Program/AddInManagerUI.DLL
    ----------------------------------------
    System.Windows.Forms
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System.Configuration
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    ----------------------------------------
    UIAutomationProvider
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/UIAutomationProvider/v4.0_4.0.0.0__31bf3856ad364e35/UIAutomationProvider.dll
    ----------------------------------------
    WindowsFormsIntegration
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/WindowsFormsIntegration/v4.0_4.0.0.0__31bf3856ad364e35/WindowsFormsIntegration.dll
    ----------------------------------------
    ManagedMC3
        Assembly Version: 6.4.0.0
        Win32 Version: 6.4.0.0
        CodeBase: file:///C:/Program%20Files/Autodesk/Revit%20Architecture%202013/Program/ManagedMC3.DLL
    ----------------------------------------
    APIInterop
        Assembly Version: 2013.0.0.0
        Win32 Version: 20120221_2030(x64)
        CodeBase: file:///C:/Program%20Files/Autodesk/Revit%20Architecture%202013/Program/APIInterop.DLL
    ----------------------------------------
    RevitAddInUtility
        Assembly Version: 2013.0.0.0
        Win32 Version: 20120221_2030(x64)
        CodeBase: file:///C:/Program%20Files/Autodesk/Revit%20Architecture%202013/Program/RevitAddInUtility.DLL
    ----------------------------------------
    System.Xml.Linq
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml.Linq/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll
    ----------------------------------------
    RevitAPI
        Assembly Version: 2013.0.0.0
        Win32 Version: 20120221_2030(x64)
        CodeBase: file:///C:/Program%20Files/Autodesk/Revit%20Architecture%202013/Program/RevitAPI.DLL
    ----------------------------------------
    AddInManager
        Assembly Version: 2012.0.0.0
        Win32 Version: 20120221_2030(x64)
        CodeBase: file:///C:/Program%20Files/Autodesk/Revit%20Architecture%202013/Program/AddInManager.DLL
    ----------------------------------------
    AddInJournaling
        Assembly Version: 2013.0.0.0
        Win32 Version: 20120221_2030(x64)
        CodeBase: file:///C:/Program%20Files/Autodesk/Revit%20Architecture%202013/Program/AddInJournaling.DLL
    ----------------------------------------
    RevitAPIUI
        Assembly Version: 2013.0.0.0
        Win32 Version: 20120221_2030(x64)
        CodeBase: file:///C:/Program%20Files/Autodesk/Revit%20Architecture%202013/Program/RevitAPIUI.DLL
    ----------------------------------------
    RaaSApplication
        Assembly Version: 1.0.0.0
        Win32 Version: 1.0.0.0
        CodeBase: file:///C:/Program%20Files/Autodesk/Revit%20Architecture%202013/Program/AddIns/RaaSForRevit/RaaSApplication.dll
    ----------------------------------------
    VSTAHookup
        Assembly Version: 2013.0.0.0
        Win32 Version: 20120221_2030(x64)
        CodeBase: file:///C:/Program%20Files/Autodesk/Revit%20Architecture%202013/Program/VSTAHookup.DLL
    ----------------------------------------
    SDACommon
        Assembly Version: 2013.0.0.0
        Win32 Version: 2013.0.0.0
        CodeBase: file:///C:/Program%20Files/Autodesk/Revit%20Architecture%202013/Program/SDACommon.DLL
    ----------------------------------------
    AddInJournalEngine
        Assembly Version: 2013.0.0.0
        Win32 Version: 20120221_2030(x64)
        CodeBase: file:///C:/Program%20Files/Autodesk/Revit%20Architecture%202013/Program/AddInJournalEngine.DLL
    ----------------------------------------
    AddInJournalClient
        Assembly Version: 2013.0.2012.221
        Win32 Version: 2013.0.0.0
        CodeBase: file:///C:/Program%20Files/Autodesk/Revit%20Architecture%202013/Program/AddInJournalClient.DLL
    ----------------------------------------
    DataStorageClientInterop
        Assembly Version: 0.0.0.0
        Win32 Version: 20120221_2030(x64)
        CodeBase: file:///C:/Program%20Files/Autodesk/Revit%20Architecture%202013/Program/DataStorageClientInterop.DLL
    ----------------------------------------
    DataStorageClient
        Assembly Version: 2013.0.2012.221
        Win32 Version: 2013.0.0.0
        CodeBase: file:///C:/Program%20Files/Autodesk/Revit%20Architecture%202013/Program/DataStorageClient.DLL
    ----------------------------------------
    RS.Common.ClientServer.DataContract
        Assembly Version: 2013.0.2012.221
        Win32 Version: 2013.0.0.0
        CodeBase: file:///C:/Program%20Files/Autodesk/Revit%20Architecture%202013/Program/RS.Common.ClientServer.DataContract.DLL
    ----------------------------------------
    ConceptualEnergyAnalysisInterop
        Assembly Version: 0.0.0.0
        Win32 Version: 20120221_2030(x64)
        CodeBase: file:///C:/Program%20Files/Autodesk/Revit%20Architecture%202013/Program/ConceptualEnergyAnalysisInterop.DLL
    ----------------------------------------
    MessageLoggerInterop
        Assembly Version: 1.0.4408.38983
        Win32 Version: 1.0.0.0
        CodeBase: file:///C:/Program%20Files/Autodesk/Revit%20Architecture%202013/Program/MessageLoggerInterop.DLL
    ----------------------------------------
    MessageLogger
        Assembly Version: 1.0.0.0
        Win32 Version: 1.0.0.0
        CodeBase: file:///C:/Program%20Files/Autodesk/Revit%20Architecture%202013/Program/MessageLogger.DLL
    ----------------------------------------
    log4net
        Assembly Version: 1.2.10.0
        Win32 Version: 1.2.10.0
        CodeBase: file:///C:/Program%20Files/Autodesk/Revit%20Architecture%202013/Program/log4net.DLL
    ----------------------------------------
    DBManagedServices
        Assembly Version: 2013.0.0.0
        Win32 Version: 20120221_2030(x64)
        CodeBase: file:///C:/Program%20Files/Autodesk/Revit%20Architecture%202013/Program/DBManagedServices.DLL
    ----------------------------------------
    Accessibility
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
    ----------------------------------------
    PresentationFramework.Luna
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework.Luna/v4.0_4.0.0.0__31bf3856ad364e35/PresentationFramework.Luna.dll
    ----------------------------------------
    Renderviews
        Assembly Version: 1.0.0.0
        Win32 Version: 1.0.0.0
        CodeBase: file:///E:/revit%20lib/Renderviews/Renderviews.dll
    ----------------------------------------
    InputSimulator
        Assembly Version: 0.1.0.0
        Win32 Version: 0.1.0.0
        CodeBase: file:///E:/revit%20lib/Renderviews/InputSimulator.DLL

  2. #2
    Moderatore di Programmazione L'avatar di LeleFT
    Registrato dal
    Jun 2003
    Messaggi
    17,320

    Moderazione

    Tutti i linguaggi .NET vengono tratatti nel forum "Visual Basic e .NET Framework".

    Sposto.


    Ciao.
    "Perchè spendere anche solo 5 dollari per un S.O., quando posso averne uno gratis e spendere quei 5 dollari per 5 bottiglie di birra?" [Jon "maddog" Hall]
    Fatti non foste a viver come bruti, ma per seguir virtute e canoscenza

  3. #3
    Utente di HTML.it
    Registrato dal
    Dec 2007
    Messaggi
    489
    ok grazie scusa per lo sbaglio!

  4. #4
    Utente di HTML.it L'avatar di oregon
    Registrato dal
    Jul 2005
    residenza
    Roma
    Messaggi
    36,480
    Cosa c'è in

    Renderviews.Form1.timer1_Tick

    ?
    No MP tecnici (non rispondo nemmeno!), usa il forum.

  5. #5
    Utente di HTML.it
    Registrato dal
    Dec 2007
    Messaggi
    489
    la cosa strana ´´e che a tutti funziona.. tranne a lui..

    comunque in timertick c´´e questo:

    codice:
         private void timer1_Tick(object sender, EventArgs e)
            {
                //label3.Text = currentstep.ToString();
                label2.Text = GetActiveWindowTitle();
               // label3.Text = revitApp.Application.Language.ToString();
    
                label12.Text = currentview.ToString() + " of " + myArr.Length.ToString() + " views rendered...";
    
                if (currentstep == 0)
                {
                    label1.Text = "Waiting start...";
                    string MainString = GetActiveWindowTitle();
                    if (MainString.Length > 17)
                    {
                    //string NewString = MainString.Remove(18, MainString.Length-1);
                        string SearchString = "Autodesk Revit 2013";
                        int FirstChr = MainString.IndexOf(SearchString);
                        if (FirstChr == 0)
                        {
                            label6.Text = "Rendering started! Please don't click ANYWHERE!";
                            currentstep = 1;
                        }
                    }
                }
                else if (currentstep == 1)
                {
                    checkBox1.Enabled = false;
                    label1.Text = "Loading view...";
                    loadview();
                    currentstep = 101;
                }
                else if (currentstep == 101)
                {
                    InputSimulator.SimulateKeyPress(VirtualKeyCode.VK_R);
                    InputSimulator.SimulateKeyPress(VirtualKeyCode.VK_R);
                    currentstep = 102;
                }
                else if (currentstep == 102)
                {
                    string windowname = null;
                    if (revitApp.Application.Language == Autodesk.Revit.ApplicationServices.LanguageType.German)
                    {
                        windowname = "Rendern";
                    }
                    else if (revitApp.Application.Language == Autodesk.Revit.ApplicationServices.LanguageType.English_USA)
                    {
                        windowname = "Rendering";
                    }
                    else
                    {
                        windowname = "Rendering";
                    }
      
                    IntPtr ip = FindWindowByCaption(0, windowname);
                    SetForegroundWindow(ip);
                    currentstep = 2;
                }
                else if (currentstep == 2)
                {
                    label1.Text = "Starting rendering...";
                currentstep = 3;
                }
                else if (currentstep == 3)
                {
                    //InputSimulator.SimulateKeyDown(VirtualKeyCode.LSHIFT);
                    InputSimulator.SimulateKeyPress(VirtualKeyCode.TAB);
                    InputSimulator.SimulateKeyPress(VirtualKeyCode.VK_R);
                    //InputSimulator.SimulateKeyUp(VirtualKeyCode.LSHIFT);
                    currentstep = 4;
                }
                else if (currentstep == 4)
                {
                    if (GetActiveWindowTitle() == "Render-Fortschritt" || GetActiveWindowTitle() == "Rendering Progress")
                    {
                        label1.Text = "Rendering...";
                        currentstep = 5;
                    }
                }
                else if (currentstep == 5)
                {
                    if (GetActiveWindowTitle() == "Rendern" || GetActiveWindowTitle() == "Rendering")
                    {
                        if (checkBox2.Checked == true)
                        {
                            label1.Text = "Saving image to project...";
                            currentstep = 601;
                        }
                        else
                        {
    
                            if (checkBox3.Checked == true)
                            {
                                currentstep = 611;
                            }
    
                            if (checkBox4.Checked == true)
                            {
                                currentstep = 621;
                            }
                            else
                            {
                                currentstep = 700;
                            }
                           
                        }
                    }
                }
                else if (currentstep == 601)
                {
                    if (revitApp.Application.Language == Autodesk.Revit.ApplicationServices.LanguageType.German)
                    {
                        InputSimulator.SimulateKeyDown(VirtualKeyCode.LSHIFT);
                        InputSimulator.SimulateKeyPress(VirtualKeyCode.VK_P);
                        InputSimulator.SimulateKeyUp(VirtualKeyCode.LSHIFT);
                        currentstep = 602;
                    }
                    else if (revitApp.Application.Language == Autodesk.Revit.ApplicationServices.LanguageType.English_USA)
                    {
                        InputSimulator.SimulateKeyDown(VirtualKeyCode.LSHIFT);
                        InputSimulator.SimulateKeyPress(VirtualKeyCode.VK_V);
                        InputSimulator.SimulateKeyUp(VirtualKeyCode.LSHIFT);
                        currentstep = 602;
                    }
                    else
                    {
                        InputSimulator.SimulateKeyDown(VirtualKeyCode.LSHIFT);
                        InputSimulator.SimulateKeyPress(VirtualKeyCode.VK_V);
                        InputSimulator.SimulateKeyUp(VirtualKeyCode.LSHIFT);
                        currentstep = 602;
                    }
    
                }
                else if (currentstep == 602)
                {
    
                    InputSimulator.SimulateKeyPress(VirtualKeyCode.EXECUTE);
                    if (checkBox3.Checked == true)
                    {
                        currentstep = 611;
                    }
                    else  if (checkBox4.Checked == true)
                    {
                        currentstep = 621;
                    }
                    else
                    {
                        currentstep = 700;
                    }
    
                }
                else if (currentstep == 611)
                {
                    if (checkBox3.Checked == true)
                    {
                        label1.Text = "Saving JPG to projectfolder...";
                        currentstep = 612;
                    }
                    else
                    {
                        if (checkBox4.Checked == true)
                        {
                            currentstep = 621;
                        }
                        else
                        {
                            currentstep = 700;
                        }
                    }
                }
                else if (currentstep == 612)
                {
                    if (revitApp.Application.Language == Autodesk.Revit.ApplicationServices.LanguageType.German)
                    {
                        InputSimulator.SimulateKeyDown(VirtualKeyCode.LSHIFT);
                        InputSimulator.SimulateKeyPress(VirtualKeyCode.VK_X);
                        InputSimulator.SimulateKeyUp(VirtualKeyCode.LSHIFT);
                        currentstep = 613;
                    }
                    else if (revitApp.Application.Language == Autodesk.Revit.ApplicationServices.LanguageType.English_USA)
                    {
                        InputSimulator.SimulateKeyDown(VirtualKeyCode.LSHIFT);
                        InputSimulator.SimulateKeyPress(VirtualKeyCode.VK_X);
                        InputSimulator.SimulateKeyUp(VirtualKeyCode.LSHIFT);
                        currentstep = 613;
                    }
                    else
                    {
                        InputSimulator.SimulateKeyDown(VirtualKeyCode.LSHIFT);
                        InputSimulator.SimulateKeyPress(VirtualKeyCode.VK_X);
                        InputSimulator.SimulateKeyUp(VirtualKeyCode.LSHIFT);
                        currentstep = 613;
                    }
                }
                else if (currentstep == 613)
                {
                    DateTime dt = DateTime.Now;
    
    
                         InputSimulator.SimulateTextEntry(System.IO.Path.GetDirectoryName(Doc.PathName) + "\\" + myArr[currentview].ToString() + " " + String.Format("{0:yyyy_MM_dd HH.mm.ss}", dt) + ".jpg");
                        InputSimulator.SimulateKeyPress(VirtualKeyCode.EXECUTE);
                        if (checkBox4.Checked == true)
                        {
                            currentstep = 621;
                        }
                        else
                        {
                            currentstep = 700;
                        }
    
                }
                else if (currentstep == 621)
                {
                    if (checkBox2.Checked == true)
                    {
                        label1.Text = "Saving PNG to projectfolder...";
                        currentstep = 622;
                    }
                    else
                    {
                        currentstep = 700;
                    }
                }
                else if (currentstep == 622)
                {
                    if (revitApp.Application.Language == Autodesk.Revit.ApplicationServices.LanguageType.German)
                    {
                        InputSimulator.SimulateKeyDown(VirtualKeyCode.LSHIFT);
                        InputSimulator.SimulateKeyPress(VirtualKeyCode.VK_X);
                        InputSimulator.SimulateKeyUp(VirtualKeyCode.LSHIFT);
                        currentstep = 623;
                    }
                    else if (revitApp.Application.Language == Autodesk.Revit.ApplicationServices.LanguageType.English_USA)
                    {
                        InputSimulator.SimulateKeyDown(VirtualKeyCode.LSHIFT);
                        InputSimulator.SimulateKeyPress(VirtualKeyCode.VK_X);
                        InputSimulator.SimulateKeyUp(VirtualKeyCode.LSHIFT);
                        currentstep = 623;
                    }
                    else
                    {
                        InputSimulator.SimulateKeyDown(VirtualKeyCode.LSHIFT);
                        InputSimulator.SimulateKeyPress(VirtualKeyCode.VK_X);
                        InputSimulator.SimulateKeyUp(VirtualKeyCode.LSHIFT);
                        currentstep = 623;
                    }
                }
                else if (currentstep == 623)
                {
                    DateTime dt = DateTime.Now;
    
    
                    InputSimulator.SimulateTextEntry(System.IO.Path.GetDirectoryName(Doc.PathName) + "\\" + myArr[currentview].ToString() + " " + String.Format("{0:yyyy_MM_dd HH.mm.ss}", dt) + ".png");
                    InputSimulator.SimulateKeyPress(VirtualKeyCode.EXECUTE);
                    currentstep = 700;
    
                }
                else if (currentstep == 700)
                {
                    InputSimulator.SimulateKeyPress(VirtualKeyCode.ESCAPE);
                    if (checkBox1.Checked == true)
                    {
                        currentstep = 631;
                    }
                    else
                    {
                        currentstep = 9;
                    }
                }
                else if (currentstep == 631)
                {
    
                    if (checkBox1.Checked == true)
                    {
                        label1.Text = "Saving project...";
                        currentstep = 632;
                    }
                    else
                    {
                        currentstep = 9;
                    }
                }
                else if (currentstep == 632)
                {
    
                    InputSimulator.SimulateKeyPress(VirtualKeyCode.LMENU);
                    InputSimulator.SimulateKeyPress(VirtualKeyCode.VK_2);
                    currentstep = 633;
    
                }
                else if (currentstep == 633)
                {
    
                    currentstep = 9;
    
                }
                else if (currentstep == 9)
                {
    
                    currentview += 1;
                    if (currentview > myArr.Length - 1)
                    {
                        currentstep = 10;
                        System.Windows.Forms.MessageBox.Show("Rendering finished!", "Rendering finished!", System.Windows.Forms.MessageBoxButtons.OK);
    
    
    
                    }
                    else
                    {
                        label1.Text = "Next view...";
                        currentstep = 1;
                    }
    
                }
    
                else if (currentstep == 10)
                {
    
                    this.Close();
                }
    
            }

  6. #6
    Utente di HTML.it L'avatar di oregon
    Registrato dal
    Jul 2005
    residenza
    Roma
    Messaggi
    36,480
    Sicuro che

    myArr

    sia stato istanziato ?


    P.S. Ho capito che normalmente funziona ma non è importante ... bisogna capire perché, in determinati casi, non va ...
    No MP tecnici (non rispondo nemmeno!), usa il forum.

  7. #7
    Utente di HTML.it
    Registrato dal
    Dec 2007
    Messaggi
    489
    si myarr ´´e apposto, l errore non glielo da subito, glielo da a random dopo 10-30 secondi dall esecuzione del programma, e questo timer ha un intervallo di 2 secondi dunque viene eseguito qualche volta prima di impiantarsi e legge correttamente da myarr.

  8. #8
    Utente di HTML.it
    Registrato dal
    Dec 2007
    Messaggi
    489
    ho visto ora che le ultime righe del primo post indicano che 2 DLL l utente le ha sul disco fisso D:\

    questo programma ´´e un plugin per un programma della autodesk, installato su C:\

    potrebbe essere che avendo le 2 dll su D:\ non funzioni?

  9. #9
    Utente di HTML.it L'avatar di oregon
    Registrato dal
    Jul 2005
    residenza
    Roma
    Messaggi
    36,480
    Il codice è abbastanza confuso e non è possibile capire quale possa essere l'errore se non eseguendolo e debuggandolo.

    Prova a modificare il codice per visualizzare il valore di

    currentstep

    in modo da capire quanto vale quando si manifesta l'errore e circoscrivere la parte di codice interessata.
    No MP tecnici (non rispondo nemmeno!), usa il forum.

  10. #10
    Utente di HTML.it
    Registrato dal
    Dec 2007
    Messaggi
    489
    si trova sempre nella fase di rendering dato che ´´e una fase molto lunga. (currentstep = 5)

    codice:
      private string GetActiveWindowTitle()
            {
                const int nChars = 256;
                IntPtr handle = IntPtr.Zero;
                StringBuilder Buff = new StringBuilder(nChars);
                handle = GetForegroundWindow();
    
                if (GetWindowText(handle, Buff, nChars) > 0)
                {
                    return Buff.ToString();
                }
                return null;
            }

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.