Microsoft KB Archive/258942

{|
 * width="100%"|

BUG: Browseh In-Process COM Sample Does Not Expose Entry Points

 * }

Q258942

-

The information in this article applies to:


 * Microsoft Platform Software Development Kit (SDK)

-

SYMPTOMS
After you build and register the Browseh sample in the Platform SDK, when you try to run the Microsoft Visual Basic client application that is included with the sample, you may not see any results. When you attempt to create the Browseh COM component from another client, such as OLEVIEW, you may receive the following error message:

Microsoft Windows NT 4.0

CoGetClassObject failed. Class not registered. REGDB_E_CLASSNOTREG ($80040154)

Microsoft Windows 2000

CoGetClassObject failed. Error in the DLL CO_E_ERRORINDLL ($800401f9)

CAUSE
Because of how the sample is currently built, no functions are exported from the Browseh COM in-process server. At a minimum, you must export the DllGetClassObject and DllCanUnloadNow functions. The sample has a Browseh.def file, but it does not export these functions. In addition, the makefile ignores Browseh.def in the Link statement.

RESOLUTION
To resolve this problem, perform the following steps:

 In the Browseh.def file, replace the Exports section with the following code:  In the makefile, add the following code to the Link line /DEF:browseh.def so that the Link line appears as follows:  Rebuild the sample.

STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

Steps to Reproduce Behavior
 Follow the sample instructions to build and register the sample.

NOTE: The Browseh.dll file is not a self-registering DLL, so use the Browseh.reg file to register Browseh.dll. Make sure that you update the paths to Browseh.dll, Browseh.tlb, and MyDisp.tlb correctly in Browseh.reg. In Microsoft Visual Basic, open the VB.vbp file, which loads the sample's client project. Press the F5 key to run the Visual Basic client. Click Choose Type Library.</li> In the Choose Type Library dialog box, click any type library file, and then click OK. Notice that nothing happens. The simple Visual Basic client captures the error that is raised but does nothing in the error handler.</li>  To verify that DllGetClassObject and DllCanUnloadNow are not exported from Browseh.dll, you can use a tool such as Dumpbin.exe. At the command prompt, type the following line from the Browseh.dll folder: "dumpbin browseh.dll /exports" A list of exported functions is displayed but does not include DllGetClassObject and DllCanUnloadNow. </li></ol>