Solved

How COM stuff works?

Posted on 2006-06-30
10
298 Views
Last Modified: 2010-04-05
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
0
Comment
Question by:ttd
  • 4
  • 4
10 Comments
 
LVL 28

Expert Comment

by:ciuly
ID: 17021650
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
 
LVL 1

Author Comment

by:ttd
ID: 17021712
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
 
LVL 1

Author Comment

by:ttd
ID: 17021743
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
 
LVL 28

Expert Comment

by:ciuly
ID: 17021751
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 1

Author Comment

by:ttd
ID: 17022657
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
 
LVL 28

Expert Comment

by:ciuly
ID: 17038068
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
 
LVL 1

Author Comment

by:ttd
ID: 17040335
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
 
LVL 28

Expert Comment

by:ciuly
ID: 17040417
sorry for missing the point of your question.

you can ask in community support for a point refund ;)
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 17076085
Closed, 125 points refunded.
Netminder
Site Admin
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now