Re: [python-win32] playing with scintillacon

2017-12-16 Thread Kurt Eilander

I already had "import win32api".

As for pywintypes27.dll, it is one of four files automatically placed in 
c:\windows\system32 by the installer, which is a pretty sure thing as 
far as being able to find it.  I was getting desperate so I even copied 
it over, AND all the binaries from the 
C:\Python27\Lib\site-packages\pythonwin directory for good measure.  I 
checked the security privileges on all of them and verified that they 
were 64-bit using a PE explorer (ProcessHacker2).


There must be something else I'm missing.

NOTE:
I am basing my code on the example 
C:\Python27\Lib\site-packages\win32comext\shell\demos\servers\shell_view.py 
ScintillaShellView class.  Which is supposed to implement a windows 
explorer preview with scintilla highlighting.


Anyway, when I try and run that full sample, I get a folder created that 
I cannot open.  (Like it's registered correctly, but the code behind it 
is kaput.)   I use NirSoft's shell extension viewer 
(http://www.nirsoft.net/utils/shexview.html), and it tells me it "cannot 
find c:\Windows\system32\pythoncom27.dll". Bafflingly, it IS THERE!  
And, since it is another of the same set of dll's created by the 
installer, I'm wondering if this might be a clue?  Could there be a 
problem with the way the dll's are compiled and/or installed??


On 12/15/2017 3:47 PM, eryk sun wrote:

On Fri, Dec 15, 2017 at 9:10 PM, Kurt Eilander  wrote:

Ok, I found scintilla.dll in the directory above scintillacon.py, but it
came with pywin32, so it *should* be the correct one.
DLL inspector says it's a 64-bit, which is correct for my os.

I copy that dll, and indeed, all binaries in that directory (just to be
sure) into my program directory and it still does not work!

Try importing win32api in the same context. If that fails, check PATH
for pywintypesXY.dll:

 where pywintypes*.dll



___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] playing with scintillacon

2017-12-15 Thread eryk sun
On Fri, Dec 15, 2017 at 9:10 PM, Kurt Eilander  wrote:
> Ok, I found scintilla.dll in the directory above scintillacon.py, but it
> came with pywin32, so it *should* be the correct one.
> DLL inspector says it's a 64-bit, which is correct for my os.
>
> I copy that dll, and indeed, all binaries in that directory (just to be
> sure) into my program directory and it still does not work!

Try importing win32api in the same context. If that fails, check PATH
for pywintypesXY.dll:

where pywintypes*.dll

> I have no idea what could be wrong.  Oh!  To know what that little %1 means!

System error message include inserts such as %1 for when errors and
exceptions are shown by the system itself. All Python has in this case
is the error code, ERROR_BAD_EXE_FORMAT. So when it calls
FormatMessage, it uses the flag FORMAT_MESSAGE_IGNORE_INSERTS, as it
should.
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] playing with scintillacon

2017-12-15 Thread Kurt Eilander
Ok, I found scintilla.dll in the directory above scintillacon.py, but it 
came with pywin32, so it *should* be the correct one.

DLL inspector says it's a 64-bit, which is correct for my os.

I copy that dll, and indeed, all binaries in that directory (just to be 
sure) into my program directory and it still does not work!


Yet, the program Pythonwin.exe in that directory works fine and does its 
syntax highlighting with scintilla.dll.


I have no idea what could be wrong.  Oh!  To know what that little %1 means!


On 12/15/2017 10:23 AM, Jim Bell wrote:
"... not a valid Win32 application" sounds like a 32/64-bit issue to 
me. The 32/64-bit version of python you're running: does it match the 
DLLs?



On 2017-12-14 6:10 PM, Kurt Eilander wrote:

Hey all,

I recently noticed that pythonwin comes with a scintilla wrapper. 
Seems USEFUL!  so I decided to (scientifically) try poking it with a 
stick to see what it does.
(https://github.com/mhammond/pywin32/tree/7da19cd2ca3fac06638d9af690b8b6f5fcc65e8b/Pythonwin/pywin/scintilla) 



I didn't get too far, for when I do:
    from scintilla import scintillacon
I get:
    ImportError: DLL load failed: %1 is not a valid Win32 application.

Presumably this means there's a dll it can't find? Unfortunately the 
%1 is not replaced with what it's looking for.  (If there's not a bug 
out on this somewhere, there probably should be.) That's not the 
point though.  Point is: what are we looking for?


Thanks,
-Kurt






___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] playing with scintillacon

2017-12-15 Thread Jim Bell
"... not a valid Win32 application" sounds like a 32/64-bit issue to me. 
The 32/64-bit version of python you're running: does it match the DLLs?



On 2017-12-14 6:10 PM, Kurt Eilander wrote:

Hey all,

I recently noticed that pythonwin comes with a scintilla wrapper. 
Seems USEFUL!  so I decided to (scientifically) try poking it with a 
stick to see what it does.
(https://github.com/mhammond/pywin32/tree/7da19cd2ca3fac06638d9af690b8b6f5fcc65e8b/Pythonwin/pywin/scintilla) 



I didn't get too far, for when I do:
    from scintilla import scintillacon
I get:
    ImportError: DLL load failed: %1 is not a valid Win32 application.

Presumably this means there's a dll it can't find?  Unfortunately the 
%1 is not replaced with what it's looking for.  (If there's not a bug 
out on this somewhere, there probably should be.) That's not the point 
though.  Point is: what are we looking for?


Thanks,
-Kurt




___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32