How COM stuff works?

Hi All,

First, let me describe the situation. Althought this is a general question, please don't point me to read some MS book about this topic. I'll try to be short.

I am trying to write a Delphi app that works with my SkyStar2 DVB card. The card comes with a file called Sky2PCAVSrc.ax. This file implements some interfaces and can be registered by RegSvr32. I have also the SDK with some documents, but I noticed that the documents and the actual file set do not match! I meant the doc describes such a things that are not supported by the actual driver!!!

So I asked myself: If I cannot rely on the SDK documentation, how can I get the information directly from the driver?

But the file (Sky2PCAVSrc.ax) does not look like a kind of a TypeLib, so I cannot get any interface from it.

Indead, I made a "wild" try: I added a method declaration to the interface defined in the SDK, called "Blabla" with a random parameter list. That means it is a method that absolutely has no corresponding implementation in the driver's code. Then I compiled the application. Certaintly, the compiler did not complain. How could it know that it was a fake method. I had told the compiler that I have an object that implements an interface that has the Blabla method, and the compiler belived me. That was OK.

Then ran the application. It was successful to create the object of fake interface without any error / exception. The call to Blabla returned a negative value, probably saying its execution was failed.

Now my question is how COM stuff works? How can I figure out what is the real interface of the driver? I cannot rely on SDK doc, because it is simply useless. I cannot query the interface's description programatically (maybe because I don't know how). If I make a method call and get error, I even cannot know whether the method doesn't exist at all, or if it exists, but fails because of other reasons.

What shoud you do in this case?

Regards,

ttd
LVL 1
ttdAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
NetminderConnect With a Mentor Commented:
Closed, 125 points refunded.
Netminder
Site Admin
0
 
2266180Commented:
the ax extension and the fact that it registered with the system makes me believe that indeed it's a COM dll which means that yo extract the necessary type information from it. (you can try to use a COM exploirer, this is the one I found on a quick search: http://www.4developers.com/com/index.htm )
you can also try to import it from delphi directly to create the pas files. I fyou don't find it in the loist (though I doubt that since it got regitered), then click on add and browse for the ax file.

after you have the pas files or the com exploerer listing, you should be able to get things going
0
 
ttdAuthor Commented:
As I wrote before, I cannot import it as a TypeLib into Delphi. I always get:

---------------------------
Error
---------------------------
Error loading type library/DLL.
---------------------------
OK  
---------------------------

COM Explorer didn't list it.
0
[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

 
ttdAuthor Commented:
If anyone want to try, it can be downloaded from:

http://www.bbti.us/download/windows/Technisat_DVB-PC_4_3_2_COMPACT.zip

You may not be able to install the driver if you don't have the DVB card, but you can extract the file from setup disk, then register it manually. It's a DirectX filter, but is a COM object also.
0
 
2266180Commented:
directx filters are com objects :)

does graphedit pick it up? (you can find it in directx sdk. or on the internet in some places)
0
 
ttdAuthor Commented:
Yes, of course, GraphEdit do pick it up. Software that requires it works fine. But again, all I want is to extract the interface description from it if possible.
0
 
2266180Commented:
I tried to get the filter out of there without installing the software. it's not exactly a happy thing to install drivers and stuff in windows if you don't need them since some stuff will remain after uninstallation.

I presume that you installed it correctly and loaded the neceesary reg fiels I saw in that archive or whatever else you have to do in order to install it (I haven't read through the help/readme/txt files)

regarding this issue: I made a small investigation and it turns out that directx filters are not activex controls. that is why you cannot import it.

now what I suggest is to use dspack from progdigy.com that will allow you to use the directx filter (among a lot more other stuff) I believe that a simple filtergraph should be enough to get it working.

there are of course tools to display filter properties but it's been a year since I last worked with this and can't remember what I used (can't fnd anything in this matter on my hdd either)
tehj basic usage is that you will render the filter's pin in order to get the stream going. you can of course connect the pins yourself if you know exactly what filters you need and want to be connected.

now what you have done in graphedit, you will do in delphi using the filtergraph component. the exact graph you created in graphedit needs to be created in filtergraph component: either by manually connecting the pins, or by rendering the input/output pin of your filter.

progdigy.com also has a forum in which you can ask for further assistance if you think I cannot help you enough. Those people there know more about this issue than I do anyway :)

cheers
0
 
ttdAuthor Commented:
ciuly:

Thank for trying to help me, but you missed my question. My question is not how to use that particular filter. As I wrote, it works fine for me.

Beside the fact it is a filter, it has implemented some interfaces and my question was how to extract/see/display/list/whateveryouwant them.

In general, my question was how to extract an arbitrary interface of a COM object?

Again, thanks for trying. But please try to understand the problem first!

BTW, I have answered my question myself: If the typelib information is not embedded in the image file at compile-time, there is no way to query the interface later. The only way to use the interface is to rely on the SDK's docs, but if the docs lie, things will go wrong. That's all.
0
 
2266180Commented:
sorry for missing the point of your question.

you can ask in community support for a point refund ;)
0
All Courses

From novice to tech pro — start learning today.