[Ipopt] Ipopt Initialize

Nandini Chakravorti nchakravorti at gmail.com
Tue Dec 9 10:18:39 EST 2008


Hi,

    I am using the Ipopt lib(Release version) from C#. So, I have a dll
wrapper for the ipopt.lib. So, after I run the Initialize method I get an
exception saying ""Attempted to read or write protected memory. This is
often an indication that other memory is corrupt."

    Giving a C++ snippet of my code below:



class Wrapper

{

private:
SmartPtr<IpoptApplication> Impl;
SmartPtr<TNLP> mynlp;

public:

ApplicationReturnStatus Initialize()
{

return Impl->Initialize();

}

};

class IpOptNLP: public TNLP

{

private:

Wrapper* m_pcUnManagedWrapper;

public:

IpOptNLP();

virtual ~IpOptNLP();

IpOptNLP(Wrapper* pcWrapper) { m_pcUnManagedWrapper = pcWrapper;}

virtual bool get_nlp_info(int& n, int& m, int& nnz_jac_g, int& nnz_h_lag,
IndexStyleEnum& index_style); //And so on

}



Now when I invoke the Initialize function from C#(after exporting the dll) I
get an exception when *Impl->Initialize(**)* is getting invoked. And while
debugging I see the reference count for both Impl and mynlp are zero.

Can someone please point out where I might be going wrong?

Thanks,

Nandini
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.coin-or.org/pipermail/ipopt/attachments/20081209/e043989f/attachment.html 


More information about the Ipopt mailing list