BB FlashBack SDK와 ActiveX 버전 관리
이 글은, ^^ 저에게 특별한 신뢰를 보내준 "
Blueberry Software" 사의 홍보를 겸해서 써봅니다. Blueberry 소프트웨어에서 제공하는 제품 중에서 "
FlashBack Screen Recorder SDK"가 있는데요. 화면을 동영상으로 캡쳐해 주는 기능을 제공합니다.
SDK를 설치하면 몇 개의 ActiveX를 레지스트리에 등록하는 데요. 여기서, 보통 우리가 생각지 못한 응용 사례를 하나 볼 수 있습니다.
예를 들어, 화면을 캡쳐하는 ActiveX의 경우 아래와 같이 등록되어 있습니다.
HKEY_CLASSES_ROOT\CLSID\{A3CD4BF9-EC17-47A4-833C-50A324D6FF35}\InprocServer32
REG_SZ 값: BB FlashBack Recorder.dll
그래서, 이렇게 등록된 ActiveX를 사용하면 다음과 같은 오류가 발생합니다.
System.InvalidOperationException was unhandled
Message="An error occurred creating the form. See Exception.InnerException for details.
The error is: 지정된 모듈을 찾을 수 없습니다. (Exception from HRESULT: 0x8007007E)"
Source="FBRecorderSample"
StackTrace:
at FBRecorderSample.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
at FBRecorderSample.My.MyProject.MyForms.get_MainForm()
at FBRecorderSample.MainForm.Main() in D:\temp\scr_rec\MainForm.vb:line 7
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.IO.FileNotFoundException
Message="지정된 모듈을 찾을 수 없습니다. (Exception from HRESULT: 0x8007007E)"
Source="System.Windows.Forms"
StackTrace:
at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid)
at System.Windows.Forms.AxHost.CreateWithoutLicense(Guid clsid)
at System.Windows.Forms.AxHost.CreateWithLicense(String license, Guid clsid)
at System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid)
at System.Windows.Forms.AxHost.CreateInstance()
at System.Windows.Forms.AxHost.GetOcxCreate()
at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)
at System.Windows.Forms.AxHost.CreateHandle()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.AxHost.EndInit()
at FBRecorderSample.MainForm.InitializeComponent() in D:\temp\scr_rec\MainForm.vb:line 263
at FBRecorderSample.MainForm..ctor() in D:\temp\scr_rec\MainForm.vb:line 19
InnerException:
그럴 수밖에 없는 것이, InprocServer32 키에 해당 ActiveX의 전체 경로가 등록되지 않고 dll 이름만 있기 때문입니다. 처음 이 사실을 알았을 때는, "Blueberry Software"가 등록 코드에 버그를 가지고 있다고 생각했습니다.
그런데, 그들로부터 온 답변이 재미있습니다. 보통, COM 개체에서 버전관리는 ProgID를 통해서 하는데, 실제로 프로그래밍 상에서 COM 개체를 사용하는 것에는 이런 ProgID를 통한 버전 관리가 그다지 의미가 없다는 것입니다. 듣고 보니 ^^ 맞습니다. 돌이켜 보면, 저도 COM 개체 생성을 ProgID로 했던 적은 HTML 페이지에서 생성하는 것을 제외하고는 전무했으니까요.
이런 문제를 InprocServer32에 DLL 이름만 기록하는 것과 함께 해당 DLL을 EXE와 동일한 폴더에 "복사"하는 방식으로 버전 관리를 해결하고 있습니다. 어떠세요? 독특하죠? 괜찮은 응용 사례라고 생각됩니다.
[이 토픽에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]