🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#1495
From: Boris Epel
Date: Tue, 14 Aug 2007 16:59
42 lines
2419 bytes
Hi Bob,

thanks for the reply!
The application code is shown below. the exception is cached by 
try/catch statement. all necessary error handling is done - no errors in 
linking of dll. The function pointer (DLL offset) is correct. Other 
(tested) functions of dll are fine.

In MSVC code VCL objects are exchanged for MFC, nothing else changed.
Regards,
Boris

.cpp:
    LastError = DAQmxLoadTask (Edit1->Text.c_str(), &task);
    if( DAQmxFailed(LastError) )
          PostErrorString("DAQmxLoadTask:", LastError);
     else
      {
        Memo1->Lines->Add(AnsiString().sprintf("Task '%s' is beeng 
loaded...", Edit1->Text.c_str()));
        char buffer[256];
        for(uInt32 i=1;;i++)
          if( DAQmxFailed(LastError = DAQmxGetNthTaskChannel (task, i, 
buffer, 256)) ) break;
           else
            {
              int32   data;
              float64 fdata;

              Memo1->Lines->Add(AnsiString().sprintf("Loading channel 
%d: %s", i, buffer));
       try {
/****************** Here an exception generated **********************/
              if( DAQmxFailed(LastError = DAQmxGetChanType(task, buffer, 
&data)) )
/*********************************************************************/
                PostErrorString("DAQmxGetChanType:", LastError);
              isPassed = true;
           } catch(...)
           {  Memo1->Lines->Add(AnsiString("Crash on DAQmxGetChanType."));
           }
       }
Technical Details
Message-ID: <46c1de4e$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <46c0a633$1@newsgroups.borland.com> <qal1c35g92je4rjiu30a874oue16mifqlr@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,1e7567d9fb04a084
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Tue, 14 Aug 2007 11:59:50 -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: Re: Explicit link to DLL, problem in BCB but not in MSVC
References: <46c0a633$1@newsgroups.borland.com> <qal1c35g92je4rjiu30a874oue16mifqlr@4ax.com>
In-Reply-To: <qal1c35g92je4rjiu30a874oue16mifqlr@4ax.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 128.135.74.97
Message-ID: <46c1de4e$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1187110478 128.135.74.97 (14 Aug 2007 09:54:38 -0700)
Lines: 42
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail