[Mingw-users] Creating a C DLL to be used with VB
- Date: Thu, 20 Dec 2007 15:33:34 -0000
- From: "Cosmos" <cosmos@xxxxxxxx>
- Subject: [Mingw-users] Creating a C DLL to be used with VB
|
Hi,
I'm a newbie in C and MinGw. I reserched
the Net and I would like to ask the experts if this is the right procedure to
make a C DLL to be used with VB6 for Windows with MinGw.
I create, for instance, a file
mydll.c that looks as follows (with two functions): (example taken from
http://www.emmestech.com/software/cygwin/pexports-0.43/moron2.html)
#include "mydll_dll.h"
#include <stdio.h>
EXPORT int equ( char *str1, char *str2 )
{
if ((str1 == NULL)&&(str2 == NULL)) return (1);
if ((str1 == NULL)&&(str2 != NULL)) return (0);
if ((str2 == NULL)&&(str1 != NULL)) return (0);
// Above since strcmp seems to have trouble operating on null strings.
if (strcmp( str1, str2 ) == 0) return (1);
else return (0);
}
EXPORT char *func2(char *s1 )
{
int i,k,dun;
char *pos[80], *def, s3[80];
strcpy( s3, s1);
....
....
}
Then I create a mydll_dll.h with the following:
|
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________ MinGW-users mailing list MinGW-users@xxxxxxxxxxxxxxxxxxxxx You may change your MinGW Account Options or unsubscribe at: https://lists.sourceforge.net/lists/listinfo/mingw-users
- Follow-Ups:
- Re: [Mingw-users] Creating a C DLL to be used with VB
- From: Michael Gerdau
- Re: [Mingw-users] Creating a C DLL to be used with VB
- Prev by Date: Re: [Mingw-users] [BUG] - member is template<T>: ice in 4.2.1-sjlj (mingw32-2), bad compilation in 3
- Next by Date: Re: [Mingw-users] [BUG] - member is template<T>: ice in 4.2.1-sjlj (mingw32-2), bad compilation in 3
- Previous by thread: [Mingw-users] [BUG] - member is template<T>: ice in 4.2.1-sjlj (mingw32-2), bad compilation in 3.4.5
- Next by thread: Re: [Mingw-users] Creating a C DLL to be used with VB
- Index(es):