Ok, after playing a while with different parameters and trying to understand how resolving the urls works in .net I think I've fixed the problem.
What I did I wrote the following:
editor.htmlValue.TemplateControl = this.ParentWebPart;
where the ParentWebPart is RichTextTest from the example above. I think setting this line helps the resolver to find the actual ascx file and then to resolve the url correctly.
just thought i might be usefull to know to somebody.
p.s. just found that you could highlight the code