Re: exporting classes in a DLL



// in your header...

class __declspec(dllexport) CDllTest
{
public:
CDllTest(){}
~CDllTest(){}

public:
void SayHello();
};

// in your cpp...

void CDllTest::SayHello()
{
printf(_T("Hello World!!"));
}

Another option: if you create a new dll project using VS it will create an
example dummy exported class.


--
Un saludo
Rodrigo Corral González [MVP]

FAQ de microsoft.public.es.vc++
http://rcorral.mvps.org


.



Relevant Pages

  • Re: deriving from CListCtrl
    ... //This is the beginning of the cpp for the child dialog in my dialog App ... void reportdialog::DoDataExchange ... //This is the end of the Header file for the child dialog in my dialog App ... //This is the Beginning of the cpp file for the Header column function. ...
    (microsoft.public.vc.mfc)
  • RE: Calling C++ from C#
    ... reference issue, I extract the CPPFu.CPPClass definition to a stand-alone ... cpp source file, and build an assembly from it for the use of csuse.cs. ... void mainfu; ...
    (microsoft.public.dotnet.general)
  • Re: New to VC++ and having trouble
    ... Change the return type both in the .CPP and the .H files. ... AliR. ... > OK, thanks again, but it seems either I'm stupid or the person who ... > only differs depending onthe return value 'void ...
    (microsoft.public.vc.mfc)
  • Re: Hello World FAILS?!
    ... > void Main; ... Is this saved as a 'c' file, or as a _cpp_ file?. ... It supports 'C' syntax, and also ... suspect your project is being built as a cpp project, ...
    (microsoft.public.vc.ide_general)
  • Re: callbacks
    ... On your Cpp side: ... void MyCppMethod ... a member to hold the PointEventHandler so that it won't be ... extern private static void CppMethod; ...
    (microsoft.public.dotnet.languages.csharp)

Loading