Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VC++ DLL -Continue
Message
From
25/08/2000 06:56:50
 
 
General information
Forum:
Visual C++
Category:
Other
Miscellaneous
Thread ID:
00409097
Message ID:
00409133
Views:
37
Hi,
Thank you for reply. I have tried to put the extern "C" in header file, but I get error C2059.

The following is my code:
TestDLL.h

extern "C" int __stdcall MyDll_MySum(int , int);

TestDLL.c

#include <windows.h>
#include "TestDLL.h"

int __stdcall MyDll_MySum(int firstNum, int SecondNum)
    {
         int Sum;
         Sum = firstNum + SecondNum;
	return Sum;
    }

TestDLL.odl

   [ 
	uuid(5F744182-7A6F-11d4-A77D-0050BA0556E1),
	helpstring("My DLL Tesing"),
         lcid(0x0409),
         version(1.0)
   ]
   library TestDLL 
   {
	[
	  helpstring("Sample functions exported by TestDll.dll"),
           version(1.0),
	 dllname("TestDll.dll")
	]

	module MyDllFunctions
	{
	
	  [
             helpstring("Sum 2 numbers."),
             entry("MyDll_MySum")
           ]
	  int __stdcall MySum([in] int firstNum, [in] int SecondNum);
		}
      }; // End of Library

TestDLL.rc

1 typelib TestDLL.tlb

TestDLL.def

LIBRARY TestDLL
      DESCRIPTION 'My Test DLL'
      EXPORTS
        MyDll_MySum
 
Thank you very much!!!!
I am not the most powerful man in this world.
I am not the worst man in this world either.
I just as same as all of you.
I still need to learn from my mistakes...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform