Plugin not loading (16.4 beta)
Plugin not loading (16.4 beta)
Hello-
My plugin suddenly won't load in 16.4b.
No errors in the debugger, it simply doesn't load at all.
I downloaded and installed the Perio Voice Chart plugin which seems to load, although a popup window says "There was an error with the Voice Command Plugin" before the perio chart loads.
How do I track this down?
My plugin suddenly won't load in 16.4b.
No errors in the debugger, it simply doesn't load at all.
I downloaded and installed the Perio Voice Chart plugin which seems to load, although a popup window says "There was an error with the Voice Command Plugin" before the perio chart loads.
How do I track this down?
Last edited by wjstarck on Sun Jan 01, 2017 5:40 pm, edited 1 time in total.
Cheers,
Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA
Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA
Re: Plugin not loading 16.4 beta
FYI, I reverted all the way back to revision 15861, but the problems persists.
Then I hopped into my way back machine and went back to revision 15497, which was around November 1st. And the plugin loads then, so it seems something might have changed on your side between now and then.
Thanks
Then I hopped into my way back machine and went back to revision 15497, which was around November 1st. And the plugin loads then, so it seems something might have changed on your side between now and then.
Thanks
Cheers,
Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA
Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA
Re: Plugin not loading 16.4 beta
OK I tracked down the source of the problem
The change from
to
on FormOpenDental.cs (lines 464-473) is causing an exception "FormOpenDental.CurPatNum not found" to be thrown on OpenDentBusiness.Plugins.cs at line 146 when my plugin tries to load, and so the plugin does not load at all.
What do you recommend?
The change from
Code: Select all
public static long CurPatNum;
Code: Select all
public static long CurPatNum {
get { return _curPatNum; }
set {
if(value==_curPatNum) {
return;
}
_curPatNum=value;
ODEvent.Fire(new ODEventArgs("PatNumChanged",value));
}
}
What do you recommend?
Cheers,
Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA
Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA
Re: Plugin not loading (16.4 beta)
In regards to the Perio Chart Voice plugin, there should be a folder in the Open Dental installation directory (or in the Debug or Release folder if you're running compiled) that is named "VoiceCommandPlugin". If you could email me the contents of error log file, I can take a look.
chris@opendental.com
chris@opendental.com
Re: Plugin not loading (16.4 beta)
I recommend just utilizing the public static directly like FormOpenDental.CurPatNum if you aren't already. Heed the following plugin example:
The above code will no longer work and the message box section needs to be replaced with:
Code: Select all
using OpenDental;
using OpenDentBusiness;
using System.Windows.Forms;
namespace PluginSimple {
public class Plugin:PluginBase {
public override bool HookAddCode(object sender,string hookName,params object[] parameters) {//required method
return false;
}
public override bool HookMethod(object sender,string hookName,params object[] parameters) {//required method
switch(hookName) {
case "FormOpenDental.OnCommlog_Click":
if(sender.GetType()==typeof(FormOpenDental)) {
MessageBox.Show("The currently selected PatNum is: "+((FormOpenDental)sender).CurPatNum);
}
return true;
default:
return false;
}
}
}
}
Code: Select all
MessageBox.Show("The currently selected PatNum is: "+FormOpenDental.CurPatNum);
The best thing about a boolean is even if you are wrong, you are only off by a bit.
Jason Salmon
Open Dental Software
http://www.opendental.com
Jason Salmon
Open Dental Software
http://www.opendental.com
Re: Plugin not loading (16.4 beta)
Hmmnm, that's what I'm already doing?
Here is a sample of some of my HookAddCode:
Here is a sample of some of my HookAddCode:
Code: Select all
public override bool HookAddCode(object sender, string hookName, params object[] parameters){//required method
switch (hookName){ //generally in alphabetical order unless grouped by function
case "ContrAppt.ContrApptSheet2_MouseLeave_end": //sets number of saved IV or GA anesthetic records in Anesthetic Record subMenuItems
FormOpenDentalA.RefreshMenuItems((ContrAppt)sender, FormOpenDental.CurPatNum);
return true;
case "ContrChart.gridProg_MouseUp_end": //Adds an enhanced contextual menu to menuProgRight that allows user to set ProcStatus without having to enter each individual Proc
if (AnesthPrefs.AddEnhancedMenuItems() == true) {//toggle pref depending on user pref
contrChartA = new ContrChartA();
contrChartA.AddEnhancedMenu((ContrChart)sender, (ContextMenu)parameters[0], (OpenDental.UI.ODGrid)parameters[1],(Patient)parameters[2]);
}
return true;
case "ContrChart.ModuleSelected_end": //Dynamic chart refresh
contrChartA = new ContrChartA();
object sender2 = new object();
sender2 = sender;
contrChart = (ContrChart)sender2;
try {//in the event that anesthesia prefs are selected from formOpenDental
sender2 = contrChart.ParentForm;
} catch { }
if (AnesthPrefs.DynChartRefresh() == true && !runOnce) {
FormOpenDentalA formOpenDentalA = new FormOpenDentalA();
contrChartA.ModuleSelected_end((FormOpenDental)sender2, FormOpenDental.CurPatNum);
runOnce = true;
}
return true;
}
Cheers,
Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA
Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA
Re: Plugin not loading (16.4 beta)
Your code worked just fine for me and I implemented it as follows:
Maybe your project references are bad or simply need to be recompiled for the new version?
Code: Select all
using OpenDental;
using OpenDentBusiness;
using System.Windows.Forms;
using System;
using OpenDental.UI;
namespace PluginSimple {
public class Plugin:PluginBase {
private ContrChart contrChart;
private ContrChartA contrChartA;
private bool runOnce;
public override bool HookAddCode(object sender,string hookName,params object[] parameters) {//required method
switch(hookName) { //generally in alphabetical order unless grouped by function
case "ContrAppt.ContrApptSheet2_MouseLeave_end": //sets number of saved IV or GA anesthetic records in Anesthetic Record subMenuItems
FormOpenDentalA.RefreshMenuItems((ContrAppt)sender,FormOpenDental.CurPatNum);
return true;
case "ContrChart.gridProg_MouseUp_end": //Adds an enhanced contextual menu to menuProgRight that allows user to set ProcStatus without having to enter each individual Proc
if(AnesthPrefs.AddEnhancedMenuItems() == true) {//toggle pref depending on user pref
contrChartA = new ContrChartA();
contrChartA.AddEnhancedMenu((ContrChart)sender,(ContextMenu)parameters[0],(OpenDental.UI.ODGrid)parameters[1],(Patient)parameters[2]);
}
return true;
case "ContrChart.ModuleSelected_end": //Dynamic chart refresh
contrChartA = new ContrChartA();
object sender2 = new object();
sender2 = sender;
contrChart = (ContrChart)sender2;
try {//in the event that anesthesia prefs are selected from formOpenDental
sender2 = contrChart.ParentForm;
}
catch { }
if(AnesthPrefs.DynChartRefresh() == true && !runOnce) {
FormOpenDentalA formOpenDentalA = new FormOpenDentalA();
contrChartA.ModuleSelected_end((FormOpenDental)sender2,FormOpenDental.CurPatNum);
runOnce = true;
}
return true;
default:
return false;
}
}
public override bool HookMethod(object sender,string hookName,params object[] parameters) {//required method
switch(hookName) {
case "FormOpenDental.OnCommlog_Click":
if(sender.GetType()==typeof(FormOpenDental)) {
MessageBox.Show("The currently select PatNum is: "+FormOpenDental.CurPatNum);
}
return true;
default:
return false;
}
}
public override void HookException(Exception e) {
MessageBox.Show(e.Message);
}
}
internal class ContrChartA {
public ContrChartA() {
}
internal void AddEnhancedMenu(ContrChart sender,ContextMenu contextMenu,ODGrid oDGrid,Patient patient) {
throw new NotImplementedException();
}
internal void ModuleSelected_end(FormOpenDental sender2,long curPatNum) {
throw new NotImplementedException();
}
}
internal class AnesthPrefs {
internal static bool AddEnhancedMenuItems() {
throw new NotImplementedException();
}
internal static bool DynChartRefresh() {
throw new NotImplementedException();
}
}
internal class FormOpenDentalA {
internal static void RefreshMenuItems(ContrAppt sender,long curPatNum) {
throw new NotImplementedException();
}
}
}
The best thing about a boolean is even if you are wrong, you are only off by a bit.
Jason Salmon
Open Dental Software
http://www.opendental.com
Jason Salmon
Open Dental Software
http://www.opendental.com
Re: Plugin not loading (16.4 beta)
Wow.
I hereby officially proclaim January 3rd as "Jason Salmon is a Genius" day!
Turns out all my OD references were pointing to 16.3 folders.
Fixed now, thanks Jason.
I hereby officially proclaim January 3rd as "Jason Salmon is a Genius" day!
Turns out all my OD references were pointing to 16.3 folders.

Fixed now, thanks Jason.
Cheers,
Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA
Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA