Syntax Editor & VS 2005

SyntaxEditor for Windows Forms Forum

Posted 13 years ago by Dong JIA
Avatar
Hi all,
I am using SyntaxEditor v3.1.0210 with .NET 2.0, VS 2005 and Windows XP now.
After I imported syntax editor to a managed c++ project, I get the following error:

4>Compiling...
4>DotNetFormulaBoxUtils.cpp
4>c:\somepath\imports\actipro\common\actiprosoftware.shared.net20.dll : warning C4945: 'DotfuscatorAttribute' : cannot import symbol from 'c:\somepath\imports\actipro\common\actiprosoftware.shared.net20.dll': as 'DotfuscatorAttribute' has already been imported from another assembly 'ActiproSoftware.SyntaxEditor.Net20'
4> c:\somepath\imports\actipro\syntaxeditor\actiprosoftware.syntaxeditor.net20.dll : see declaration of 'DotfuscatorAttribute'
4> first seen type is used; re-order imported assemblies to use the current type
4> This diagnostic occurred while importing type '.DotfuscatorAttribute' from assembly 'ActiproSoftware.Shared.Net20, Version=1.0.80.0, Culture=neutral, PublicKeyToken=36ff2196ab5654b9'.
4>c:\somepath\imports\actipro\common\actiprosoftware.winuicore.net20.dll : warning C4945: 'DotfuscatorAttribute' : cannot import symbol from 'c:\somepath\imports\actipro\common\actiprosoftware.winuicore.net20.dll': as 'DotfuscatorAttribute' has already been imported from another assembly 'ActiproSoftware.SyntaxEditor.Net20'
4> c:\somepath\imports\actipro\syntaxeditor\actiprosoftware.syntaxeditor.net20.dll : see declaration of 'DotfuscatorAttribute'
4> first seen type is used; re-order imported assemblies to use the current type
4> This diagnostic occurred while importing type '.DotfuscatorAttribute' from assembly 'ActiproSoftware.WinUICore.Net20, Version=1.0.80.0, Culture=neutral, PublicKeyToken=1eba893a2bc55de5'.
4>c:\somepath\imports\actipro\common\actiprosoftware.winuicore.net20.dll : warning C4374: 'System::Drawing::Size ActiproSoftware::WinUICore::IUIElement::Size::get(void)': interface method will not be implemented by non-virtual method 'System::Drawing::Size System::Windows::Forms::Control::Size::get(void)'
4> .\DotNetFormulaBoxUtils.cpp(47) : see declaration of 'ActiproSoftware::WinUICore::IUIElement::Size::get'
4> .\DotNetFormulaBoxUtils.cpp(47) : see declaration of 'System::Windows::Forms::Control::Size::get'
4> This diagnostic occurred while importing type 'ActiproSoftware::WinUICore::UIControl ' from assembly 'ActiproSoftware.WinUICore.Net20, Version=1.0.80.0, Culture=neutral, PublicKeyToken=1eba893a2bc55de5'.
4> This diagnostic occurred while importing type 'ActiproSoftware::SyntaxEditor::SyntaxEditor ' from assembly 'ActiproSoftware.SyntaxEditor.Net20, Version=3.1.210.0, Culture=neutral, PublicKeyToken=0ecd8d0e8818ec9b'.
4> This diagnostic occurred while importing type 'SomeNamespace::UIControls::DotNetFormulaBox ' from assembly 'someproductman80, Version=8.0.0.0, Culture=neutral, PublicKeyToken=null'.
4>c:\somepath\imports\actipro\common\actiprosoftware.winuicore.net20.dll : warning C4374: 'bool ActiproSoftware::WinUICore::IUIControl::Capture::get(void)': interface method will not be implemented by non-virtual method 'bool System::Windows::Forms::Control::Capture::get(void)'
4> .\DotNetFormulaBoxUtils.cpp(47) : see declaration of 'ActiproSoftware::WinUICore::IUIControl::Capture::get'
4> .\DotNetFormulaBoxUtils.cpp(47) : see declaration of 'System::Windows::Forms::Control::Capture::get'
4> This diagnostic occurred while importing type 'ActiproSoftware::WinUICore::UIControl ' from assembly 'ActiproSoftware.WinUICore.Net20, Version=1.0.80.0, Culture=neutral, PublicKeyToken=1eba893a2bc55de5'.
4> This diagnostic occurred while importing type 'ActiproSoftware::SyntaxEditor::SyntaxEditor ' from assembly 'ActiproSoftware.SyntaxEditor.Net20, Version=3.1.210.0, Culture=neutral, PublicKeyToken=0ecd8d0e8818ec9b'.
4> This diagnostic occurred while importing type 'SomeNamespace::UIControls::DotNetFormulaBox ' from assembly 'someproductman80, Version=8.0.0.0, Culture=neutral, PublicKeyToken=null'.
4>c:\somepath\imports\actipro\common\actiprosoftware.winuicore.net20.dll : warning C4374: 'void ActiproSoftware::WinUICore::IUIControl::Capture::set(bool)': interface method will not be implemented by non-virtual method 'void System::Windows::Forms::Control::Capture::set(bool)'
4> .\DotNetFormulaBoxUtils.cpp(47) : see declaration of 'ActiproSoftware::WinUICore::IUIControl::Capture::set'
4> .\DotNetFormulaBoxUtils.cpp(47) : see declaration of 'System::Windows::Forms::Control::Capture::set'
4> This diagnostic occurred while importing type 'ActiproSoftware::WinUICore::UIControl ' from assembly 'ActiproSoftware.WinUICore.Net20, Version=1.0.80.0, Culture=neutral, PublicKeyToken=1eba893a2bc55de5'.
4> This diagnostic occurred while importing type 'ActiproSoftware::SyntaxEditor::SyntaxEditor ' from assembly 'ActiproSoftware.SyntaxEditor.Net20, Version=3.1.210.0, Culture=neutral, PublicKeyToken=0ecd8d0e8818ec9b'.
4> This diagnostic occurred while importing type 'SomeNamespace::UIControls::DotNetFormulaBox ' from assembly 'someproductman80, Version=8.0.0.0, Culture=neutral, PublicKeyToken=null'.
4>Linking...
4> Creating library Debug\someproductmix80.lib and object Debug\someproductmix80.exp

