Progress Error when calling C# Wrapper using COM objects
- From: tonydt1g3r <UseLinkToEmail@xxxxxxxxxxxx>
- Date: 13 Sep 2005 15:43:57 -0400
First off I am using Progress 10.0A, and I am recieving this error
message.
Error occured while accessing component property/method: density. The
type initializer for "QuantifiPINVOKE" threw an exception.
Error code: 0x80020009 C:\Quantifi\Progress\p53439_test.ped (5890)
Ok let me try to explain what I am trying to do. The company I am
working for is trying to use a pricing tool called Quantifi. This
Quantifi software contains a bunch of functions in a .net DLL file.
Since Progress cant comunicate with .net directly, they(progress)
suggested that I use com object to have them communicate. Thus I
wrote a wrapper in C# to communicate with progress. First I wrote a
simple function like 1 + 1 just to make sure that my wrapper was
working correctly and I could pass variables to and from progress to
the wrapper. But when I call my second function that references the
Quantifi.dll which this wrapper was written for it doesnt seem to
work. I called progress but they are of no help and i am completely
stumped. I tested these two functions in Excel VBA just to make sure
that the Quantifi stuff was indeed working and it works fine from
excel, so I dont understand why it wouldnt be working from Progress.
I have pasted my error prone code below.
Progress Code:
DEF VAR ATS_CALL_NET AS COM-HANDLE NO-UNDO.
DEF VAR int_date AS DECIMAL.
CREATE "COMExample.CDSPricer" ATS_CALL_NET.
/*int_date = ATS_CALL_NET:pv(1.0).*/
INT_date = ATS_CALL_NET:density (
1.0,
2.0,
3.0).
MESSAGE int_date.
RELEASE OBJECT ATS_CALL_NET.
C# Code:
using System;
using System.Runtime.InteropServices;
using Quantifi;
using Quantifi.Numerics;
namespace COMExample
{
// NOTE: COM GUID?s generated using guidgen
// Interface
[Guid("556B4386-CC60-414B-9D3C-378FE0900A1B")]
public interface ICDSPricer
{
[DispId(1)]
double Pv(double premium);
[DispId(2)]
double density(double x, double a, double b);
}
// COM CoClass
[Guid("061861B9-E0B9-4CA8-9408-47BEE3BB08A4")]
public class CDSPricer : ICDSPricer
{
public double Pv(double premium)
{
double abc;
abc = premium + 2;
return abc;
}
public double density(double x, double a, double b)
{
double answer;
//x = 1;
//a = 2;
//b = 3;
answer = Quantifi.Numerics.Beta.density(x,a,b);
//answer = Quantifi.Numerics.Beta.cumulative(.5,2,3);
return answer;
}
}
}
Any help would be greatly apreciated.
-Tony
--
Posted using the http://www.dbforumz.com interface, at author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbforumz.com/Progress-Error-calling-Wrapper-objects-ftopict255488.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbforumz.com/eform.php?p=881778
.
- Follow-Ups:
- Re: Progress Error when calling C# Wrapper using COM objects
- From: Steve Foley
- Re: Progress Error when calling C# Wrapper using COM objects
- Prev by Date: Re: Progress 9 database Startup parameters
- Next by Date: Re: Progress Error when calling C# Wrapper using COM objects
- Previous by thread: How to guide: Installing Progress ODBC driver on a client without installing the full Progress installation on it
- Next by thread: Re: Progress Error when calling C# Wrapper using COM objects
- Index(es):
Relevant Pages
|