Microsoft KB Archive/258574

{|
 * width="100%"|

BUG: Incorrect Err.Number Returned by MTS Component

 * }

Q258574

-

The information in this article applies to:


 * Microsoft Windows NT Server version 4.0
 * Microsoft Windows NT Workstation version 4.0
 * Microsoft Transaction Server 2.0

-

SYMPTOMS
A Microsoft Transaction Server (MTS) component has a method, which uses a variant as an argument. If a client component calls the method, with a parameter that is not declared as a variant, when the MTS component returns an error hr value (or performs Err.Raise), the caller receives an E_INVALIDARG error message instead of the error hr value.

RESOLUTION
Here are three ways to work around this behavior:


 * Change the function signature to take the real argument type instead of a variant.
 * Declare the variable as a Variant in the component that makes the call.
 * Use late binding (declare the MTS object As Object).

NOTE: This problem does not occur with COM+.

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

Steps to Reproduce Behavior

 * 1) Create an ActiveX DLL in Microsoft Visual Basic and name the project VarTest. Name the class Tester.
 * 2) Add the following method to Tester:
 * 3) Compile the DLL, set the binary compatibility, and then add the DLL to an MTS package.
 * 4) Create a new Standard EXE. Form1 is created by default.
 * 5) Add a reference to VarTest.
 * 6) Add a command button to the form, and then add this code to the Click event of the command button:
 * 7) Run the executable. You will see this error message:

Additional query words: Variant Early Binding Late HRESULT hr

Keywords : kberrmsg kbMTS kbMTS200bug kbVC

Issue type : kbbug

Technology : kbWinNTsearch kbWinNTWsearch kbWinNTW400 kbWinNTW400search kbWinNT400xsearch kbWinNTSsearch kbWinNTS400xsearch kbWinNTS400 kbMTSsearch kbAudDeveloper kbMTS200