Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a mass of dlls and ocxs built in VB6, each time I rebuild these projects all the guids representing the objects are changed. I build using VB6.exe /make.

This causes me a lot of problems with some .net code that uses these components, i.e. if I build the vb6 I have to regenerate the .net interop dlls to reflect the new GUIDs

So my question is: Is there a way to Fix the GUIDs so they never change no matter how many times the vb6 projects are rebuilt?

P.s. All the VB6 projects have binary compatibility on.
Posted

Set Binary Compatibility in Component tab of project properties.
http://blogs.msdn.com/b/adam_nathan/archive/2003/10/19/56779.aspx[^]
 
Share this answer
 
v2
Comments
Mehdi Gholam 12-Sep-11 7:31am    
HeHe, just posted the same. 5!
Prerak Patel 12-Sep-11 7:49am    
Thanks
ARopo 12-Sep-11 9:09am    
Thanks, I did have binary compatability on, but still got new guids. However your answer led me to look at it in more detail and I discovered that the binary compatable dll referrenced had a different type lib version to the dll I was buildinf and hense generated new guids. I updated the dll reference and hey presto consistant guids.
Prerak Patel 12-Sep-11 23:19pm    
You are welcome.
You can tell VB6 to reuse GUID's by changing the compatbility setting of the project to from "No Compatbility" to "Binary Compatibility". You can find these settings under Project->Your-Project Properties. The compatibility setting is on the Component tab of the Project Properties window.
 
Share this answer
 
Comments
ARopo 12-Sep-11 9:09am    
Thanks, I did have binary compatability on, but still got new guids. However your answer led me to look at it in more detail and I discovered that the binary compatable dll referrenced had a different type lib version to the dll I was buildinf and hense generated new guids. I updated the dll reference and hey presto consistant guids.
Mehdi Gholam 12-Sep-11 9:20am    
Yep Hee!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900