🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #10455

Using a dll (built with Builder) with a Builder project

#10455
From: Kevin Hass
Date: Thu, 08 Apr 2004 23:39
39 lines
1938 bytes
I am using a dll built with Borland Builder in my Builder project. (Both
built with C++ Builder 5)
When I call a function from the dll - Windows creates another task on my
task bar.
How can stop this from happening?

In dll header file:
extern "C" __declspec(dllexport) void __stdcall ShowAbout(TComponent
*Owner);

In dll cpp file (TfrmAboutBox is a member of the dll project):
void __stdcall ShowAbout(TComponent *Owner)
{
  TfrmAboutBox *frmAboutBox = new TfrmAboutBox(Owner);
  frmAboutBox->ShowModal();
  delete frmAboutBox;
}

In exe cpp file (main form):
  typedef void __stdcall (*VOIDFN)(TComponent *Owner);
  HMODULE LibHandle;
  VOIDFN     ShowAbout;

  LibHandle = LoadLibrary("MyDLL.dll");

  if (LibHandle == NULL)
    return;

  ShowAbout = (VOIDFN) GetProcAddress(LibHandle, "ShowAbout");

  ShowAbout(this);

This seems to work fine, however, I would like it to behave as though the
the AboutBox was part of the executables project and not have another task.

Thanks for any help,

Kevin Hass
Ban-Koe Companies
Technical Details
Message-ID: <4075e12f@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,1947deb86373980c,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-04-08 16:39:49 PST
From: "Kevin Hass" <akevin1@qwest.net>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Using a dll (built with Builder) with a Builder project
Date: Thu, 8 Apr 2004 18:39:07 -0500
Lines: 41
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.1165
NNTP-Posting-Host: 209.180.63.37
Message-ID: <4075e12f@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1081467183 209.180.63.37 (8 Apr 2004 16:33:03 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail