Article View: borland.public.cppbuilder.nativeapi
Article #739DLL and currency issues
From: Colin B Maharaj
Date: Tue, 22 Jan 2008 14:10
Date: Tue, 22 Jan 2008 14:10
50 lines
2202 bytes
2202 bytes
Hi all, I wrote this sorting DLL years ago
works fine and all. However recently I started
using the DLL more than once at a time, via
the current win user and a web user.
This is a sorting DLL.
However whenever, the web or win user process
start and concurrency begins, and ends an access
violation ensues.
Here is the DLL wrapper code
//---------------------------------------------------------------------------
// The procID and Sequence number are to make
// unique temporary file sets in the DLL
// so file names would not collide in the sorting
// process.
//---------------------------------------------------------------------------
typedef void (__stdcall *lpSortWrapperDLL)(char *, int, int, char *,
char *);
void SortWithDLL(char *cmdline, int procID, int SeqNo, char *InF, char
*OutF)
{
HINSTANCE lpDLL = LoadLibrary("CTSORT.DLL");
lpSortWrapperDLL SortWrapperDLL=NULL;
if (lpDLL)
{
SortWrapperDLL = (lpSortWrapperDLL) GetProcAddress(lpDLL,
"SortWrapperDLL");
if (SortWrapperDLL) SortWrapperDLL(cmdline, procID, SeqNo, InF,
OutF);
if (!SortWrapperDLL)
{
ErrorMessage("Function not found in DLL!");
}
FreeLibrary(lpDLL);
}
else
{
ErrorMessage("CTSORT.DLL is needed.");
}
}
Technical Details
Message-ID:
<4795f94a$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,ab05be4dbc268be,start X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Date: Tue, 22 Jan 2008 10:10:20 -0400 From: Colin B Maharaj <noreply@myhost.com> User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: DLL and currency issues Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 080122-0, 01/22/2008), Outbound message X-Antivirus-Status: Clean NNTP-Posting-Host: 190.58.52.47 Message-ID: <4795f94a$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1201011018 190.58.52.47 (22 Jan 2008 06:10:18 -0700) Lines: 50 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail