Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.ArgumentOutOfRangeException was unhandled by user code #53

Open
SeeInSeeOut opened this issue Jul 16, 2016 · 5 comments
Open

System.ArgumentOutOfRangeException was unhandled by user code #53

SeeInSeeOut opened this issue Jul 16, 2016 · 5 comments

Comments

@SeeInSeeOut
Copy link

SeeInSeeOut commented Jul 16, 2016

Hi,

I'd used this framework when it was originally released, and come across some work I'd done in 2009 on an old hard drive....so pleased to see the framework is still being developed!

I read through the readme to try make this work with FM 2015 (v15.3.2) however I'm experiencing an error when just having a button to load data on a form.

Using visual studio 2015 Ent.

System.ArgumentOutOfRangeException was unhandled by user code
  HResult=-2146233086
  Message=Non-negative number required.
Parameter name: capacity
  ParamName=capacity
  Source=mscorlib
  StackTrace:
       at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
       at System.Collections.Generic.List`1..ctor(Int32 capacity)
       at FMScoutFramework.Core.Managers.ObjectManager.GetMemoryAddresses(Int32 firstAddress, Int32 numberOfObjects) in C:\Users\X\Source\Repos\FMScoutFramework\VirtualMemory\Managers\ObjectManager.cs:line 261
       at FMScoutFramework.Core.Managers.ObjectManager.GetMemoryAddresses(Expression`1 baseObjectPointer, Func`2 compiledObjectPointer) in C:\Users\X\Source\Repos\FMScoutFramework\VirtualMemory\Managers\ObjectManager.cs:line 248
       at FMScoutFramework.Core.Managers.ObjectManager.RetrieveObjectRealtime[T](Expression`1 baseObjectPointer, Func`2 compiledObjectPointer, List`1 memoryAddresses) in C:\Users\X\Source\Repos\FMScoutFramework\VirtualMemory\Managers\ObjectManager.cs:line 184
       at FMScoutFramework.Core.Managers.ObjectManager.RetrieveObjects[T](Expression`1 baseObjectPointer, Func`2 compiledObjectPointer, List`1 memoryAddresses) in C:\Users\X\Source\Repos\FMScoutFramework\VirtualMemory\Managers\ObjectManager.cs:line 178
       at FMScoutFramework.Core.Managers.ObjectManager.RetrieveObjects[T](Expression`1 baseObjectAddress, Func`2 compiledObjectPointer) in C:\Users\X\Source\Repos\FMScoutFramework\VirtualMemory\Managers\ObjectManager.cs:line 164
       at FMScoutFramework.Core.Managers.ObjectManager.Load(Boolean refreshPersonCache) in C:\Users\X\Source\Repos\FMScoutFramework\VirtualMemory\Managers\ObjectManager.cs:line 49
       at FMScoutFramework.Core.FMCore.LoadDataForCheckedGame(Boolean refreshPersonCache) in C:\Users\X\Source\Repos\FMScoutFramework\FMCore.cs:line 73
       at FMScoutFramework.Core.FMCore.LoadData(Boolean refreshPersonCache) in C:\Users\X\Source\Repos\FMScoutFramework\FMCore.cs:line 53
       at FMScoutFramework.Core.FMCore.LoadData() in C:\Users\X\Source\Repos\FMScoutFramework\FMCore.cs:line 47
       at FMScoutiee.Form1.<loadData_Click>b__2_0() in C:\Users\X\Documents\Visual Studio 2015\Projects\FMScoutiee\FMScoutiee\Form1.cs:line 29
       at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
       at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
  InnerException: 
@ThanosSiopoudis
Copy link
Owner

What operating system please? Is this for Windows?
I'll also need to see the code that handles the button click and loading call to the framework

@SeeInSeeOut
Copy link
Author

SeeInSeeOut commented Jul 19, 2016

Windows

Currently just a form with a button on it.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using System.Windows.Forms;
using FMScoutFramework.Core;
using FMScoutFramework.Core.Entities.InGame;
using System.Diagnostics;

namespace FMScoutiee
{

    public partial class Form1 : Form
    {
        public FMCore fmCore = new FMCore(FMScoutFramework.Core.Entities.DatabaseModeEnum.Realtime);
        public Form1()
        {
            InitializeComponent();
        }

        private void loadData_Click(object sender, EventArgs e)
        {
            fmCore.GameLoaded += new Action(GameLoaded);
            new Action(() => fmCore.LoadData()).BeginInvoke((s) => { }, null);
        }

        public void GameLoaded()
        {
            Debug.WriteLine("Load Done");
        }
    }

}

@SeeInSeeOut
Copy link
Author

Any idea ThanosSiopoudis?

@ThanosSiopoudis
Copy link
Owner

@SeeInSeeOut it is most likely an incompatibility in the framework with the version you are using. Is it from Steam?

@SeeInSeeOut
Copy link
Author

Yes its from Steam.

15.3.2 627042 (m.e v1555)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants