outlookbar
outlookbar
Hi All,
I am developing a plugin and from this plugin i want to click on any particular button of outlookbar control like family, account etc.
I am passing the patient number and then trying to click it programatically but its giving the error of out of memory.
Please help me how can i click on the particular button of outlook bar programmatically.
Regards
Jay nahar
I am developing a plugin and from this plugin i want to click on any particular button of outlookbar control like family, account etc.
I am passing the patient number and then trying to click it programatically but its giving the error of out of memory.
Please help me how can i click on the particular button of outlook bar programmatically.
Regards
Jay nahar
Re: outlookbar
I am using the below code:
ContrAccount ContrAccount2 = (OpenDental.ContrAccount)od.Controls["ContrAccount"];
ContrAccount2.InitializeOnStartup();
ContrAccount2.Visible = true;
formopendental.ActiveControl = ContrAccount2;
ContrAccount2.ModuleSelected(PatNum);
before this code i am closing all the modules. When we are running the above code then line "ContrAccount2.Visible = true;" is giving the error of "out of memory".
ContrAccount ContrAccount2 = (OpenDental.ContrAccount)od.Controls["ContrAccount"];
ContrAccount2.InitializeOnStartup();
ContrAccount2.Visible = true;
formopendental.ActiveControl = ContrAccount2;
ContrAccount2.ModuleSelected(PatNum);
before this code i am closing all the modules. When we are running the above code then line "ContrAccount2.Visible = true;" is giving the error of "out of memory".
Re: outlookbar
It looks like you're just trying to "go to the account module". If that is your goal, you should be able to use our public GoToModule class:
Code: Select all
OpenDental.GotoModule.GotoAccount(PatNum);
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: outlookbar
Thanks for reply.
But getting another error I have triad to -"OpenDental.GotoModule.GotoAccount(PatNum)" is working fine, if patient is already selected but if we just launch open dental(no patient select) and than i have called "OpenDental.GotoModule.GotoAccount(PatNum)" from button click then getting error-
Only Account tab(means directly open GotoModule tab)-
System.ComponentModel.Win32Exception: Error creating window handle.
at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
at System.Windows.Forms.Control.CreateHandle()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.OnVisibleChanged(EventArgs e)
at System.Windows.Forms.ButtonBase.OnVisibleChanged(EventArgs e)
please help me..
Thank in advanced.
But getting another error I have triad to -"OpenDental.GotoModule.GotoAccount(PatNum)" is working fine, if patient is already selected but if we just launch open dental(no patient select) and than i have called "OpenDental.GotoModule.GotoAccount(PatNum)" from button click then getting error-
Only Account tab(means directly open GotoModule tab)-
System.ComponentModel.Win32Exception: Error creating window handle.
at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
at System.Windows.Forms.Control.CreateHandle()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.OnVisibleChanged(EventArgs e)
at System.Windows.Forms.ButtonBase.OnVisibleChanged(EventArgs e)
please help me..
Thank in advanced.
Re: outlookbar
Not having a patient selected should be fine. It should work if you pass it a PatNum of zero. Is that not working?
Code: Select all
///<summary>Goes directly to an Account. Sometimes, patient is selected some other way instead of being passed in here, so OK to pass in a patNum of zero.</summary>
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: outlookbar
Hi,
Thank you for your response.
We are passing the patnum as zero but still its not working.
Can you please provide the sample example.
Regards
Jay Nahar
Thank you for your response.
We are passing the patnum as zero but still its not working.
Can you please provide the sample example.
Regards
Jay Nahar
Re: outlookbar
Often that error occurs due to a memory leak in the program. Perhaps the way you're calling the function (or where you're calling it) is causing the program to create many copies of a single type of window in some sort of loop. The way to tell that is when you launch the program look at task manager for the process. Then when your code gets called, does the memory usage of the program start continually going up? The Windows limit for new window handles is 10,000. If the code is creating more than 10,000 handles for some reason (getting called repeatedly and making new windows maybe) then it will cause this error.
At any rate, it definitely is a memory leak/memory problem with too many windows being created.
At any rate, it definitely is a memory leak/memory problem with too many windows being created.
"To understand what recursion is, you must first understand recursion."
David Graffeo
Open Dental Software
http://www.opendental.com
David Graffeo
Open Dental Software
http://www.opendental.com
Re: outlookbar
Another tip in order to see what you need in the Task Manager, (This is for Windows 7), go to the Task Manager -> Processes tab. Then click on View menu button on the top of the window and click on Select Columns. Check the boxes for USER Objects and GDI Objects. If OpenDental.exe starts blowing up USER or GDI Objects then you know what's taking up all of the handles.
"To understand what recursion is, you must first understand recursion."
David Graffeo
Open Dental Software
http://www.opendental.com
David Graffeo
Open Dental Software
http://www.opendental.com
Re: outlookbar
You must be doing something else that is causing the UE to occur. The following example works just fine for me:jaynahar wrote:We are passing the patnum as zero but still its not working.
Can you please provide the sample example.
Code: Select all
public override bool HookAddCode(object sender,string hookName,params object[] parameters) {//required method
switch(hookName){
case "FormOpenDental.Load_end":
//At this point, Open Dental has loaded with the Appts module selected and no patient.
//This plugin will automatically start with the Account module selected.
OpenDental.GotoModule.GotoAccount(0);
return true;
default:
return false;
}
}
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: outlookbar
Thanks for reply.
Its Working fine, but in Appointment Module need to pass two parameter Date-time and AptNo. so my question is how to pass aptno if not available any appointment.
I have try to pass current date-time and 0 aptno, but getting error.
Please help me.
Thanks in Advanced.
Its Working fine, but in Appointment Module need to pass two parameter Date-time and AptNo. so my question is how to pass aptno if not available any appointment.
I have try to pass current date-time and 0 aptno, but getting error.
Please help me.
Thanks in Advanced.
Re: outlookbar
What error are you getting? If you have an appointment that's been inserted into the database already, the AptNum will not be 0.
"To understand what recursion is, you must first understand recursion."
David Graffeo
Open Dental Software
http://www.opendental.com
David Graffeo
Open Dental Software
http://www.opendental.com
Re: outlookbar
Once again, what you said works just fine for me:
Code: Select all
public override bool HookAddCode(object sender,string hookName,params object[] parameters) {//required method
switch(hookName) {
case "FormOpenDental.Load_end":
//At this point, Open Dental has loaded with the Appts module selected and no patient.
//This plugin will automatically start with the Account module selected.
OpenDental.GotoModule.GotoAccount(0);
Thread.Sleep(1000);//Just shows that we actually switched to the Account module for an entire second.
//Now that the account is showing, simply go back to the Appts module for today's date.
//If the user does not want to change the date that was being viewed, pass DateTime.MinValue which will not change the date being viewed.
OpenDental.GotoModule.GotoAppointment(DateTime.Today,0);
return true;
default:
return false;
}
}
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