By Ertan Deniz - 2/4/2008
I've changed the BaseForm.vb as Public Class BaseForm Inherits MyBaseForm Implements MicroFour.StrataFrame.UI.Windows.Forms.IContainerControl MyBaseForm is inhereted from Devexpress XtraForm. I 've got error message below in design time when SimpleButton (Devexpress wrapped) object were dropped on my form. My form is based on StandartForm which is based on my changed BaseForm. With Textedit Object there is no similar error. "The object that the business object has been dropped on must be implement MicroFour.strataFrame.UI.Windows.Forms.IcontainerControl" IContainerControl Interface is implemented on baseform class but is not root (base class) now, Do I implement this interface on my base class ? I've tried to set Business Object property of text control, I couldn't see BusinessObject in the list. |
|
By Ertan Deniz - 2/4/2008
The second scenario ;BaseForm was changed to be inhereted from Devexpress XtraForm. I ve developed a test form and tested it. Testing and functionality was successful. Then, Base form was changed to be inhereted from MyBaseForm. I've got the error messages below. (Base and UI Dlls are included in the projects) The type 'MicroFour.StrataFrame.UI.Windows.Forms.IBusinessBindable' is defined in an assembly that is not referenced. You must add a reference to assembly 'MicroFour StrataFrame Base, Version=1.6.0.0, Culture=neutral, PublicKeyToken=99fe9917f71608a7'. The type 'MicroFour.StrataFrame.UI.Windows.Forms.IInitializeBusinessObject' is defined in an assembly that is not referenced. You must add a reference to assembly 'MicroFour StrataFrame UI, Version=1.6.0.0, Culture=neutral, PublicKeyToken=99fe9917f71608a7'. The type 'MicroFour.StrataFrame.UI.ILocalizable' is defined in an assembly that is not referenced. You must add a reference to assembly 'MicroFour StrataFrame Base, Version=1.6.0.0, Culture=neutral, PublicKeyToken=99fe9917f71608a7'. The type 'MicroFour.StrataFrame.UI.IInitOnFormLoad' is defined in an assembly that is not referenced. You must add a reference to assembly 'MicroFour StrataFrame Base, Version=1.6.0.0, Culture=neutral, PublicKeyToken=99fe9917f71608a7'.
|
By Trent L. Taylor - 2/5/2008
Ertan,First, it would be my recommendation to leave BaseForm alone. There is a lot of logic in this class and by you changing you can break the entire framework as it relates to form interaction. If you want to have the DevExpress XtrataForm as a base class, then create an entirely different class and copy the code from the BaseForm and implement the logic that way. Second, the reference exceptions you are getting are not SF related...but .NET related. Check your references and make sure that if you select the reference that the path is pointing to viable SF reference....also, since you are changing the SF source code you forcing this error yourself since you changed the BaseForm, rebuilt, and more than likely did not get out. By changing the BaseForm class you are going to inherantly break a number of other classes and we will not be able to support the downstream effects that this may cause. Third, what you are trying to do is not an SF related issue. As you know we are always willing to give suggestions and help where we can on items outside of SF, but making changes to the source code in this fashion is a really bad ida and something that we do not even do within out medical software. This is why should should do this OUTSIDE of the framework source code. Finally, I created a sample for you on how to do this. I also changed the Business assembly to expose two Friend methods to make this easier for you. This should be enough to get you going...keep in mind that all of this really had nothing to do with SF...it was all about inheritance and .NET. I just made some changes to reduce the forum chatter and get you going more quickly. You will need to drag the Business assembly into the GAC and copy it to the C:\Program files\common files\microfour\strataframe folder for the sample to work.
|
By Ertan Deniz - 2/5/2008
I couldn't found any error, When I was testing changed BaseForm class inhereted from Devexpress XtraForm. But you are right. The change of source like this may be problem in the future and hard to follow. My problem is with my baseform (It is inhereted from XtraForm). It has logic implemented to serve our forms. I think We get the problems due to this hiyerarcy.I have tried many ways like re-implementing the IContainerControl in the sample form, Compiling strataframe source with my base dll. I've followed your instructions. Your sample does not work. I've got the error below : 'RemoveObjectFromInitOnFormLoad' cannot implement 'RemoveObjectFromInitOnFormLoad' because there is no matching sub on interface 'MicroFour.StrataFrame.UI.Windows.Forms.IContainerControl'.
|
By Ertan Deniz - 2/6/2008
I've copied BaseForm and Standart Form. New BaseForm is inhereted from MyBase (Which is inheretd from Devexpress xtraForm).I've compiled succesfully without strong names (Because some of my related ddls does not have strong name). In my tests, I've used these dlls from bin directory not from Common files and GAC. (I've not copied them into common files and GAC) I've got nearly same errors. I think different versions of dlls from these places conflict each other. (May I have missing information) Is it necessary to put the dlls into gac and common files. I mean, May "My bin directory,Common files and GAC" be different? I ve also tested CRM sample with compiled dlls and I've got errors like 'unable to cast of object type 'BusinessObject' to Microfour..BusinessLayerBase'
|
By Trent L. Taylor - 2/6/2008
Ertan,There is not much else that I think that I can do for you here.....I spent nearly an hour the other day making changes to the framework and creating this sample for you which really has nothing to do with SF but DevExpress. We were not obligated to do this since you are trying to make changes to a core piece of the framework and we do not actually support the DevExpress XtraForm...but I wanted to help since we value your business. The problems that you seem to be fighting are simply namespace and inheritence issues (standard .NET programming). I have run the sample on several machines and it does in fact work....so I am not sure where you are running into your issue. You seem to be stuck on the IContainerControl implementation, but there is MUCH more that has to take place....and if you look at the sample I created for you, it does work. Even though I disagree with this approach that you are trying to take because as soon as we make a change to BaseForm you will not get this update....regardless, be sure that you are running on the 1.6.5 beta and then copy the attached business assembly into your GAC...I made changes specifically for you so that you could do this. I created a sample, made changes to the framework, and tried to make it as clear as I possibly could. I hope that you find your issue here as I am not sure that there is anything else I can say...sorry
|
By Ertan Deniz - 2/6/2008
I've tried sample on the version 1.6.0 (Original Purchased copy)This may be the source of the error. I'm trying to find alternatif ways but all the forms must be inhereted from our baseform.
|
By Ertan Deniz - 2/6/2008
Information Purposes only ;Your standart BaseForm or new baseform must be inhereted from our base form. Otherwise, The forms does not work in our application.This means minimal change on the framework code. There is no need to implement anything. I 've copied BaseForm to a NewBaseForm. Try to use NewBaseForm, I 've got cast error 'Framework is trying to cast with its baseform in ChildDialog.vb.'
|
By Trent L. Taylor - 2/6/2008
Again, you are fighting standard inheritance issues. If you just take the sample I gave you and inherit the MyBaseForm class off of YOUR base form instead of the DevExpress XtraForm then it should work...that is ALL that you should have to do!
|
By Ertan Deniz - 2/6/2008
I've understand that my case was not SF related. (Inheretance Issues)Can I get the changes you make in the Business Dll ? Do these changes will be included in the new releases ? (Final build 1.6.5)
|
By Ertan Deniz - 2/6/2008
I've installed 1.6.5 Beta version and followed the instructions to run the sample.At First, I've got an error. But Next time, I couldn't get the same error. Now, Sample is running correctly. Our Devexpress version is 7.1. To go ahead with testing Inhereted UI, I need sources codes of the beta version to update Dll references.
|
By Ertan Deniz - 2/6/2008
I've gone some steps further to make ready for our project ;- Move the forms into a class library project (*.dll) - Run sample form by using dll (above) It works as your sample (Shows the form). I've added a BusinessObject to test project and got the error while loading the designer ; "Could not load type 'MicroFour.StrataFrame.Business.BaseBusinessObjectAttribute' from assembly 'MicroFour StrataFrame Base, Version=1.6.0.0, Culture=neutral, PublicKeyToken=99fe9917f71608a7'" Business Object Mapper also fails when configuring the project (Choose project); BusinessLayerException An error occurred while saving an the data to the server. TypeLoadException Could not load type 'MicroFour.StrataFrame.Security.DataAuditAction' from assembly 'MicroFour StrataFrame Base, Version=1.6.0.0, Culture=neutral, PublicKeyToken=99fe9917f71608a7'.
|
By Trent L. Taylor - 2/7/2008
Yeah, that could be. Add this (MicroFour StrataFrame Base) assembly to your GAC and c:\program files\common files\microfour\strataframe as well...I will be doing a full rebuild of the 1.6.5 beta late this week or this weekend which will include these updated assemblies, but go ahead and add this one manually for the time being.
|
By Trent L. Taylor - 2/7/2008
Can I get the changes you make in the Business Dll ? Do these changes will be included in the new releases ? (Final build 1.6.5) These changes are in the Business assembly posted in the previous post. Be sure to copy down the Base assembly from your other post as well to get around the BaseBusinessObjectAttribute error. Yes, these will all be included in the final build of 1.6.5.
|
By Chan - 2/8/2008
Hi,
Thank for great sample.
I also changed the Business assembly to expose two Friend methods to make this easier for you.
Did you change this in latest release as well?
Thank you
|
By Chan - 2/8/2008
Hi,
I am not sure if it is practical. However, I would think if SF team could provides code snippet, template or anything similar for all interface such as IContrainerControl, IBusinessBinding and etc since 90% of code as same everytime we want to implement these interfaces to our custom controls.
From every release, we (SF user) don't know what is changed or broken. Instead, we know what we need to change. Therefore, I would think it is very helpful if we just use code snippet/template shipped with new release, and change any custom code required.
Thank you
|
By Trent L. Taylor - 2/9/2008
Did you change this in latest release as well?
Yes. This is in the latest build. You can get it from here: http://forum.strataframe.net/FindPost14233.aspx .
|