Re: Progress Error when calling C# Wrapper using COM objects
- From: "Steve Foley" <steve.foley@xxxxxxxxxxxxx>
- Date: Wed, 14 Sep 2005 01:53:54 GMT
Wild Guess, but can you pass double precision decimals to/from Progress?.
Try passing them as strings to C# and converting there.
"tonydt1g3r" <UseLinkToEmail@xxxxxxxxxxxx> wrote in message
news:4_881778_fa3f2d58365c5c48864ae4984b0fa005@xxxxxxxxxxxxxxx
> 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
.
- References:
- Progress Error when calling C# Wrapper using COM objects
- From: tonydt1g3r
- Progress Error when calling C# Wrapper using COM objects
- Prev by Date: Progress Error when calling C# Wrapper using COM objects
- Next by Date: Progress Version 7.3 and Solaris 8?
- Previous by thread: Progress Error when calling C# Wrapper using COM objects
- Next by thread: Progress Version 7.3 and Solaris 8?
- Index(es):
Relevant Pages
|