Article View: borland.public.cppbuilder.nativeapi
Article #11032Re: DLL Howto...
From: Ed Mulroy [TeamB]
Date: Sat, 28 Feb 2004 19:46
Date: Sat, 28 Feb 2004 19:46
65 lines
2773 bytes
2773 bytes
--------------------------
C:\Documents and Settings\Administrator\My Documents\Lookat\q010
>type hihello.cpp
#include <windows.h>
BOOL WINAPI DllEntryPoint(HINSTANCE, DWORD, LPVOID)
{
return TRUE;
}
extern "C" __declspec(dllexport) void Hi(void)
{
MessageBox(HWND_DESKTOP, "Hi", "HiHello.DLL", MB_OK);
}
extern "C" __declspec(dllexport) void Hello(void)
{
MessageBox(HWND_DESKTOP, "Hello", "HiHello.DLL", MB_OK);
}
C:\Documents and Settings\Administrator\My Documents\Lookat\q010
>type mainprog.cpp
#include <windows.h>
extern "C" __declspec(dllimport) void Hi(void);
extern "C" __declspec(dllimport) void Hello(void);
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
Hi();
Hello();
return 0;
}
C:\Documents and Settings\Administrator\My Documents\Lookat\q010
>bcc32 -WD hihello
Borland C++ 5.6.5 for Win32 Copyright (c) 1993, 2002 Borland
HIHELLO.CPP:
Turbo Incremental Link 5.64 Copyright (c) 1997-2002 Borland
C:\Documents and Settings\Administrator\My Documents\Lookat\q010
>implib -c hihello.LIB hihello.DLL
Borland Implib Version 3.0.22 Copyright (c) 1991, 2000 Inprise Corporation
C:\Documents and Settings\Administrator\My Documents\Lookat\q010
>bcc32 -W mainprog hihello.lib
Borland C++ 5.6.5 for Win32 Copyright (c) 1993, 2002 Borland
MAINPROG.CPP:
Turbo Incremental Link 5.64 Copyright (c) 1997-2002 Borland
C:\Documents and Settings\Administrator\My Documents\Lookat\q010
>
--------------------------
. Ed
> Babak wrote in message
> news:4040eb2a@newsgroups.borland.com...
>
> I want to have two function in a DLL
> one show a message with "hello"
> and another the same , show message with "hi"
> Compile it and then a program that call the DLL and
> can use those functions
Technical Details
Message-ID:
<4040f03c$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!colt.net!diablo.theplanet.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4040eb2a@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,95faf01013e76bb4 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-02-28 12:09:48 PST From: "Ed Mulroy [TeamB]" <dont_email_me@bitbuc.ket> Newsgroups: borland.public.cppbuilder.nativeapi References: <4040eb2a@newsgroups.borland.com> Subject: Re: DLL Howto... Date: Sat, 28 Feb 2004 14:46:56 -0500 Lines: 67 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 24.74.175.102 Message-ID: <4040f03c$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1077997628 24.74.175.102 (28 Feb 2004 11:47:08 -0800) X-Authenticated-User: edmulroy Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!colt.net!diablo.theplanet.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail