Register COM DLL

Hi All,
I have a shell extension DLL, (COM DLL). I can easily register it on my personal machine, (I have the development environment).

I am using VS2012 as my development IDE.
I want to register the DLL on a new machine (there is no development environment). I searched online, and found I need to install VC_REDIST for 2012. I installed the redist from http://www.microsoft.com/en-us/download/details.aspx?id=30679

I am still getting the error
“The module “Filename.DLL” failed to load”

“Make sure the binary is stored at the specified path or debug it to check it for problems with the binary or dependent .DLL files”

“The specified module could not be found”

I am using 32bit build, and 32bit taget operating system.

On 24/05/2013 08:59, xxxxx@gmail.com wrote:

I am still getting the error
“The module “Filename.DLL” failed to load”

“Make sure the binary is stored at the specified path or debug it to check it for problems with the binary or dependent .DLL files”

“The specified module could not be found”

I am using 32bit build, and 32bit taget operating system.

You should use Dependency Walker (depends.exe) to check that you have
all required DLLs installed. Are you trying to load a release build of
Filename.DLL? If not, you’ll be linking against the debug CRT, which
isn’t included in the runtime installer.


Bruce Cran

Hi Bruce,
I used Dependency walker, it shows the missing “MSVCR110.dll”

I am using a RELEASE build.

On 24/05/2013 09:41, xxxxx@gmail.com wrote:

I used Dependency walker, it shows the missing “MSVCR110.dll”

The redistributable you installed is for VS2012 Update 1. Have you
checked that your VS2012 installation is Update 1, or is is Update 2 or RTM?


Bruce

COM components have the extension .OCX, not .DLL. And no DLL is ever
“registered”; the concept does not exist. But as you saw from the error
below, it is not your DLL that is the problem.

On 24/05/2013 09:41, xxxxx@gmail.com wrote:
> I used Dependency walker, it shows the missing “MSVCR110.dll”

The redistributable you installed is for VS2012 Update 1. Have you
checked that your VS2012 installation is Update 1, or is is Update 2 or
RTM?


Bruce


NTDEV is sponsored by OSR

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

On 24/05/2013 16:24, xxxxx@flounder.com wrote:

COM components have the extension .OCX, not .DLL. And no DLL is ever
“registered”; the concept does not exist. But as you saw from the error
below, it is not your DLL that is the problem.

http://support.microsoft.com/kb/207132

“This article describes how the RegSvr32.exe program registers and
unregisters a Component Object Model (COM) dynamic-link library (DLL).
You can use this information to troubleshoot errors that occur when you
try to use RegSvr32.exe program with your COM DLL.”

“Most often, RegSvr32.exe fails because the *LoadLibrary*,
*DllRegisterServer*, or *DllUnregisterServer* function fails.
*LoadLibrary* can fail if the DLL is not in the specified path, or if
the specified path is incorrect. *LoadLibrary* can also fail if one of
the dependencies of the DLL that you are trying to load is not met; in
other words, if a dependent DLL is not present or is not in the
specified path.”


Bruce Cran

xxxxx@flounder.com wrote:

COM components have the extension .OCX, not .DLL. And no DLL is ever
“registered”; the concept does not exist. But as you saw from the error
below, it is not your DLL that is the problem.

Joe, this statement is just silly. COM components can have whatever
extension you want, just like any other DLL. The fact is that, although
you do find COM components with extensions like .ocx, .vbx, .ax, and
.drv, the VAST majority of COM components use .dll.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

> VAST majority of COM components use .dll.

and quite a few important ones .exe …

Dave Cattley

Bruce, I am using VS2010 Update 1.

http://support.microsoft.com/kb/207132, doesn’t help me.

Can anyone compile/build DLL from http://code.msdn.microsoft.com/CppShellExtContextMenuHandl-410a709a, and then try to register it on a clean OS, and tell me if it works for them?

It doesn’t and I have no idea why it doesn’t

xxxxx@gmail.com wrote:

Bruce, I am using VS2010 Update 1.

Now, wait. In your first message, you said you were using VS2012.
Which is it? You HAVE to install the runtime library that matches the
compiler you used. You said you were missing MSVCR110.DLL, which is the
runtime for VS2012, so there is some confusion.

Are you still missing MSVCR110.DLL? Do you see MSVCR110.DLL in
\Windows\system32 (or \windows\syswow64, if you are running a 32-bit app
on a 64-bit system).

Alternatively, you could just change the project properties to use the
static runtime (/MT) instead of the DLL runtime (/MD). That eliminates
all of this crap.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

I presume this is a UM driver. One possible solution is to statically
link the CRT into it.

As pointed out already, the problem is not with your DLL, but a DLL that
it requests. Registering it as a COM component has nothing to do with its
failure to find its required CRT DLL. In fact, a perfect entry in the
Registry coupled to its various GUIDs is completely and utterly useless if
critical DLLs in uses (like the CRT) are not findable.
joe

Bruce, I am using VS2010 Update 1.

http://support.microsoft.com/kb/207132, doesn’t help me.

Can anyone compile/build DLL from
http://code.msdn.microsoft.com/CppShellExtContextMenuHandl-410a709a, and
then try to register it on a clean OS, and tell me if it works for them?

It doesn’t and I have no idea why it doesn’t


NTDEV is sponsored by OSR

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

On 25/05/2013 16:42, xxxxx@flounder.com wrote:

I presume this is a UM driver. One possible solution is to statically
link the CRT into it.

As pointed out already, the problem is not with your DLL, but a DLL that
it requests. Registering it as a COM component has nothing to do with its
failure to find its required CRT DLL. In fact, a perfect entry in the
Registry coupled to its various GUIDs is completely and utterly useless if
critical DLLs in uses (like the CRT) are not findable.

This isn’t a driver at all - it’s a shell extension. It’s actually a
VS2010 solution, and so will require the appropriate VS2010 CRT to be
installed. Since I don’t have VS2010 I built it in VS2012 and verified
that it works either after statically linking in the CRT (“Configutation
Properties | C/C++ | Code Generation | Runtime Library. You want /MT”)
or installing the Visual C++ 2012 Update 1 CRT (unlike with VS2010, it
seems a new CRT isn’t needed for every SP/update).


Bruce Cran

I did a shell extension a few years ago, and it was a nightmare; because
of the various versions of the DLLs that were required. It needed entry
points in existing DLLs that were not in the versions of the DLLs that
were installed. I finally outsourced the solution to a group of people
who wrote shell extensions for a living, and they had problems, but they
eventually got it to work. This was over 10 years ago, and I no longer
remember the details of what they had to do, but I do recall it wasn’t
trivial. A lot of it had to do with issues of multiple storage allocators
(if you statically link the CRT and ATL DLLs, you can end up with multiple
allocators and get all kinds of problems; if you use DLLs, such as a lot
of the ATL support DLLs, there are additional version skew problems. We
had all of these.
joe

On 25/05/2013 16:42, xxxxx@flounder.com wrote:
> I presume this is a UM driver. One possible solution is to statically
> link the CRT into it.
>
> As pointed out already, the problem is not with your DLL, but a DLL that
> it requests. Registering it as a COM component has nothing to do with
> its
> failure to find its required CRT DLL. In fact, a perfect entry in the
> Registry coupled to its various GUIDs is completely and utterly useless
> if
> critical DLLs in uses (like the CRT) are not findable.

This isn’t a driver at all - it’s a shell extension. It’s actually a
VS2010 solution, and so will require the appropriate VS2010 CRT to be
installed. Since I don’t have VS2010 I built it in VS2012 and verified
that it works either after statically linking in the CRT (“Configutation
Properties | C/C++ | Code Generation | Runtime Library. You want /MT”)
or installing the Visual C++ 2012 Update 1 CRT (unlike with VS2010, it
seems a new CRT isn’t needed for every SP/update).


Bruce Cran


NTDEV is sponsored by OSR

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

It’s not bad these days. You’re even allowed (i.e. it’s actually supported) to write shell extensions in Managed Code (C# or VB.Net) now.

Peter
OSR

> COM components have the extension .OCX, not .DLL.

Sorry, this is blatantly wrong.

COM components are DLLs. Sometimes they have other suffixes like .OCX or .AX, but they are DLLs, and often have the .DLL suffix.

And no DLL is ever “registered”; the concept does not exist.

COM component DLLs ARE registered.


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

>Managed Code (C# or VB.Net) now.

It’s interesting for me whether anybody actually uses VB.Net for anything other then legacy VB6 code.


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

Agree Maxim. I personally use VB.NET as replacement to VB6.

>> COM components have the extension .OCX, not .DLL.

Sorry, this is blatantly wrong.

COM components are DLLs. Sometimes they have other suffixes like .OCX or
.AX, but they are DLLs, and often have the .DLL suffix.

> And no DLL is ever “registered”; the concept does not exist.

COM component DLLs ARE registered.

You might be surprised at how many questions we got in the old MFC
newsgroups about various CRT DLLs, MFC DLLs, and application-specific DLLs
that could not be found because they were not “registered”, and one of the
most common questions went “As part of my project, I wrote a DLL. But
when I try to run the .exe file, it can’t find the DLL. How do I register
the DLL so my app can find it?”
joe

Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com


NTDEV is sponsored by OSR

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Hi Bruce Cran,
I have used “MT” but still the same error.
Dependency walker still shows MSVCR110.dll missing

I am using the following version of VS (from about VS menu)

“Microsoft Visual Studio Professional 2012
Version 11.0.51106.01 Update 1
Microsoft .NET Framework
Version 4.5.50709”

On 27/05/2013 08:19, xxxxx@flounder.com wrote:

You might be surprised at how many questions we got in the old MFC
newsgroups about various CRT DLLs, MFC DLLs, and application-specific DLLs
that could not be found because they were not “registered”, and one of the
most common questions went “As part of my project, I wrote a DLL. But
when I try to run the .exe file, it can’t find the DLL. How do I register
the DLL so my app can find it?”

It doesn’t help when you have pages from Microsoft like
http://msdn.microsoft.com/en-us/library/windows/hardware/ff548642(v=vs.85).aspx
:

“A user of DIFxAPI must register /Difxapi.dll/ with Windows before an
application can dynamically link to it.”


Bruce Cran