Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic CLASS NOT REGISTERED error when clicking on a function in Sol'n explorer (Read 756 times)
Brian Millier
Junior Member
**
Offline


Posts: 35
Location: Halifax N.S.
Joined: Apr 5th, 2014
CLASS NOT REGISTERED error when clicking on a function in Sol'n explorer
Sep 27th, 2021 at 9:55pm
Print Post  
I am using the latest version of VS 2019 and updated VM to the latest version available ( about 1 month ago). I'm programming Teensy MCUs with Arduino 1.8.15 and Teensyduino  1.54.
  As I am writing/editing, after a while I'll start to see CLASS NOT REGISTERED, when I click on a function in the Solution Explorer (to jump to it in my code). Prior to this I have certainly introduced errors in my code since the start of my session, but these have all been corrected i.e. no compiler errors or red Intellisense flags in my code. Searching for some functions still works: I believe only those in the latter section of my code are not found in the search and flagged as above.
   I've encountered this problem very rarely in past years, same issue but but with a different error message I believe.
  My only viable workaround is to erase all of the files in my project folder EXCEPT my source code files. Then, I re-start VS/VM, open the file as an Arduino project and let VS/VM rebuild all  these other files/folders. Note, it doesn't work if I only erase the  .vcxproj, .sln, .filters, .user files. I have to erase the .vs, _vm and  Release folders too (I have not tried to do them just one folder at a time).
This is happening so often now that it is slowing me down significantly.
Anyone know the answer.
Many thanks
Brian Millier   
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2174
Joined: Feb 13th, 2019
Re: CLASS NOT REGISTERED error when clicking on a function in Sol'n explorer
Reply #1 - Sep 28th, 2021 at 10:28am
Print Post  
Thanks for the report.

Can you confirm when adding code files, they are being added from the Solution Explorer view (so they are visible in Solution Explorer once added)?

Are there any specific types of changes or additions which seem to trigger the issue from what you have seen? (adding a class, function etc...?)
  
Back to top
 
IP Logged
 
Brian Millier
Junior Member
**
Offline


Posts: 35
Location: Halifax N.S.
Joined: Apr 5th, 2014
Re: CLASS NOT REGISTERED error when clicking on a function in Sol'n explorer
Reply #2 - Sep 28th, 2021 at 2:19pm
Print Post  
Hi Simon- thanks for the response (quick as usual!). Any additional files that I use are either 1) Arduino/Teensy library files that reside in the Arduino "libraries" folder and are #included at the top of my .ino file or 2) cpp/h files that I create or move to the project folder itself (often my code is published in conjunction with my Circuit Cellar magazine column, and it's easier for the reader if I keep all the library/source files together in one project folder). 
  When I have to clean out the .sln, etc files and Release etc. folders as mentioned in post #1, VS/VM will automatically find all of those files and they will re-appear in the Solution Explorer folder hierarchy, exactly the same as before I erased all but the project's ino file. So, yes, all of the files are visible in the Solution Explorer.
    Although I do sometimes add/modify code in the associated cpp/h library files, I am generally generating/editing code in the main .ino file, and that is the only time this problem crops up (as well as I can remember).
   I use classes when accessing Arduino libraries. While I've written some of my own functions as a class, I have not written/edited/used any of my own classes lately  i.e. since this problem has become so frequenct.
   Also, prior to seeing the CLASS NOT REGISTERED error, sometimes when I click on a function in Sol'n Explorer, it will bring me to a spot in the code which is 10-50 lines of code UP from the actual function itself. There might be a correlation between how many lines of code I have added in my recent editing session, and this offset, but that's hard to know for sure, of course. When this happens, I  can be pretty sure that the CLASS NOT REGISTERED error will occur later in my coding session.
     MY "style" is to write new functions, as needed, and place them at the end of the ino file. I then work on expanding the code in Setup/Loop from there. When this error occurs, it always involves functions that are further on in the program than where I am currently generating new code.
  Beyond the fact that the compiler and Intellisense don't flag any errors, I'm not seeing anything odd when perusing the listing. But, I must be hitting some weird combination of keys to be causing this situation. I'm not sure the depth of the "undo" function, but I might have to try "un-rolling" my work, line by line, to see if I can figure out when the error disappears if indeed it ever does).
  Many thanks
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint