Hi, as already mentioned in my previous post to this list, I am currently developing a COM server using comtypes.
>From time to time, Ive experienced some strange errors (e.g. COMError: Illegal memory access) of which I dont really know where they come from. I have the feeling that it is related to some pointer mess Ive probably made. So I have some general questions: If a methods return value is specified as ( ['out'], POINTER(c_ulong), , do I have to generate a c_ulong object or is it ok to just return a python object? E.g.: return 42 or return c_ulong(42) ? Next thing is strings. I think this was the main problem of most of the errors I got. When a method expects a string c_wchar_p, I have the impression that it is necessary to use return c_wchar_p(foobar) instead of just return foobar to avoid illegal memory access errors... What about structs? When a struct has two items, (number, c_ulong) and (text, c_wchar_p), how should I fill in values? struct = SOMESTRUCT() struct.number = 2 struct.number.value = 2 struct.number = c_ulong(2) struct.text = foobar struct.text.value = foobar struct.text = c_wchar_p(foobar) Do I have to explicitly keep a reference to this string in my server instance? What about returning this struct from a method? Is it OK to do return pointer(struct)? Or do I have to care about freeing/keeping the object? Sometimes, like the errors above, I get COMErrors that I can only see in the client, not the server but I believe that the root cause is somewhere in the server. Is there a way to get more verbose COM error messages (I already have comtypes logging set to debug)? Probably using some 3rd party tools? Thanks! //Jan ------------------------------------------------------------------------------ For Developers, A Lot Can Happen In A Second. Boundary is the first to Know...and Tell You. Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! http://p.sf.net/sfu/Boundary-d2dvs2 _______________________________________________ comtypes-users mailing list comtypes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/comtypes-users