Question

I am attempting to use Scintilla .NET in a project (I want a good editor + syntax highlighting, etc). Unfortunately, when I reference the binaries in my project, I can't seem to actually use the Scintilla controls. I get two different errors.

  1. The first happens when adding SciLexer.dll as a reference to my project. I get a message that says: A reference to SciLexer.dll could not be added. Please make sure the file is accessible, and that it is a valid assembly or COM component.

  2. The second error occurs when I try to use the controls from ScintillaNET.dll. If I try to drag the component into a form, I get the following message: Failed to create component Scintilla. The error message follows: System.ComponentModel.Win32Exception: %1 is not a valid Win32 application at ScintillaNet.Scintilla.get_CreateParams()

Any help with either of these problems would be much appreciated. For the record, I am running Visual Studio 2008 running on a 64-bit Windows 7 platform.

Thanks.

Was it helpful?

Solution

It's been a little while since I used Scintilla, but my understanding is that SciLexer.dll is an entirely native DLL, which is why you can't add a reference to it from Visual Studio.

Instead, you should 'arrange' for SciLexer.dll to appear in the right directory at runtime so that it can be loaded by ScintillaNET.dll. The safest way to do this would be to add SciLexer.dll to your Visual Studio project as a plain file (not as a reference), then change the properties on the file to have it copied to the output directory when your project is built.

Given that you're on 64-bit, I expect that you'll need to build your app specifically as 32-bit and not AnyCPU. As I say, it's been a while since I did this, but when I did, Scintilla only had 32-bit binaries.

OTHER TIPS

I got round the issue by copying the files to C:\Windows\SysWOW64

Got the idea from @weston's post.

I use ScintillaNET (C# port). It is easy to use, but it is a memory hog.

https://github.com/jacobslusser/ScintillaNET

enter image description here

Click on RUN and select MyComputer Right click on MyComputer Go to Properties then Click on Advanced System Settings .

After that select Advanced and Click on Environment Variables.

Here we can add the value and path.

Value : what ever you like " Eg : Scintilla

Value path : where the downloaded dll kept ." EG: D:\prathap\DLL\

Download Path :https://scintillanet.codeplex.com/releases

Select the downloads from right hand side on the screen.

Then in the application add the Scintill Dll as a reference and other 2 dll as existing files.

Right click on project ADD -- Addexisting files -- then select the files from local system and make sure that you keep the 2 files "Copy to Output directory = Copy Always.

Then run the application it will work.

i added reference to Scintilla.dll instead of SciLexer.dll - and it worked

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top