Problems with integration of editor and java.awt

User e3b516b760

15-08-2010 13:12:29

HI,


I'm using  VS 2010 and JChem_NET_API_5_3_7_11 dll files to develop a .NET API. I want to integrate editor into my project. but I'm getting the following error.


 


 


Error 3 The type or namespace name 'Windows' does not exist in the namespace 'ChemAxon.NET' (are you missing an assembly reference?)


 I saw the one of the related previous post and used a sample windowsform given in that post. It worked well for me but when I used the same code and same dll files form the folder which I downloaded with a bunch of dll files didn't worked. Can you help me in this. Or can you send me the same dll files used in that post.




I also have some problems with java.awt as I get the following errors 




Error 14 'Color' is an ambiguous reference between 'System.Drawing.Color' and 'java.awt.Color'

Error 15 'Point' is an ambiguous reference between 'System.Drawing.Point' and 'java.awt.Point'

Error 16 'Point' is an ambiguous reference between 'System.Drawing.Point' and 'java.awt.Point'

Error 17 'Label' is an ambiguous reference between 'System.Windows.Forms.Label' and 'java.awt.Label'

Error 18 'Label' is an ambiguous reference between 'System.Windows.Forms.Label' and 'java.awt.Label'







Thanks,

Sri

 

ChemAxon bd13b5bd77

16-08-2010 06:46:37

Dear Sri,


 


could you please send us the sample project (file) which you get the errors in.
We would like to check the references and the code where your compilation errors are raised.


 


Viktor


 

User e3b516b760

16-08-2010 09:19:36

HI,


 


Here is a sample code where I get problem. In form1 I used just a sample code of my project as I have some passwords in my project which cannot be revealed.


 


In form2 I used marvin editor from the toolbox by adding ChemAxon.NET.Windows.Forms.dll into the toolbox.


I get errors over there and I'm using the latest version of dll files.


 


Thanks,


Sri

ChemAxon bd13b5bd77

17-08-2010 07:17:53

Dear Sri,


I have a created a WindowsApplication5_ChemAxon using VS2008.



Now it compiles and works.


I have added an alternative how to use our built-in editor control (will be improved in the upcoming releases):



 



MarvinSketchForm editor2 = new ChemAxon.NET.Windows.Forms.MarvinEditorControl.MarvinSketchForm();
var converter = new ChemAxon.NET.IKVM.Chemistry.MolConverter();



editor2.MoleculeString = converter.ConvertToFormat("C=C=C", "MRV");
var result = editor2.ShowAsDialog();
MessageBox.Show(result ? "Clicked OK!" :"Canceled");


You can find this code in SHow button click event.


Please install the latest version of JChem.NET API I used that.


https://www.chemaxon.com/download/marvin/for-net-developer/


 


Viktor

User e3b516b760

17-08-2010 11:09:02

Hi,


 


Thanks a lot for the reply. I'm unable to download latest version of the files as it is saying that "Unable to find the link".


The problem for me is still unresolved 


 



Error 43 The type or namespace name 'Windows' does not exist in the namespace 'ChemAxon.NET' (are you missing an assembly reference?)


Error 44 The type or namespace name 'Windows' does not exist in the namespace 'ChemAxon.NET' (are you missing an assembly reference?)



ChemAxon bd13b5bd77

17-08-2010 11:25:36

Hi,


 


the project I sent you back worked to me properly, the web site was temporarily out, sorry for that, please try it out again now. It is available and come back to me afterwards if you have further issues.


 


Viktor

User e3b516b760

17-08-2010 13:01:33

Hi,


 


Sorry I used the file as it is, which you uploaded. Still I'm getting the some errors. I attached the screen shot of the errors. I also used the latest dll files from the link you pasted.


 


Any clues why it is happening?


 


I don't think it is because of the VS version 2010.

ChemAxon bd13b5bd77

17-08-2010 13:24:05

Please check the references in the project file (solutions explorer):


C:\Windows\assembly\GAC_MSIL\ChemAxon.NET\5.3.7.11__d25ce09139c726a9\ChemAxon.NET.dll
C:\Windows\assembly\GAC_MSIL\ChemAxon.NET.Base\5.3.7.11__d25ce09139c726a9\ChemAxon.NET.Base.dll
C:\Windows\assembly\GAC_MSIL\ChemAxon.NET.IKVM\5.3.7.11__d25ce09139c726a9\ChemAxon.NET.IKVM.dll
C:\Windows\assembly\GAC_MSIL\ChemAxon.NET.Windows.Forms\5.3.7.11__d25ce09139c726a9\ChemAxon.NET.Windows.Forms.dll