As warning indicated, the warning occured during importing the type from Actipro Syntax editor. Could anybody give me some ideas to get rid of these warning?

Thanks in advence.

Comments (19)

Posted 13 years ago by Dong JIA
Avatar
I did some search in google and found that:
it may be caused by some obfuscation flags not supported by C++. And I think manged C++ in VS 2005 is the key point for these warnings.

[Modified at 06/11/2006 11:20 PM]
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Sorry, we're not very familiar with C++. Does this mean that you were able to work around the problem and get things functional?


Actipro Software Support

Posted 13 years ago by Dong JIA
Avatar
Yes, it is just warning, product works well. But Our policy is that any product can not ship with any warning... :(
Posted 13 years ago by Joris Koster - Paragon Decision Technology
Avatar
Well same problems here :(, but actually errors instead of warnings, which makes it a real problem for us.

While the code below compiles just fine,

using System;
using System.Collections.Generic;
using System.Text;

using ActiproSoftware.SyntaxEditor;

namespace SharpLanguageCompiler
{
    class Program
    {
        static void Main(string[] args)
        {
            string inputFileName = args[1];
            string outputFileName = args[2];

            SyntaxLanguage language = SyntaxLanguage.LoadFromXml(inputFile, 0);

        }
    }
}
its counterpart in C++:

#include "stdafx.h"

using namespace System;
using namespace ActiproSoftware::SyntaxEditor;

int main(array<System::String ^> ^args)
{
    if (args->Length == 3){
        System::String^ inputFile = args[1];
        System::String^ outputFile = args[2];
        Console::WriteLine(String::Format("Compiling language {0} to encoded {1}", inputFile, outputFile ));

        SyntaxLanguage^ language = SyntaxLanguage::LoadFromXml(inputFile, 0);
    }
    return 0;
}
will produce the following error:

LanguageCompiler.cpp
.\LanguageCompiler.cpp(17) : error C2686: cannot overload static and non-static member functions with the same parameter types
        c:\program files\actipro software\syntaxeditor\v3.1.0210\actiprosoftware.syntaxeditor.net20.dll: could be 'ActiproSoftware::SyntaxEditor::SyntaxLanguage ^ActiproSoftware::SyntaxEditor::SyntaxLanguage::a(System::IO::Stream ^,int)'
        c:\program files\actipro software\syntaxeditor\v3.1.0210\actiprosoftware.syntaxeditor.net20.dll: or 'void ActiproSoftware::SyntaxEditor::SyntaxLanguage::a(System::IO::Stream ^,int)'
        This diagnostic occurred while importing type 'ActiproSoftware::SyntaxEditor::SyntaxLanguage ' from assembly 'ActiproSoftware.SyntaxEditor.Net20, Version=3.1.210.0, Culture=neutral, PublicKeyToken=0ecd8d0e8818ec9b'.
I've found one reference on the web, see
chartFx forum
that claims the problem lies in 'an obfuscation flag not supported by C++'.

Could you please remove this obfuscation flag aswell? This is the most important error (since it is actually the loading of the syntax) I get, but not the only one.
Besides more errors about other member functions I aswell get errors on just plain members, e.g.:

SHLControl.h(197) : error C2039: 'set_Size' : is not a member of 'ActiproSoftware::WinUICore::IUIElement::Size'
        : see declaration of 'ActiproSoftware::WinUICore::IUIElement::Size'
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hmm... we already have the Strip Obfuscation Attributes option on in Dotfuscator.
It appears like Dotfuscator places a DotfuscatorAttribute in the root namespace
of each assembly that it builds. This must be causing conflicts since for our assemblies
there would be one for Shared, WinUICore, SyntaxEditor, etc., all named the same
and in the same namespace.

If anyone knows offhand how to prevent that from being inserted, please post.
I will also contact the Dotfuscator support to see what they recommend.


Actipro Software Support

Posted 13 years ago by Joris Koster - Paragon Decision Technology
Avatar
Euhw, I've never worked with Dotfuscator; but the other forum says that they turned an option OFF! Stripping the Obfuscation Attributes should then probably be OFF it that is the mentioned option that is incompatiable with C++. Stripping Attributes sounds like throwing info away; info that could be used for determining the correct prototype to use for example?
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
I've done some testing with a C++ project and loading the code you have.
It seems like there are actually three issues going on here.

1) The DotfuscatorAttribute warning. The Dotfuscator support team just got back to me
and gave me a manual switch to add to remove it that wasn't in the UI. I'll add
that to all the assemblies.

2) Your "error C2686: cannot overload static and non-static member functions with the same parameter types"
error is something that is being caused by Dotfuscator. By looking at the obfuscated output
this might be a bug with Dotfuscator because it generated two methods (one static and one instance)
with the same name and parameters but a different return value. I made a code change to add a dummy
parameter to one of the two methods to work around this. I will report it to the Dotfuscator support
to see what they say.

