Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

How to have one DLL with each function in an own c-file?

Hello,
i want to create a windows-DLL with about 20 functions. This works if all functions are in one c-file and
one header-file. But what do i have to do to have for each function an own c-file and header-file?

Currently it looks like this (template):


//C-File:
#include "stdio.h"
#include "string.h"
extern "C"
{
void __declspec (dllexport)  __stdcall ReturnText1 (char *text1)
    {
        strcpy (text1, "hello1");
    }

void __declspec (dllexport)  __stdcall ReturnText2 (char *text2)
    {
        strcpy (text1, "hello2");
    }
}


********************

//Headerfile
void __stdcall  ReturnText1 (char *text1);
void __stdcall  ReturnText2 (char *text2);

********************

Thank you very much for your help
0 Kudos
Message 1 of 2
(4,645 Views)
Hello NewOne,

correct me if I'm wrong. you want to uses 20 c-files and a header-file combined in one *.dll.
Should be no problem, just include the header-file to all c-files and add them to your dll-project. build the dll and it should work fine.

Daniuel Riedelbauch
NIG
0 Kudos
Message 2 of 2
(4,630 Views)