diff options
| author | nyamatongwe <unknown> | 2003-04-18 01:39:55 +0000 |
|---|---|---|
| committer | nyamatongwe <unknown> | 2003-04-18 01:39:55 +0000 |
| commit | 55fdc0e6745bb50304e73e1c11c95d6c847b4274 (patch) | |
| tree | 60beced0238d3852a891da2629baac76c18657c2 /win32/PlatWin.cxx | |
| parent | 25a167ffe9c75c993f2c2a45ad3ebe3295e3d41a (diff) | |
| download | scintilla-mirror-55fdc0e6745bb50304e73e1c11c95d6c847b4274.tar.gz | |
Patch from Simon to make ExternalLexer platform independent.
Diffstat (limited to 'win32/PlatWin.cxx')
| -rw-r--r-- | win32/PlatWin.cxx | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index bf6112d57..c61a67ca9 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -1288,6 +1288,36 @@ double ElapsedTime::Duration(bool reset) { return result; } +class DynamicLibraryImpl : public DynamicLibrary { +protected: + HMODULE h; +public: + DynamicLibraryImpl(const char *modulePath) { + h = ::LoadLibrary(modulePath); + } + + virtual ~DynamicLibraryImpl() { + if (h != NULL) + ::FreeLibrary(h); + } + + // Use GetProcAddress to get a pointer to the relevant function. + virtual Function *FindFunction(const char *name) { + if (h != NULL) { + return reinterpret_cast<Function*>( ::GetProcAddress(h, name) ); + } else + return NULL; + } + + virtual bool IsValid() { + return h != NULL; + } +}; + +DynamicLibrary *DynamicLibrary::Load(const char *modulePath) { + return static_cast<DynamicLibrary *>( new DynamicLibraryImpl(modulePath) ); +} + ColourDesired Platform::Chrome() { return ::GetSysColor(COLOR_3DFACE); } |
