Japeth's great Comview shows the flag's and TypeKind.

Ok, CanCreate to me means I can instantance this Com dispatch or object.

Why can I not get it done, either using Comview or in Asm code.

I keep getting:

ClassFactory cannot supply the requested class [80040111]


I know this COM server is good because another APP is passing me the dispatch object I want.

I need to create access without this other APP being involved.


Any help Guys.


Q2.

If CoClass is defined does that mean that one of them is a registered class? ....ie...Accessible?


Q3.

Some methods return a Variant..which is an Dispatch to a Unknown object.

Unknown , but in a range of objects.

Is there a way to determine what COM dispatch is being given back.

Like the address may guess one a clue of a way to trace the address?

Gets really hard to program with out any doc on some of these COM dll's.

Any help would be appreciated.

Thanks again

StillLearning
Posted on 2004-06-09 21:40:43 by StillLearning
Hi StillLearning,

Q1: cancreate doesnt mean you can create the object in any case. Some require licence information, others refuse to work with unknown clients. Its totally up to the server to create an instance or not.

Q2: ???

Q3: if you get an unknown IDispatch, you can call IDispatch:GetTypeInfo.With typeinfo available it should be easy to determine what object you have get.

Japheth
Posted on 2004-06-10 00:32:59 by japheth
japheth:

Thanks for the reply.


Q3: If you get an unknown IDispatch, you can call IDispatch:GetTypeInfo.With typeinfo available it should be easy to determine what object you have get.

Ok, I am most likely asking the question wrong or don't understand the answer.

I receive a dispatch, it is a dispatch not a type unknown, it is just unknown, which COM server or interface this return goes too.

It could be 1 of many, maybe 25.

Is there a utility that can trace the address of the return to find the proper one?

Say a program that shows all of the dll's,ocx,exes,tlb that are in memory and shows the dispatch entrys, if it has any?

I enter my returned address and it finds the address and dispatch it belongs too.

I see that COMview can do some of this, (maybe all of it), but when I look at ROT objects that I know are active in memory I don't see listed here.


Thanks

StillLearning
Posted on 2004-06-11 22:59:39 by StillLearning
Hi stilllearning,

> but when I look at ROT objects that I know are active in memory I don't see listed here.

its totally up to the server if it registers in the ROT. Usually only EXE-servers will register here

> Say a program that shows all of the dll's,ocx,exes,tlb that are in memory and shows the dispatch entrys, if it
> has any?

- 1. tlbs are no servers
- 2. exes are in another process
- 3. dll/ocx: to get the name of the binary
a) with COM methods: call IDispatch::GetTypeinfo, then ITypeInfo::GetDllEntry
b) with OS methods: use Module32xxx to get the modules in your process, then compare addresses.

Regards

Japheth
Posted on 2004-06-12 01:05:20 by japheth
japheth:

Thanks for the reply.


Q3: If you get an unknown IDispatch, you can call IDispatch:GetTypeInfo.With typeinfo available it should be easy to determine what object you have get.

Ok, I am most likely asking the question wrong or don't understand the answer.

I receive a dispatch, it is a dispatch not of type unknown, it is just unknown, which COM server or interface this return goes too.

It could be 1 of many, maybe 25.

How can I find the COM that is it referencing.

Thanks

StillLearning
Posted on 2004-06-12 12:12:24 by StillLearning
Hi stilllearning

> How can I find the COM that is it referencing.

It would be helpful if you ask your questions a bit more exactly.
What do you want?
the CLSID? -> get it from typeinfo
the name of the DLL? -> as already mentioned to get from typeinfo as well (most likely)

Regards

Japheth
Posted on 2004-06-13 04:40:56 by japheth
When one is learning and not exactly sure of the correct verbage many mistakes in the purposing of questions will occur.

Hence my inability to properly ask the question in a manner that is completely understood.

I also find it hard to learn this by typing questions, when a couple of hours hands on with a knowledgeable party would do wonders.

As we all know when learning, one question leads to many more.

Please excuse this short coming for the time being and thank you all any help you can provide.


************

A method returns a variant.

This variant is an address to another interface dispatch object , be it contained in the current COM server dll or perhaps it is in another COM server dll.

The question is:

Because the "INCLUDE" lib does not specifically specify the interface name (as some do) , how do I find out what interface this address belongs too?


Thank You

StillLearning
Posted on 2004-06-13 11:18:26 by StillLearning
hi stilllearning,

I still have the same answer: get the typeinfo of the object

How do you do that:

1. you have a variant with type VT_DISPATCH
2. use this IDispatch object to get its typeinfo by calling IDispatch:GetTypeInfo

for example:

vf(vt.pdispVal, IDispatch, GetTypeInfo), 0, addr pTypeInfo
.if (eax == S_OK)
invoke vf(pTypeInfo, ITypeInfo, GetTypeAttr), addr pTypeAttr
.if (eax == S_OK)

now in the TYPEATTR struct there should be all info you want!


Regards

Japheth
Posted on 2004-06-13 13:09:26 by japheth
Ok, Thank you.

Invoke vf(vt.pdispVal, IDispatch, GetTypeInfo), 0, addr pTypeInfo

gives me an error: too few arguments to INVOKE

And How should the Addr pTypeAttr should be defined in my code?

Thanks

StillLearning
Posted on 2004-06-13 17:40:51 by StillLearning
stilllearning,

I have coded the example from scratch without testing it because I assumed that someone asking questions in the COM forum is able to help himself if he gets an assembler error.

> gives me an error: too few arguments to INVOKE

Yes, the GetTypeInfo method requires another parameter. Please use the docs to find out which one.

> And How should the Addr pTypeAttr should be defined in my code?

For example I define such variables:

local pTypeAttr:ptr TYPEATTR

Again: if you get an assembler error when using this sample please read the docs!

Regards

Japheth
Posted on 2004-06-14 00:28:47 by japheth
I would indeed read the DOC's if I know what Doc's you are referring to.


I have coded the example from scratch without testing it because I assumed that someone asking questions in the COM forum is able to help himself if he gets an assembler error.



And I would not bother you with such newbie questions if I know what the parms meanings were that were suppose to be present.

I am in no way attempting to annoy you with such simplistic questions.

If a COM for ASSEMBLER book was available I would buy it and attempt to procede down the road on my own, but alas, none that I know of exists.

I can only hope that you will continue to assist me and forgive my seemingly ignorant questions.

Thank You

StillLearning
Posted on 2004-06-14 00:48:56 by StillLearning
Hi stilllearning,

> I would indeed read the DOC's if I know what Doc's you are referring to.

I simply refer to the SDK docs, where COM and Automation is described, for example the GetTypeInfo method and the TYPEATTR structure. Its of course a bit C-related and so you may have to "translate" it to ASM.

Regards

Japheth
Posted on 2004-06-14 07:51:40 by japheth