Article View: borland.public.cppbuilder.nativeapi
Article #3604Re: Threads, PlaySound and waveOutGetNumDevs
From: Mike Collins
Date: Sat, 20 May 2006 12:02
Date: Sat, 20 May 2006 12:02
41 lines
2551 bytes
2551 bytes
Thanks Bob, this could be an issue that is only manifesting it's self when I
use the various functions that I have described.
In this particular implementation I'm dynamically loading the DLL and
exported functions, instead of using the lib file. The main dll is called
iKeyAPI.dll and the header is iKeyAPI.h. The general declaration of a
function within the header is like this:
IKEY_STATUS IKEY_API ikey_CreateContext(
IKEY_HANDLE * PtrContextHandle, // [out]
unsigned long Flags, // [in]
unsigned long ApiVersion ); // [in]
where IKEY_API is typedefed as __stdcall. However there is also the #ifdef
#ifdef __cplusplus
extern "C" {
#endif
in my thead I create a typedef for each function and then use
GetProcAddress, thus:
//TKeyPollThread.h...
typedef IKEY_STATUS IKEY_API (* T_ikey_CreateContext)(
IKEY_HANDLE *PtrContextHandle, // [out]
unsigned long Flags, // [in]
unsigned long ApiVersion); // [in]
T_ikey_CreateContext ikey_CreateContext;
//TKeyPollThread.cpp
ikey_CreateContext = (T_ikey_CreateContext)GetProcAddress(hKeyDLL,
"ikey_CreateContext");
"Bob Gonder" <notbg@notmindspring.invalid> wrote in message
news:uj4s62dv0f1o3dt7hdpj99rato13je2vvs@4ax.com...
> Mike Collins wrote:
>
>
Technical Details
Message-ID:
<446f056d$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<446dbb8d$1@newsgroups.borland.com> <446dfc10$1@newsgroups.borland.com> <446e0a32$1@newsgroups.borland.com> <uj4s62dv0f1o3dt7hdpj99rato13je2vvs@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,9ea40ee0ccd38b3b X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Mike Collins" <its@TheBottomOfThePost.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <446dbb8d$1@newsgroups.borland.com> <446dfc10$1@newsgroups.borland.com> <446e0a32$1@newsgroups.borland.com> <uj4s62dv0f1o3dt7hdpj99rato13je2vvs@4ax.com> Subject: Re: Threads, PlaySound and waveOutGetNumDevs Date: Sat, 20 May 2006 13:02:51 +0100 Lines: 43 Organization: SDA Ltd X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.3790.2663 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2663 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 81.2.92.14 Message-ID: <446f056d$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1148126573 81.2.92.14 (20 May 2006 05:02:53 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail