VC# Express Edition and Scintilla

Topics: Developer Forum
Nov 19, 2006 at 3:10 PM

I am new to ScintillaNET and have recently tried to integrate the package. However, when dragging the component in the Designer onto my Form I receive an exception containing the following lines:

Failed to create component 'ScintillaControl'. The error message follows:
'System.ComponentModel.Win32Exception: Window class name is not valid.
at System.Windows.Forms.NativeWindow.WindowClass.RegisterClass() ...'
Nov 19, 2006 at 10:58 PM
put the SciLexer.dll into your bin directory and the windows\system32 directory. I'm not sure why you have to do it, but I remember someone mentioning that in the forums in the past
Nov 20, 2006 at 5:57 AM
Thanks, I'll try that when I get back from work. Originally I just added a reference from the Project to the DLL and also added it to the Designers toolboxes.
Nov 20, 2006 at 12:42 PM
In my last checkin I added a pre-build event to copy the scilexer file into the bin directory. I'll just add another line to it to push it into the system32 directory! I'll take care of that sometime soon.
Nov 20, 2006 at 1:03 PM
I see that the VC#EE has copied the scintillanet.dll into the bin folder of the application. Copying the file into the windows\system32 directory didn't solve the issue.
Nov 20, 2006 at 1:13 PM
I tried downloading the archive and compiling the solution. It all compiled fine (after adding the "Allow unsafe"-option), however starting the SCide project gives an unhandled Windows32 exception. This exception says the same as the designer, i.e. "Window class name is not valid.".
Dec 6, 2006 at 4:45 PM
The following XML files are used to create the stylers etc. These need to be placed at the same location as the scintillanet.dll.

For example if your application is at c:\target, then place the following XML files along with scintillanet at c:\target:

1. config.Xml
2. langs.XML
3. stylers.xml

I use the old ScintillaNet.LegacyConfiguration property to set the language type. For this I also need the "legacyscintillanet.xml" file (to be placed along with the above files).

Jan 21, 2007 at 4:05 AM
Oh yeah that would be me. The SciLexer.dll is loaded via Windows API LoadLibrary(). The behavior of this it to look first in the current directory of the executable and then all items within the PATH. Most commonly "shared" dlls of this nature are installed to the system (system32) directory.

I haven't played with the express editions in a while but I think they had a similar option as VS to ensure that it's always copied to the bin folder for you automatically.

First ensure the SciLexer.dll is included in your project. Highlight it in the Solution Explorer, Now in the Property Grid find the "Copy to Output folder" and change this to Copy Always or Copy if Newer.