kayler-renslow / arma-dialog-creator

A dialog/GUI creation tool for Arma 3.
MIT License
76 stars 12 forks source link

"Could not load project." - ControlClass wasn't found #33

Closed rlnt closed 6 years ago

rlnt commented 6 years ago

Version and Build

1.0.5

Summary

Error on loading up an existing project. The program gives out the message "couldn't find ControlClass xy_parent to extend for xy_extended.

Detail

Error log: https://pastebin.com/raw/hhpXtqWS

Since I don't really know how to describe it here's a little overview I made: unbenannt-1

kayler-renslow commented 6 years ago

Can you post your project.xml file as well?

rlnt commented 6 years ago

A project file shouldn't be necessary since you can just create a new project with the control classes I am showing in the image, then just place one single element, save it and then try to load it, you will get this error.

Edit: accidentally closed sorry

kayler-renslow commented 6 years ago

I have recreated the class structure you have described, saved, closed, then reopened the project and I have no errors.

The error described is saying that a class couldn't be found, not that it couldn't be extended. Before class inheritance can be done, they all need to load into memory and be constructed. After they have loaded and constructed, then the classes begin extending other classes. To find the in memory versions, they look through a registry by class names; the registry is how the in memory versions are retrieved. If the registry doesn't find a class by a name, an error is thrown. This error is generally caught throughout the application, but not during project initialization because it's a cause for concern.

What I need the project.xml for is to check if the class is registered in the project save. If it is not, then the class can't ever be loaded into memory, thus registry can't find it, thus an error is thrown.

Also, I need you to get your custom_controls.xml file from your .adc directory as well. Here is how you can find that file (full reference here):

.adc/ │ └── resources/ │ └── custom_controls.xml

rlnt commented 6 years ago

project.zip

kayler-renslow commented 6 years ago

In the project.xml file and the custom_controls.xml files you have shared, both RLNT_RscText_Shadow and RLNT_WH_Amount don't exist.

What I'm suspecting happened is maybe RLNT_RscText_Shadow was a Workspace scoped Control Class and was changed to a Project scoped one. This would mean that RLNT_RscText_Shadow exists in 1 project but isn't shared across all projects in the Workspace. This would explain why it was in a valid state before but now it isn't.

One thing you can do to validate that is check all of your Projects for the RLNT_RscText_Shadow class by just going to Edit Custom Control Classes after opening each project. If you find it, edit it and change the Scope to Workspace. If it is already Workspace, then there is a bug.

rlnt commented 6 years ago

I know because that's not the project that threw the error I posted before. It's just an example project to show you how the error appears, there are only some basic classes like a, b, b2, c, c2. The error for this project would then be: https://pastebin.com/raw/fkMdN1ef When creating the project with the 5 classes and saving it everything works just fine but after closing and opening it again, you get the error "could not load project. couldn't find ControlClass b to extend for c". If you open the control classes management window, all classes are removed but a.

kayler-renslow commented 6 years ago

I opened your project on an empty Workspace and I got the error. When I created the classes in an existing Workspace, the project loaded fine (which I did before I had your project.xml). There is something interesting about my existing Workspace's Custom Control Classes because when I injected them into the Classes you created, your test project loaded just fine. Somehow, the Custom Control Classes in my existing Workspace are keeping the application in a valid state.

I'm using a sorting algorithm to sort the classes to prevent the error this issue is about. Basically, it begins class inheritance for classes that have no extend first, then it loads another wave for ones that have their extended class loaded, and so on.

kayler-renslow commented 6 years ago

Fixed in commit https://github.com/kayler-renslow/arma-dialog-creator/commit/0105f9ad780eadc3abd5556c92e9290f627152db

kayler-renslow commented 6 years ago

fixed in release 1.0.6