Discussion:
LoadIFilter succeeds on W2K but fails on XP (Autodesk's DWG IFilter) -- who's to blame?
(too old to reply)
Antti Nivala
2006-11-01 20:05:41 UTC
Permalink
I have encountered a problem in using Autodesk's DWG IFilter on Windows XP.
This IFilter gets installed with AutoCAD 2006 and newer as well as with
AutoCAD LT 2006 and newer.

Calling LoadIFilter for a DWG file succeeds on Windows 2000 in my test
application (both in an STA thread and in an MTA thread, using C++).

The problem:

The same LoadIFilter call for a DWG file fails on Windows XP if COM has been
initialized to MTA in the calling thread. The error code is 0x80004002 (No
such interface supported). The call succeeds if I initialize COM to STA in
the calling thread.

I can get the LoadIFilter call to succeed in an MTA thread if I change the
DWG IFilter component's threading model from Apartment to Both in the
registry.

So clearly this is a COM threading related issue. Additionally, it is
somehow also related to some difference between Windows 2000 and XP because
the problem does not occur on Windows 2000 systems. Anyway, what I am
interested in is how to get this to work on Windows XP without making the
changes to registry.

I guess that I can solve the problem if I can change our application so that
it always uses IFilters from an STA thread. But before going that way, I
would like to understand why I would have to do that. Shouldn't COM let me
use the IFilter component from an MTA thread? Since this is not working in
practice in this case, where is the actual problem? Is Autodesk's DWG
IFilter component faulty in this respect? Or am I doing something wrong in
my very simple LoadIFilter call? Or is there an architectural reason why an
IFilter whose threading model is Apartment cannot be invoked from an MTA
thread?

If I call LoadIFilter from an STA thread, will that work for all IFilters?
Or can there be some IFilter components out there that require MTA instead?

Please direct me to the correct newsgroup if this is a wrong one.

Antti
WenYuan Wang
2006-11-02 05:30:43 UTC
Permalink
Hi Antti,
First of all, I'd like to confirm my understanding of your issue.
According to your description, I understand that you encountered an issue
when using Autodesk's DWG IFilter.
If I misunderstood anything here please don't hesitate to correct me.

I'm afraid this issue is related to Autodesk's DWG IFilter.
But this forum is used to support Microsoft Index Server.
So we suggestion you send this issue to the following NewsGroup:
comp.cad.autocad
You will get more information on this issue there.

If there is anything unclear, please feel free to post in the newsgroup and
we will follow up.
Wen Yuan
===============================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
===============================
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Antti Nivala
2006-11-02 07:44:57 UTC
Permalink
I know that this is an Indexing Server forum. Is there a more specific forum
where I can ask questions about developing IFilters?

I understand that this may be a problem in Autodesk's IFilter. However,
there are some articles on the Internet that seem to suggest that the
IFilter system itself would somehow be sensitive to the threading model of
the IFilter component:

http://www.codeproject.com/csharp/IFilter.asp

Or, it might just mean that there are several badly written IFilter
components out there.

Can you confirm that a properly written IFilter component should work when I
invoke it using LoadIFilter from an MTA thread, regardless of how the
IFilter's ThreadingModel attribute has been set in the registry (e.g.
ThreadingModel=Apartment)?

Antti
WenYuan Wang
2006-11-03 05:04:11 UTC
Permalink
Hi Antti

As far as I know, I'm afraid there is no such forum related to the IFilter
in MSDN.
I'm sorry we can't provide you more information on this issue as we are not
familiar with IFilter.

Sincerely,
WenYuan

Loading...