Welcome to dbForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Progress Error when calling C# Wrapper using COM objects

 
   Database Forums (Home) -> Progress RSS
Next:  https and database connection  
Author Message
tonydt1g3r




Joined: Sep 13, 2005
Posts: 2



(Msg. 1) Posted: Tue Sep 13, 2005 2:59 pm
Post subject: Progress Error when calling C# Wrapper using COM objects

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

 >> Stay informed about: Progress Error when calling C# Wrapper using COM objects 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Error to connect Progress from Java - Hi All, I am a new in Progress Database. I tried to connect to Progress database from Java. Below is my part of code: public void connect (){ try { Class.forName("com.progress.sql.jdbc.JdbcProgressDriver"); con =....

PROGRESS/ QAD/ OH - OMNI GROUP tgugger@aimexec.com 419-250-1900 PROGRESS/ QAD/ IMMEDIATE/ OH ...

New to progress - Hi, I'm new to progress - how active is the group? Is there a mailing list? I've struggled to find online documentation or an FAQ - please could people point me in the direction of resources to get up to speed? Thanks, S.

Progress Database 9.1 SN - i have download the progress batabase 9.1d for linux , but the serial number is wrong. who can give me the serial number?

PROGRESS is NOT SQL-92 compatible - Big error: select ac_code, SUM(case when acd_year < 2006 then acd_amt else 0.0000001 end) from ..... rounds to INTEGER, but when select ac_code, SUM(acd_amt) from ..... result is good. Any help from PROGRESS support Team ?? Adam
   Database Forums (Home) -> Progress All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]