- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[DllImport(@"TrendFit.dll", EntryPoint="TrendFit"
)]public static extern int trendfit(ref int lNPt,ref double dblX,ref double dblY,ref double dblSdY,ref int lNCoeff,ref double dblCoeff,ref double dblV,ref double dblVF);
private void button1_Click(object sender, System.EventArgs e){
int lNPt = 30;
double dblX = 38222.5664467593; double dblY = 6.99999999778811; double dblSdY = 1; int lNCoeff = 2; double dblCoeff = 0; double dblV = 0; double dblVF = 0; int result = 0;result = trendfit(ref lNPt, ref dblX, ref dblY, ref dblSdY, ref lNCoeff, ref dblCoeff, ref dblV, ref dblVF);
}
The 'trendfit' function is called, but the dblCoeff, dblV and dblVF values get set to NaN and I get a NullReferenceException when the calling method completes. The code above is similar to how the VB6 app calls the trendfit function, except the VB6 app was using LONG where I'm using INT because VB6 long is 4 bytes and long in .NET is 8.
Anyone have any idea what I'm doing wrong? Many thanks for your help
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Message Edited by Sabalan on 01-13-2005 03:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Message Edited by Sabalan on 01-14-2005 01:09 AM
Message Edited by Sabalan on 01-17-2005 12:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page