Plugin Reference problem 7.3.1

This forum is for programmers who have questions about the source code.
Post Reply
User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Plugin Reference problem 7.3.1

Post by drtech » Wed Sep 29, 2010 12:00 pm

I am trying to get my plugin back in working order after updating to 7.3 and can't figure out what is going on.

debugger says that
TreatmentNoteChanged
does not exist in this context on my hook for fillPtInfo in the chart


This is declared in the chartmodule as public but I can't seem to access it in my plugin. What is wrong?
///<summary>public for plugins</summary>
public bool TreatmentNoteChanged;
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Plugin Reference problem 7.3.1

Post by drtech » Wed Sep 29, 2010 5:25 pm

Another problem with my plugin:
Works fine on a test database, but with my complete database I get this error when trying to start the program with my plugin

"Column count doesn't match value count at row 1"

it does not seem this is coming directly from the code that I can find so I am having a hard time debugging this. What might the problem be?
Last edited by drtech on Thu Sep 30, 2010 6:10 am, edited 1 time in total.
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
jordansparks
Site Admin
Posts: 5744
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Plugin Reference problem 7.3.1

Post by jordansparks » Wed Sep 29, 2010 6:34 pm

For the first error, I think your configuration manager is not setup to compile everything for x86.

For the second error, I think you have added a column to some table in your database.
Jordan Sparks, DMD
http://www.opendental.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Plugin Reference problem 7.3.1

Post by drtech » Thu Sep 30, 2010 6:16 am

how do I go about figuring out where the problem column is?
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
jordansparks
Site Admin
Posts: 5744
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Plugin Reference problem 7.3.1

Post by jordansparks » Thu Sep 30, 2010 7:56 am

A series of breakpoints to progressively narrow it down.
Jordan Sparks, DMD
http://www.opendental.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Plugin Reference problem 7.3.1

Post by drtech » Thu Sep 30, 2010 7:59 am

ok, will have to experiment with that for the column problem.

compiling for x86 solved the other problems. I don't know how that got changed to " All CPUS"
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Plugin Reference problem 7.3.1

Post by drtech » Thu Sep 30, 2010 8:01 am

I removed my plugin table completely and my plugin does not try to access any other different database functions than the main program, so wondering why it would make a database problem with a column only show up when the plugin is enabled....works fine otherwise...
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Plugin Reference problem 7.3.1

Post by drtech » Fri Oct 01, 2010 7:26 pm

Narrowed it down to exactly in the code where the problem is but I still don't know what to do:

OpenDentBusiness.Plugin Line 46 ( plugin.Host=host;) throws an exception.
When I try to follow this code by stepping into it, it goes nowhere.

So the problem is when the plugin is trying to load but I can't really trace anything. Any hints on what I should be looking for as a source of my error here (seems to be before any code in my plugin is loaded, so is this something to do with registered plugins in my database? what table should I be looking at? (This does not happen with a demo database.)
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
jordansparks
Site Admin
Posts: 5744
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Plugin Reference problem 7.3.1

Post by jordansparks » Fri Oct 01, 2010 8:22 pm

Look at PluginBase.cs, line 12. It's virtual. So you're required to implement it in your plugin. For example, in the PluginExample, it runs ConvertPluginDatabase.Begin() in that location, and that's where startup queries are located. If you have done a similar thing, then one of your queries is bad. You might be able to spot which query by looking for a situation where column count won't match your query. You could comment out some of it until you narrow down where. Make sure as you do it that you end up with a fresh dll to test against.
Jordan Sparks, DMD
http://www.opendental.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Plugin Reference problem 7.3.1

Post by drtech » Sat Oct 02, 2010 6:09 am

should the versions of my plugin match the versions of OD it is running on? Previously I had my plugin version 1.0.1.0, 1.0.2.0, 1.0.3.0, etc... Should it be 7.3.2.0 like the main program (which is how the example plugin looks) or does it make any difference?
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Plugin Reference problem 7.3.1

Post by drtech » Sat Oct 02, 2010 7:00 am

aaaahhhhggg!!!

I figured out that the whole time I was wasting my time trying to set breakpoints and change the code in the convertplugindatabase.cs and when I went to debug the project and run it, VS was not building a new verison of my plugin. I guess i have to manually rebuild it and then debug? man...that was frustrating.

Now, with a newly built version, I can comment out my queries and it runs perfectly. You were right, just was having a really hard time since it was giving me an old version of my dll! Now just to figure out what query is the problem...
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Plugin Reference problem 7.3.1

Post by drtech » Sat Oct 02, 2010 11:06 am

solved.

Is there any way to make sure a new version of your DLL (every project) is built every time you click start to debug an entire solution? (I thought it already did this, but I guess not..it is listed 3rd in my build order of OpenDentBusiness, OpenDental, PluginDrTECH)
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
jordansparks
Site Admin
Posts: 5744
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Plugin Reference problem 7.3.1

Post by jordansparks » Mon Oct 04, 2010 9:44 am

Just keep an eye on your configuration manager, especially when new releases come out. The next time this happens to someone, I'll be able to give them better advice. I did say, "your configuration manager is not setup to compile everything for x86". I guess the word "everything" was not prominent enough.
Jordan Sparks, DMD
http://www.opendental.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Plugin Reference problem 7.3.1

Post by drtech » Mon Oct 04, 2010 9:55 am

Thanks for you help with it. When I go months without programming I have a hard time remembering how to fix these little "problems."
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

Post Reply