problems with com registry

i have a c++ com server application ( exe ).
i've changed one of the events parameters from integer to BSTR.
although the tlb was changed the client still think it's an integer.
the problem is because :

in the registry type libarary section i get the exe file & not the tlb file.
y is that ? & how can i change it ?
( if i change it manualy i get a correct parameter in the client )

another question is how & where do i determine the version of this com ?

help !
yaeltAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

yodanCommented:
Use OLEView (MSVC6 package) to consult typelib of your EXE and see the typelib version.

If you change typelib spec a new CLSID is generated so you will have different implementation requests.
What I mean is that if you unregister the 'old' .EXE and then register the knew, you will have two different typelibs with same name. So for instance you will have INTERFACE_Myname (old) with CLSID1 and INTERFACE_Myname (new) with CLSID2... That isn't good so unregister old .EXE (if you can) that makes COM to refuse an object instantiation for old ActiveX.

So your client-project has the CLSID hard-coded and is looking for the old type of interface. At least in VB6 it works that way and you must change the client-project file .vbp by deleting old CLSID1 directly to get the add new reference the CLSID2.
In C++ you probably have to put the new CLSID on the reference list and remove the old one...

Hope it helps.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
yaeltAuthor Commented:
i c only one tlb with version 1.0
0
yodanCommented:
Do you have registered the new ActiveX-Exe?
The UUIDs change between different versions in ActiveX interfaces.
I'm working on a project that has more than two typelibs declared (in VB6):
 Component X (version 2.0)
 Component X (version 14.0)
and current version is 2.0 since I removed other versions and created a new component so version count restarted, however I failed to unregister version 14.0.

As rule of thumb I will look in client project for the UUID of the interface and compare it with the current EXE UUID (version number).

If you look for typelib button (2nd in toolbar) and select your exe you will have the EXE UUID, if you look in tree and typelibs you'll see registered interfaces.

You use the .tlb file to import the Exe definitions to the client so generate the new .tlb using MIDL.exe.

Besides this, I dont see extra points unless I shovel on the project files and start research how it links typelibs.
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

yodanCommented:
Elaborating on answer:
The COM-interface has a Global Unique IDentifier (GUID) that appears with UUID name in the OLEView or .idl files, but let's call it IID (Interface ID).

The COM-coclass or server implementation uses another GUID (or uuid) that we may call CLSID.

When you change the interface in the server a new typelib should be created, with new IID and a new CLSID (associated with the EXE file).
The typelib only has the IID not the CLSID.
The server has both.
After compiling the client project has the IID and the CLSID for the current references in the project, on VB it is automatic, on VC the values are passed as argument to the CoCreateInstance() call.

New binaries made, need to be registered anew. I don't know if a typelib can be registered using regsvr32.exe, I supose you just use it for compiling.
But if you register .exe, .ocx, .dll the interface (if it doesn't exist) is created and the Clsid is registered and associated with the file on disk.
I don't know if regsvr32 updates interface changes.
0
yodanCommented:
in my second comment, when I said:

1)
>>If you look for typelib button[...]
I was referring to the OLEView utility.

2)
>> if you look in tree[...]
I meant to say:
"however if you look in the tree of the first OLEView screen you will view the registry settings for your machine"
0
yodanCommented:
Put OLEView in EXPERT MODE.
0
yaeltAuthor Commented:
1.i use the oleview in expert mode.
2.i c only one tlb in it.
3. i want to c only 1
i dont want versions !!! i dont need the 2 interfaces. i need only the newer one ( which is the 1 i c on the oleview).
i just dont know y the exe use a different 1 & how 2 change it.
0
yaeltAuthor Commented:
i dont think i have 2 tlb's.
what i do know is that i get a different parameter when using the com. & when changing the registry typelib to point to the tlb file ( the default is that it points to the exe ) it's correct.
i dont know y it happens & how 2 change it.
0
yodanCommented:
I'm not saying you have 2 tlb's.
The registry keeps an history of the tlb's loaded once, unless you unload them.

You have an old spec being used by one of the projects (either the client or server).

I recommend that you change your CLSIDs, IIDs and AppIDs, delete any old binaries (or 'hide' them from windows).


To do that:
 1) before hiding try to unregister .exe:
   regsvr32.exe /u <component>

 2) generate new CLSIDs, IIDs, AppIDs. Recompile, register new server;

 3) remove from client-project any references for the old server-project and create them anew.

Run.
Does it find everything in correct place for running?

0
yaeltAuthor Commented:
i've tried that.
but it still doesnt work
0
yodanCommented:
If it is like in VB when you use the VStudio menus to add a reference in the client project and then add it (with check mark) again it still uses the first CLSID / IID introduced.

I need to edit in Notepad the .vbp (project file) so in VC is the probably the .dsp, to delete the old IDs.
If you include a typelib in your project for the client then you need new one. the .exp files and .lib files for ActiveX DLLs/EXE must be the fresh ones also.

Ever heard of regclean.exe ? I have a version I can send by mail (if you have one hotmail account... for example).
Cleans registry and generates an undo file if needed, but it's pretty safe.

If you have any references for the old project in the registry they will be removed. Be sure not to have any binary on the disk using the com interface.

After running regclean with 'Fix Errors' the interface should be clean from the registry.
0
yodanCommented:
I'm reviewing your question:
1) You now how to find COM version right?
2) You now the difference between a .tlb and a .EXE activeX server too?

Ans.2> the .tlb can_be/is_used when you want to generate another server for the same interface(s).

If you want to know to which binary-version the client is binding, or either to find wether the client is running the last server you implemented:
1) open newest server .EXE with OLEView, write down the server AppID (or LibID don't know name for sure):
  <uuid before the "library" keyword>
2) open OLEView and find in _'main'_ window for:
    \TypeLib\MYSERVER | <second 128 bit number is for binary>
0
yodanCommented:
> continue:
3) compare numbers, if they don't match the server is different from declared typelib.
0
yaeltAuthor Commented:
well every1 10x a lot
but i give up !
( i guess it sth with the pc cause it doesnt happen on a different 1 )
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.