🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Explicit link to DLL, problem in BCB but not in MSVC

#1489
From: Boris Epel
Date: Mon, 13 Aug 2007 18:48
22 lines
1681 bytes
Hi ALL!
I call functions from National Instruments DAQ mx dll ("nicaiu.dll"). 
On _some_ computers code compiled in BCB 6.0 generates memory violation 
when calling one of the functions (DAQmxGetChanType). The same code in 
Visual C works fine everywhere.

The code is pretty standard (http://www.specman4epr.com/NIDAQtest.zip), 
declaration of function is correct.
.h:
typedef int32 (__CFUNC *DAQmxGetChanType_f) (TaskHandle taskHandle, 
const char channel[], int32 *data);
.c:
HINSTANCE handle = LoadLibrary(_library);
DAQmxGetChanType_f  DAQmxGetChanType = (DAQmxGetChanType_f) 
GetProcAddress(handle, "DAQmxGetChanType");
...
first call of this function causes crash on _some_ computers.

Did anybody experience similar problems ?

Regards,
Boris
Technical Details
Message-ID: <46c0a633$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,1e7567d9fb04a084,start
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Mon, 13 Aug 2007 13:48:11 -0500
From: Boris Epel <bepel@uchicago.edu>
User-Agent: Thunderbird 1.5.0.12 (Windows/20070509)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Explicit link to DLL, problem in BCB but not in MSVC
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 128.135.74.97
Message-ID: <46c0a633$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1187030579 128.135.74.97 (13 Aug 2007 11:42:59 -0700)
Lines: 22
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
X-Original-Bytes: 1528