3) Your "error C2039: 'set_Size' : is not a member of 'ActiproSoftware::WinUICore::IUIElement::Size'"
seems to be a bug with the C++ compiler. This works fine in C# and VB. It doesn't even work
in the unobfuscated assembly. What happens is that Control.Size is defined as get/set. We have an
IUIElement interface that UIControl (and SyntaxEditor) implement. IUIElement has a get-only Size
property. So it SHOULD just be checking to ensure that the get is available.
But in this case, C++ seems to say that there should be no setter, which is completely wrong.
What I did was add setters for both Bounds and Size properties in IUIElement.
That seems to resolve the issue but the fix won't come until the next Shared/WinUICore update.
If you need this sooner, then email us and we can get it to you.


Actipro Software Support

Posted 13 years ago by Joris Koster - Paragon Decision Technology
Avatar
Things got even worse; I've just downgraded to 3.1.204.0 again but the problems remain.

I've created a new C++ .NET project in VS2005 which I just put a syntax-editor (3.1.204) on a form; the set_Size seems to work fine, although I do get a lot of warnings.

the C2686: cannot overload static and non-static member functions with the same parameter types error for the SyntaxLanguage::LoadFromXml is gone, but others remain. The errors I get are only on the outlining nodes; I summarized it in the code below:
ActiproSoftware::SyntaxEditor::OutliningNode^ node=
   syntaxEditor->Document->Outlining->RootNode->FindNodeRecursive(0);
ActiproSoftware::SyntaxEditor::TokenCollection^ tokens = node->Document->Tokens;
results in:

