How do I load SciLexer.dll in Visual Studio 2008 Designer, on Windows 7 64-bit?

2.8k views Asked by At

We develop a WinForm application using Scintilla.NET (1.7) component, which uses SciLexer.dll (unamnaged). At run-time, we distribute both 32bit and 64bit SciLexer.dll, and we load the correct one when the application starts (everything works fine).

On our new development environments (Windows 7 64-bit), all our solutions build and run just fine, but the WinForm visual designer does not load our forms/controls which use Scintilla.NET, because it cannot load the correct SciLexer.dll:

Window class name is not valid. 

at System.Windows.Forms.NativeWindow.WindowClass.RegisterClass()
at System.Windows.Forms.NativeWindow.WindowClass.Create(String className, Int32 classStyle)
at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
at System.Windows.Forms.Control.CreateHandle()
at System.Windows.Forms.Control.get_Handle()
at Scintilla.ScintillaControl.SendMessageDirect(UInt32 msg, IntPtr wParam, IntPtr lParam)
at Scintilla.ScintillaControl.SendMessageDirect(UInt32 msg)
at Scintilla.ScintillaControl.get_CodePage()
at Scintilla.ScintillaControl..ctor(String sciLexerDllName)
at Scintilla.ScintillaControl..ctor() 

Where does Visual Studio 2008 look for unmanaged libraries? I tried putting the 64-bit SciLexer.dll in SysWOW64, in the folder where ScintillaNET.dll is referenced, adding a folder in PATH system variable, adding a folder reference in the project, but I keep getting this error.

Any help is appreciated.

2

There are 2 answers

0
Filini On

Ok, I figured it out: I am a total noob on 64-bit systems, and I thought the SysWOW64 folder was for 64-bit libraries :)

Putting the 32-bit SciLexer.dll in SysWOW64 works like a charm.

0
GETah On

Just got the same error. Instead of messing up with your OS folders, you could add the location of those dlls to the PATH environment variable (don't forget to restart your VS for the changes to take effect)