The COM Course - Part 3--By Karl Moore

原创 2002年03月20日 09:08:00
Search VB-World:         
home_off.gifarticles_on.gifcode_off.gifprojects_off.gifbooks_off.gifreviews_off.gifdiscuss_off.gif >
  Home  > ActiveX Development > Articles
email_button.gif Email this page
print_button.gif Printer Friendly
more_button.gif More From Karl
feedback_button.gif Post Feedback

The COM Course - Part 3
The COM Course - Part 2
The COM Course - Part 1
ActiveX Control Tutorial - Part 5
ActiveX Control Tutorial - Part 4

Hot Picks
VB.NET Uncovered: Big Changes
VB.NET Uncovered: Working the Web
Control the Panel
Kill Context
Learn to Program with Visual Basic 6

The COM Course - Part 3

By Karl Moore


At the end of last week, we stumbled across a small problem. Well, rather a big problem actually.

In fact, if you've got time, it was a whopping great huge problem wearing high heels, a frilly skirt and holding a massive sign stating "I am a BIG problem!".

You see - we compiled our ActiveX DLL, then compiled a test program that used our DLL. Then we recompiled our DLL ?something you usually do after you make changes. Suddenly, our test program no longer worked. Damn.

If we had then recompiled our test program, it would've worked. But let's say your VB program, an Excel spreadsheet and one C++ accounts package all use your DLL. Do they all need to be 'recompiled' every time you make a small change to your ActiveX DLL?

The answer is, thankfully, no.

The reason we experienced problems last week was due to an issue known as compatibility. Or rather, a lack of it.

  • Open up your Northwind project in Visual Basic
  • Click 'Project', 'Northwind Properties'
  • Click the 'Component' tab


Take a peek at the 'Version Compatibility' frame in front of you. Here we have three options. Let's explain these now:

No Compatibility ?With every compile, your COM component gets assigned a new 'signature'. This means programs looking for older 'signatures' (the previous version of the DLL) ?simply flop Project Compatibility ?With every compile, your COM component is assigned a new signature ?and still, any using-applications still flop. The only change here is that 'big' differences between your current project and a previous DLL project are highlighted as you compile. Ohhh, whoop-de-doo Binary Compatibility ?When compiled, your application attempts to keep the signature of a previously compiled DLL, thus ensuring any applications using it don't magically turn into the Blue Screen of Death. However if the differences between your previously compiled DLL and your to-be-compiled DLL are too great, a new signature must be assigned

So let's test our theory:

  • Open last week's test application
  • Recompile it
  • Trial run your test application ?it should work
  • Open our ActiveX DLL project
  • Set the Binary Compatibility option
  • Recompile your DLL
  • Attempt to run your test application ?it should still work

Hurrah! It may sounds like complete hogwash, but when recompiling their DLLs, most developers get themselves into an awfully incompatible situation.

But hopefully you won't ?all thanks to this small aside.

Well, that's compatibility for you. About as exciting as


ActiveX EXEs next.gif

  In This Article

Introduction - Compatibility - ActiveX EXEs - Creating a Test ActiveX EXE - Instancing - Creating a Test Application - Distributing Components - Where to Go from Here - Conclusion -

ActiveX | Beginning | Controls | Databases | Files | Graphics | Misc | Mouse | Registry
Home | Articles | Code | Projects | Books | Reviews | Discussion Forums
Tech News | Contact Us | Site Map | Join Newsletter | Link To Us
Copyright ©1997-2001 Jelsoft Enterprises Limited. All rights reserved. Privacy Policy.


Realm应用背景 Android自带的SQLite数据库,在多数场合能够满足我们的需求,但随着app广泛使用,SQLite也暴露了几个不足之处: 1、开发者编码比较麻烦,而且还要求开发者具备SQL语...
  • aqi00
  • aqi00
  • 2016年04月13日 17:13
  • 6629

google python 入门教学课程

Google's Python Class Welcome to Google's Python Class -- this is a free class for people with a li...
  • mailyangy
  • mailyangy
  • 2014年01月01日 17:33
  • 3631

5道较难的数据库查询习题(Intermediate SQL)

习题之前,我们先建立了11张表: create table classroom (building varchar(15), room_number varcha...
  • u010983710
  • u010983710
  • 2013年10月26日 10:04
  • 3990

vc++中读取xml有几种方式,可视tinyxml算是最简单的了 为了大家更方便的使用,简述一下过程,有问题可以留言: 1、下载tinyxml tinyxml,自己在里面找找 解压后包括两部分,tin...
  • ybh89
  • ybh89
  • 2011年03月10日 10:58
  • 265

经典编程:DLL地狱及其解决方案 文章出处:飞诺网(

原作者:Ivan S Zapreev      译者:陆其明      概要      本文将要介绍DLL的向后兼容性问题,也就是著名的“DLL Hell”问题。首先我会列出自己的研究结果...
  • begges
  • begges
  • 2011年09月06日 13:11
  • 1086

Java Intensive 7 day Course(part3 高级篇)

  • 2008年12月25日 21:42
  • 8.22MB
  • 下载

a first course in probability 概率论基础教程 英文第5版 PDF格式 (part3 )

  • 2010年02月10日 13:15
  • 2.93MB
  • 下载

使用internal(和hidden(@hide)APIs – Part 3

  • wo6925371
  • wo6925371
  • 2012年04月17日 13:40
  • 598

Constraint Layout [Animations | Dynamic Constraints | UI by Java] ( What the hell is this )[Part3]

Android ConstraintLayout 布局介绍
  • xue4345
  • xue4345
  • 2017年03月16日 16:51
  • 330

TCL_TK组合教程(第二版)[part3](The Complete Tcl/tk Training Course)

  • 2009年03月18日 21:23
  • 14.31MB
  • 下载
您举报文章:The COM Course - Part 3--By Karl Moore