BUG: You do not receive a compiler error message or a warning message when the __declspec(dllexport) keyword appears to the right of the calling-convention keyword in Visual C++ .NET 2003 or in Visual C++ 2005 (888324)



The information in this article applies to:

  • Microsoft Visual C++ .NET (2003)
  • Microsoft Visual C++ 2005 Express Edition

SYMPTOMS

You do not receive a compiler error message or a warning message when the _declspec(dllexport) keyword appears to the right of the calling-convention keyword in Microsoft Visual C++ .NET 2003 or Visual C++ 2005.

The following Microsoft Visual C++ .NET 2003 code example compiles without errors. However, no function is exported.
int __stdcall __declspec(dllexport) Func() 
{ 
} 

CAUSE

This problem occurs when the _stdcall calling-convention keyword appears before the _declspec keyword in your code.

RESOLUTION

To resolve this problem, put the _declspec keyword before the _stdcall calling-convention keyword in your code. For example, when you resolve this problem in the code example that is mentioned in the "Symptoms" section, the corrected code example looks similar to the following.
__declspec (dllexport) int __stdcall Func()
{
} 

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

For more information about how to export from a DLL by using the _declspec(dllexport) keyword, visit the following Microsoft Developer Network (MSDN) Web site:

Modification Type:MajorLast Reviewed:1/16/2006
Keywords:kbDesigner kbProgramming kbtshoot kbbug KB888324 kbAudDeveloper