Why did my shared component not work?

3 views (last 30 days)
Zu
Zu on 17 Aug 2012
Hi,
I created a COM component .dll using deploytool to make my matlab function callable in a VB application.
It works well in my pc which has installed matlab software. But it didn't work in another pc which doesn't have matlab after I unpacked the .dll file and MCR.
I was able to add the library reference in the VB application but I cannot check whether I successfully registered my library, since when I used mwregsvr mydll.dll in both my computer and the target computer, it just said "the specific module could not be found".
Thank you very much for your answer.
Regards,
Zu

Answers (1)

Kaustubha Govind
Kaustubha Govind on 17 Aug 2012
Looks like you might be missing some DLL dependencies. You can try profiling that DLL with Dependency Walker to see what DLLs are missing. Have you installed the MCR on the target machine already? If you compiled using Microsoft Visual Studio, you might need to install Visual Studio redistributables for the same version that you compiled with.
  2 Comments
Friedrich
Friedrich on 17 Aug 2012
Partly correct and incomplete.
Its most likely that a dependency is missing (So either some DLL's from the MCR, mwcomutil.dll not registered during the installation of the MCR, or some compiler dependencies (which is unlikely on the developer machine)).
Don't simply apply the Dependency Walker on the DLL. This wont help.
You need to to a runtime profile of the mwregsvr or regsv32 because of the delay load depenendcies of your DLL.
So in the case you want to profile the mwregsvr.dll do the following:
  1. download the dependencywalker here: http://www.dependencywalker.com/ (please make sure the bitness matches the bitness of your DLL)
  2. extract the archive and start the dependencywalker
  3. choose File -> open and select the mwregsvr.exe in the runtime\win64 or runtime\win32 subfolder of your MCR installation
  4. choose Profile -> start profiling
  5. a window pops up
  6. as a program argument add the path and name to the dll you like to register, e.g. "C:\some_folder\myfile.dll" (please put " around the path)
  7. press okay
  8. mwregsvr starts and tries to register the dll
  9. you will obtain that dependency walker starts logging the events
  10. after mwregsvr finished running (errored) investigate the log to find the reason of the error. Alternativly choose File -> Save As, save it as .dwi file and upload it somewhere. Then ask the community to have a look at the file
Kaustubha Govind
Kaustubha Govind on 21 Aug 2012
Nice. Thanks for the details Friedrich. Your comment should rightfully be an answer. My answer is not nearly as informed as yours. :)

Sign in to comment.

Categories

Find more on MATLAB Runtime in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!