SHLControl.h(150) : error C2686: cannot overload static and non-static member functions with the same parameter types
        c:\u\s\supplier\actipro\actiprosoftware.syntaxeditor.dll: could be 'ActiproSoftware::SyntaxEditor::OutliningNode ^ActiproSoftware::SyntaxEditor::OutliningNode::_1(ActiproSoftware::SyntaxEditor::OutliningNode ^,bool)'
        c:\u\s\supplier\actipro\actiprosoftware.syntaxeditor.dll: or 'int ActiproSoftware::SyntaxEditor::OutliningNode::_1(ActiproSoftware::SyntaxEditor::OutliningNode ^,bool)'
        This diagnostic occurred while importing type 'ActiproSoftware::SyntaxEditor::OutliningNode ' from assembly 'ActiproSoftware.SyntaxEditor, Version=3.1.204.0, Culture=neutral, PublicKeyToken=0ecd8d0e8818ec9b'.
SHLControl.h(150) : error C2686: cannot overload static and non-static member functions with the same parameter types
        c:\u\s\supplier\actipro\actiprosoftware.syntaxeditor.dll: could be 'void ActiproSoftware::SyntaxEditor::OutliningNode::_1(ActiproSoftware::SyntaxEditor::OutliningNode ^,int)'
        c:\u\s\supplier\actipro\actiprosoftware.syntaxeditor.dll: or 'void ActiproSoftware::SyntaxEditor::OutliningNode::_1(ActiproSoftware::SyntaxEditor::OutliningNode ^,int)'
        This diagnostic occurred while importing type 'ActiproSoftware::SyntaxEditor::OutliningNode ' from assembly 'ActiproSoftware.SyntaxEditor, Version=3.1.204.0, Culture=neutral, PublicKeyToken=0ecd8d0e8818ec9b'.
SHLControl.h(150) : error C2686: cannot overload static and non-static member functions with the same parameter types
        c:\u\s\supplier\actipro\actiprosoftware.syntaxeditor.dll: could be 'void ActiproSoftware::SyntaxEditor::OutliningNode::_1(ActiproSoftware::SyntaxEditor::OutliningNode ^)'
        c:\u\s\supplier\actipro\actiprosoftware.syntaxeditor.dll: or 'void ActiproSoftware::SyntaxEditor::OutliningNode::_1(ActiproSoftware::SyntaxEditor::OutliningNode ^)'
        This diagnostic occurred while importing type 'ActiproSoftware::SyntaxEditor::OutliningNode ' from assembly 'ActiproSoftware.SyntaxEditor, Version=3.1.204.0, Culture=neutral, PublicKeyToken=0ecd8d0e8818ec9b'.
I did not have any problem with this while using VS2003.

To summarize my C++ problems:
version 3.1.204 + VS2003
* no problems yeehaa!
version 3.1.204 + VS2005
* outlining node member func errors (see above)
* set_Size warnings (and other warnings) (see earlier post)
version 3.1.210 (.NET 1.1) + VS2003
* not working at all due to 'imm32.dll' problem (see previous post about 3.1.210 not compiling under VS2003)
version 3.1.210 (.NET 2.0) + VS2005
* outlining node member func errors (see above)
* SyntaxLanguage::LoadFromXml member func error (see above)
* loads of warnings
version 3.1.210 (.NET 2.0) + VS2005 /clr:oldsyntax
* outlining node member func errors (see above)
* SyntaxLanguage::LoadFromXML member func error (see above)
* set_Size error
* loads of warnings

Apparently something changed to the LoadFromXml member function between version 3.1.204 and 3.1.210, and that same thing was done to the outlining nodes, which causes problems when using the syntax editor in C++ VS2005.

I'm getting really anoyed by this; the fact that the new releases wouldn't work anymore under VS2003 caused us to move the VS2005 migration earlier than initially planned. And now it turns out we cannot even compile the syntaxeditor using VS2005!

Still I would like to have the fixes you mentioned, so if you could email me that, I would really appreciate it.


[Modified at 06/14/2006 05:05 AM]
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Joris,

When we did the move from .NET 1.0 to .NET 2.0/1.1 builds, we changed obfuscators to Dotfuscator.
So it appears that this is a bug with Dotfuscator. I am going to contact them today about it
since it looks like it's happening in multiple places, not just one.

