Path: news.mathworks.com!not-for-mail
From: "shopana " <shopana.e@hcl.in>
Newsgroups: comp.soft-sys.matlab
Subject: Re: segmentation error
Date: Wed, 9 Jan 2008 08:13:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 39
Message-ID: <fm1vmf$7tq$1@fred.mathworks.com>
References: <flvs6e$1tb$1@fred.mathworks.com> <fm0i99$60m$1@fred.mathworks.com> <fm1im6$8ck$1@fred.mathworks.com>
Reply-To: "shopana " <shopana.e@hcl.in>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1199866383 8122 172.30.248.35 (9 Jan 2008 08:13:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 9 Jan 2008 08:13:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1166498
Xref: news.mathworks.com comp.soft-sys.matlab:444998



"shopana " <shopana.e@hcl.in> wrote in message <fm1im6
$8ck$1@fred.mathworks.com>...
> "Malcolm Lidierth" <ku.ca.lck@htreidil.mloclam> wrote in 
> message <fm0i99$60m$1@fred.mathworks.com>...
> > You seem to be passing an empty pointer to your dll 
> hence 
> > the memory violation.
> > 
> > It is generally simplest to pass MATLAB variables in 
> callib.
> > If these are non-scalar they will need to be pre-
> allocated 
> > to prevent memory overruns (the dll receives a pointer 
> and 
> > has no idea of matlab matrix size)
> > 
> > e.g.
> > 
> > string=char(zeros(1,80));
> > string=calllib('dll', 'procname', fh, n, string, 79);
> > 
> > Watch out for the terminating null when using strings.
> 
> thanks for your help,but my return value i.e, libpointer 
> is scalar ,also that value is coming from the another 
> calllib function.Here is my code.
> 
> A1=calllib('Sand_RC','rc_open',6,70)
> A1 =
>  
> libpointer
> 
> calllib('Sand_RC','rc_deviceid_get,A1)
> 
> 
> i dont know want i did wrong here.can you help me?
>  
>