none
"Common Language Runtime detected an invalid program" on Windows 10 but not Windows 7 RRS feed

  • Question

  • I created a program on my old computer (which has Windows 7) around 2013 or so. Now, I am trying to add some features to it, but I can't for the life of me get it to run properly on my new computer (which has Windows 10). It still runs fine on the old computer, but the old computer is slow as molasses.

    When I make a call to another program, I get this error.
    "Unable to cast object of type 'System.Int32' to type 'System.Single[]'."

    I think the other program is trying to return an error code instead of the data it's supposed to.

    When I try to get this data without trying to assign it to a variable, I get this information.
        Data: {System.Collections.ListDictionaryInternal}

        HResult: -2146233030
        HelpLink: Nothing
        InnerException: Nothing
        Message: "Common Language Runtime detected an invalid program."
        Source: Nothing
        StackTrace: Nothing
        TargetSite: Nothing

    What can I do to fix this second error? Is it a problem with my program or the program I'm trying to get the data from?
    Thursday, May 25, 2017 2:57 AM

All replies

  • Hi ransomedbyfire86,

    Welcome to the MSDN forum.

    Refer to your description, your issue is about the development issue. Since our forum is to discuss the VS IDE, could you please share more detail information about your programs and part of your code that throw this error message?

    It will help us to search a appropriate forum for your issue, so that you can get a more professional support to solve this issue, thank you for your cooperation.

    Best regards,

    Sara


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, May 26, 2017 2:05 AM
  • Oops! I wasn't sure where to post this and couldn't find the right forum.

    The program retrieves stock prices and other indicators such as moving averages from a program called Investors' FastTrack using FTShell3.clsFTShell3. Line 1465, which throws the error, simply retrieves one of these pieces of data and assigns it to a variable. This code has worked for me for years without any problems until I got a new computer with Windows 10 and Visual Studio 2015.
    ====================================================
           Dim fttradedate, ftstartdate, ftenddate, bsymbolstart

            Dim BParam1, BParam2, BParam3, BParam4
            Dim SParam1, SParam2, SParam3, SParam4
            Dim param1args(3), param2args(3)
            Dim param3args(3), param4args(3)
            Dim bprices, sprices, cprices
            Dim BSMA1(), BEMA1(), BRSI1()
            Dim BSMA2(), BEMA2(), BRSI2()
            Dim BSMA3(), BEMA3(), BRSI3()
            Dim BSMA4(), BEMA4(), BRSI4()
            Dim SSMA1(), SEMA1(), SRSI1()
            Dim SSMA2(), SEMA2(), SRSI2()
            Dim SSMA3(), SEMA3(), SRSI3()
            Dim SSMA4(), SEMA4(), SRSI4()
            Dim SME1(), SME2(), SME3(), SME4()
            Dim BMEFEMA1(), BMESEMA1()
            Dim BMEFEMA2(), BMESEMA2()
            Dim BMEFEMA3(), BMESEMA3()
            Dim BMEFEMA4(), BMESEMA4()
            Dim bsignal, ssignal, bsymbolposition, ssymbolposition, signal3, signals
            Dim tradeinfo, symbol1, symbol2
            Dim sd, ed, pd
            Dim TReturn, TMDD, TMDDStart
            Dim TMDDEnd, bestreturn, tradenum
            Dim bparampct, sparampct
            Dim selltarget, buytarget
            Dim yMin, yMax
            Dim xValue, yvalue, stradesinfo
            Dim targetBParam1, targetBParam2
            Dim targetBParam3, targetBParam4
            Dim targetprice, SFactor
            Dim RSIDay, RSIGain
            Dim AvgUp, AvgDown
            Dim SymReturn, lasttradenum
            Dim buydate, selldate, FoundRank, pdstart
            Dim minbparampct, maxbparampct, incbparampct
            Dim minsparampct, maxsparampct, incsparampct
            Dim toptenreturns(10), pdreturn, breturn, sreturn, creturn
            Dim gridrow, docount

            Dim dd1 = DropDown1.SelectedItem
            Dim dd2 = DropDown2.SelectedItem
            Dim dd3 = DropDown3.SelectedItem
            Dim dd4 = DropDown4.SelectedItem

            Dim perftype = Trades.PerformanceList.SelectedItem
            Dim lookbacktype = LBType.SelectedItem

    1079:   On Error GoTo exitsub

    1081:   If ft Is Nothing Then
    1082:       ft = New FTShell3.clsFTshell3
    1083:   End If


    ...

    1459:                                               If InStr(dd2, "Simple") Then
                                                            'debug.print("bprices(1)=" & bprices(1) & " on line 359 of gettrades")
    1461:                                                   BSMA2 = ft.SimpleMovingAvg(bprices, param2args(param2argnum), 1, ftenddate)
    1462:                                               ElseIf InStr(dd2, "Exponential") Then
                                                            'on error resume next
                                                            'debug.print("bprices(1)=" & bprices(1) & " on line 361 of gettrades")
                                                            On Error Resume Next
    1465:                                                   BEMA2 = ft.MovingAvg(bprices, param2args(param2argnum), 1, ftenddate)
                                                            'Debug.Assert Err.Description = ""
    1466:                                                   On Error GoTo exitsub
    1467:                                               ElseIf InStr(dd2, "RSI") Then
                                                            'debug.print("bprices(1)=" & bprices(1) & " on line 363 of gettrades")
    1469:                                                   BRSI2 = ft.RSI(bprices, param2args(param2argnum), 1, ftenddate)
    1470:                                               ElseIf InStr(dd2, "MACD EMA") Then
    1471:                                                   BMESEMA2 = ft.MovingAvg(bprices, param2args(0), 1, ftenddate)
    1472:                                                   BMEFEMA2 = ft.MovingAvg(bprices, param2args(1), 1, ftenddate)

    1474:                                                   ME2 = MACDEMA(bsymbol, ftstartdate, ftenddate, bprices, BMEFEMA2, BMESEMA2, param2args(2))
    1475:                                               ElseIf InStr(dd2, "MACD") Then
    1476:                                                   BFEMA2 = ft.MovingAvg(bprices, param2args(0), 1, ftenddate)
    1477:                                                   BSEMA2 = ft.MovingAvg(bprices, param2args(1), 1, ftenddate)
    1478:                                               End If
    Friday, May 26, 2017 3:42 AM
  • Hi ransomedbyfire86,

    Thank you for your update.

    >> The program retrieves stock prices and other indicators such as moving averages from a program called Investors' FastTrack using FTShell3.clsFTShell3.

    Refer to your description, your issue is about the FastTrack development. As far as I know, it is a third-party software and I also confirmed with our colleague who are responsible for VB development forum, we recommend you redirect to the FastTrack help page: http://invfasttrack.wpengine.com/help/ to seek for a more professional support.

    Maybe something need to upgrade inside this FastTrack program to make it works fine on Windows 10, sorry for this inconvenience and thank you for your understanding.

    Best regards,

    Sara


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, May 26, 2017 5:55 AM