I'll post back as soon as I receive a reply from Dotfuscator regarding these issues.


Actipro Software Support

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Good news... with some of the changes we've made and tweaking of the Dotfuscator options, we are now able to get our VS 2005 C++ test app to run fine. If you'd like us to make you a special build until the next official maintenance release, send over an email.


Actipro Software Support

Posted 13 years ago by Dong JIA
Avatar
Hi Actipro,

Has it integrated into the latest maintenance release(Version 3.1.0211)?

I found nothing about it in release history on the reademe.html. And I still got the warning......
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Yes the obfuscator option change is in that maintenance release. I just tried a VS2005 C++ project and do not get any compilation warnings. Perhaps you still have an old version that is being pulled in by mistake?


Actipro Software Support

Posted 13 years ago by Bill Jacquot
Avatar
I still see this warning:

c:\foo.dll : warning C4374: 'void c:\actipro\common\actiprosoftware.winuicore.net20.dll : warning C4374: 'void ActiproSoftware::WinUICore::IUIElement::Bounds::set(System::Drawing::Rectangle)': interface method will not be implemented by non-virtual method '
void System::Windows::Forms::Control::Bounds::set(System::Drawing::Rectangle)'

Note that this is in WinUICore and the version on that is 1.0.81.0. Perhaps this assembly needs to be updated in the same way that the SyntaxEditor was?
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Ahh, I think I know what happened. We turned the option off however Dotfuscator has an option that lets you keep the same obfuscated names between builds. So it is reusing the same old names even though the option is off. We'll get that fixed for the next Shared/WinUICore release.


Actipro Software Support

Posted 13 years ago by Dong JIA
Avatar
Is there anothor maintenance release for it? Or another full release?
Posted 13 years ago by Joris Koster - Paragon Decision Technology
Avatar
After having the problems as described above we decided to use C# only for our editor-control and expose our syntax-editor-control (with the underlying Actipro SyntaxEditor) as a COM component to our (unmanaged) C++ code. This works really well, and we're no longer suffering from the problems we had when using managed C++.

A sample piece of code for the wrapper:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Reflection;
using System.Runtime.InteropServices;

namespace MyComWrapper
{
    [ComVisible(true),
     Guid("abcd1234-abcd-1234-abcd-1234abcd1234")]
    public interface ISynEditControl
    {
        bool Prop1 { set;get; }
        void DoSomething();
    }

    [ComVisible(true),
    Guid("11234abcd-1234-abcd-1234-abcd1234abcd")]
    public partial class SynEditControl : UserControl, ISynEditControl
    {
        // ...
        // just a normal user-control with the syntax-editor docking to all sides
        //   the event handlers hooked, etc.
        // ...
        private ActiproSoftware.SyntaxEditor.SyntaxEditor syntaxEditor;
        // ...
        // ... impl of interface
        // ....
    }
}
and compile using the export to tlb feature. The GUID specification is not necessary (without specifying the GUID you will get a new GUID each build).

at C++ side we just CoCreate the above COM object and attach it (using ATL) to the HWND of the (C++) stub-window.
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
The maintenance release is not out yet. But the next one should resolve all those issues since we no longer will have the option on the obfuscator that reuses the same names.

The maintenance release will also finally include XML documentation so you will get the documentation to show in VS while you work with the product's code.

We hope to get it out next week.


Actipro Software Support

Posted 13 years ago by Dong JIA
Avatar
After I upgraded to SyntaxEditor 3.1.0212, WinUICore 1.0.0082, I found that the same warning:
c:\imports\actipro\common\actiprosoftware.winuicore.net20.dll : warning C4374: 'void ActiproSoftware::WinUICore::IUIElement::Bounds::set(System::Drawing::Rectangle)': interface method will not be implemented by non-virtual method 'void System::Windows::Forms::Control::Bounds::set(System::Drawing::Rectangle)'.
:( When can you get rid of these warnings?
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi just tested setting the SyntaxEditor.Bounds property in a new Managed C++ project with those builds and it didn't show me any messages like that anymore. Please double-check that you are not pulling in WinUICore build 81 by accident, perhaps by the load dependencies options in your project.


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 7 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.