<div dir="ltr"><div><div>Well that's actually my fault for not checking out that first (wrt clrtype). Is there any other well tested/standard option to do what clrtype does nowadays?<br><br></div>I've actually opted for installing IronPython in the client machines, but I will look at fuslogvw to check this out.<br><br></div>Best Regards,<br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-04-25 18:44 GMT-04:30 Jeff Hardy <span dir="ltr"><<a href="mailto:jdhardy@gmail.com" target="_blank">jdhardy@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It's the sort of error I would expect if there was an assembly version<br>
mismatch, but that usually goes the other way - installed IronPython<br>
breaking embedded/hosted IronPython. Maybe break out fuslogvw and see<br>
which assemblies are being loaded?<br>
<br>
As an aside: I'm impressed clrtypes.py works *at all*. I don't think<br>
there are any tests covering it :(<br>
<span class="HOEnZb"><font color="#888888"><br>
- Jeff<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Fri, Apr 24, 2015 at 8:24 PM, Sebastián Magrí <<a href="mailto:sebasmagri@gmail.com">sebasmagri@gmail.com</a>> wrote:<br>
> I'm using pyc.py with and a StdLib.dll, and other DLL dependencies. The<br>
> clrtype.py file is passed as an extra file to the pyc command.<br>
><br>
>    $ ipy pyc.py /standalone /target:winexe /out:myapp /main:app.py ...<br>
> clrtype.py<br>
><br>
> Regards,<br>
><br>
> 2015-04-24 14:29 GMT-04:30 Slide <<a href="mailto:slide.o.mix@gmail.com">slide.o.mix@gmail.com</a>>:<br>
><br>
>> How are you creating your exe?<br>
>><br>
>><br>
>> On Fri, Apr 24, 2015, 11:55 Sebastián Magrí <<a href="mailto:sebasmagri@gmail.com">sebasmagri@gmail.com</a>> wrote:<br>
>>><br>
>>> Hi!<br>
>>><br>
>>> I'm using clrtype.py to do some user32.dll integration and I'm creating a<br>
>>> standalone .exe which uses this integration.<br>
>>><br>
>>> When I run the .exe on a machine with IronPython installed, it works<br>
>>> flawlesly. However, If I run the .exe on a machine without IronPython, then<br>
>>> the I get a ValueError. The traceback of the error takes me to clrtype's<br>
>>> ClrClass.set_python_type_field() method:<br>
>>><br>
>>> ---<br>
>>> Traceback (most recent call last):<br>
>>>   ...snip...<br>
>>>   File "clrtype", line 555, in __clrtype__<br>
>>>   File "clrtype", line 176, in create_type<br>
>>>   File "clrtype", line 536, in map_members<br>
>>>   File "clrtype", line 504, in set_python_type_field<br>
>>> ValueError: Object of type<br>
>>> 'IronPython.NewTypes.IronPython.Runtime.Types.PythonType_3$3' cannot be<br>
>>> converted to type 'IronPython.Runtime.Types.PythonType'.<br>
>>> ---<br>
>>><br>
>>> The class using the ClrClass metaclass is implemented as follows:<br>
>>><br>
>>> ---<br>
>>> class NativeMethods(object):<br>
>>>     __metaclass__ = clrtype.ClrClass<br>
>>>     _clrnamespace = 'my.custom.namespace'<br>
>>><br>
>>>     dll_import = clrtype.attribute(DllImportAttribute)<br>
>>>     preserve_sig = clrtype.attribute(PreserveSigAttribute)<br>
>>><br>
>>>     @staticmethod<br>
>>>     @dll_import('user32.dll')<br>
>>>     @preserve_sig()<br>
>>>     @clrtype.accepts(int, int)<br>
>>>     @clrtype.returns(bool)<br>
>>>     def ShowWindow(hwnd, flag):<br>
>>>         raise RuntimeError('what are you doing here')<br>
>>><br>
>>>     @staticmethod<br>
>>>     @dll_import('user32.dll')<br>
>>>     @preserve_sig()<br>
>>>     @clrtype.accepts(int, int, int, int, int, int, int)<br>
>>>     @clrtype.returns(bool)<br>
>>>     def SetWindowPos(hwnd, insert_after_hwnd, x, y, w, h, flags):<br>
>>>         raise RuntimeError('what are you doing here')<br>
>>> ---<br>
>>><br>
>>> I've been digging into this error and even looking at<br>
>>> IronPython.Runtime.Types but I've not found the possible cause of the issue.<br>
>>><br>
>>> Is there anything I'm missing here?<br>
>>><br>
>>> Best Regards,<br>
>>><br>
>>> --<br>
>>> Sebastián Ramírez Magrí<br>
>>> _______________________________________________<br>
>>> Ironpython-users mailing list<br>
>>> <a href="mailto:Ironpython-users@python.org">Ironpython-users@python.org</a><br>
>>> <a href="https://mail.python.org/mailman/listinfo/ironpython-users" target="_blank">https://mail.python.org/mailman/listinfo/ironpython-users</a><br>
><br>
><br>
><br>
><br>
> --<br>
> Sebastián Ramírez Magrí<br>
><br>
> _______________________________________________<br>
> Ironpython-users mailing list<br>
> <a href="mailto:Ironpython-users@python.org">Ironpython-users@python.org</a><br>
> <a href="https://mail.python.org/mailman/listinfo/ironpython-users" target="_blank">https://mail.python.org/mailman/listinfo/ironpython-users</a><br>
><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Sebastián Ramírez Magrí</div>
</div>