Viktor

User e3b516b760

17-08-2010 13:27:24

I do have them in my solution explorer.


 


I used the same executing project of yours which you have uploaded.

User e3b516b760

17-08-2010 13:28:40

here is the screen shot of the references


 


 


Sri

ChemAxon eb65a25631

17-08-2010 19:58:14

Hi,


I took over the task from Viktor.


I managed to get rid of the problem by changing the Target framework in the project properties from .NET Framework 4 Client Profile to .NET Framework 4 .


Please let me know if it fixes the build issue for you as well.


I also removed the importing of the java.awt namespace (removed using java.awt; )


This way i got rid of the ambigousity complaints by the compiler, and I managed to compile the project successfuly.

User e3b516b760

18-08-2010 09:41:46

Hi,


 


Thanks a lot. My problem got resolved. Can you tell me how you managed to get rid of those ambiguous erros by not using java.awt..


 


If possible can you post me the sample code.


 


 


Thanks,


Sri

ChemAxon eb65a25631

18-08-2010 09:53:28

Sure. I removed the using java.awt; line and completed the declarations with the namespace where apropriate (see attachment).

User e3b516b760

18-08-2010 09:55:58

That was awesome. 


 


Thanks once again


 


Bye,


Sri

User 0c6bd7c757

10-02-2012 12:08:37










akovacs wrote:

Hi,


I took over the task from Viktor.


I managed to get rid of the problem by changing the Target framework in the project properties from .NET Framework 4 Client Profile to .NET Framework 4 .


Please let me know if it fixes the build issue for you as well.


I also removed the importing of the java.awt namespace (removed using java.awt; )


This way i got rid of the ambigousity complaints by the compiler, and I managed to compile the project successfuly.



Hi Akos and Viktor,


We have the same  problem with Target Framework. We use the JChem .Net API 5.7.1.767 version. When we use the ChemAxon.NET.Windows.Forms.MarvinEditorControl.MarvinEditorControl and the target framework is set to .Net Framework 4 Client Profile the "you are using a missing assembly reference" error appears. When we change the Target framework to .Net Framework 4 it works fine. Our problem is that we made an effort to make our projects Client Profile compatible. Is there a JChem API, which works on Client Profile as well?


Best regards, Erzsebet

ChemAxon eb65a25631

10-02-2012 14:37:09

Hi Erzsebet,



Well, currently .NET 4 is not supported by JChem.NET. Thus, .NET 4 Client Profile neither.


Additionally, I'm not aware of plans supporting Client Profile in the future (if it is possible anyways).


The officialy supported .NET framework is .NET 3.5. The components built specifically against 2.0/3.5 assemblies.


And our tests run specifically on .NET 3.5 framework only.


I can make a quick look on the topic if there's a quick and dirty workaround. But I can't promise anything.


 


Regards,


András

User 0c6bd7c757

13-02-2012 11:46:53

Hi András,


Thanks for the answer. Than we try to solve
the problem on other ways.


Best regards, Erzsebet

User f2aa45fa50

10-01-2013 09:33:28










hamoriviktor wrote:

Dear Sri,


I have a created a WindowsApplication5_ChemAxon using VS2008.



Now it compiles and works.


I have added an alternative how to use our built-in editor control (will be improved in the upcoming releases):



 



MarvinSketchForm editor2 = new ChemAxon.NET.Windows.Forms.MarvinEditorControl.MarvinSketchForm();
var converter = new ChemAxon.NET.IKVM.Chemistry.MolConverter();



editor2.MoleculeString = converter.ConvertToFormat("C=C=C", "MRV");
var result = editor2.ShowAsDialog();
MessageBox.Show(result ? "Clicked OK!" :"Canceled");


You can find this code in SHow button click event.


Please install the latest version of JChem.NET API I used that.


https://www.chemaxon.com/download/marvin/for-net-developer/


 


Viktor




Thanks a lot Victor!! This was very easy to use, I actually used this to open MarvinSketch window with my web application.


 


-Gou