Click here to Skip to main content
15,900,258 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: converting vb double to vc double Pin
Nic Rowan11-Sep-03 8:06
Nic Rowan11-Sep-03 8:06 
GeneralConvert from VS.Net 2003 to VS.Net Pin
Orcrist10-Sep-03 6:12
Orcrist10-Sep-03 6:12 
GeneralDeleteCommand problem.. Pin
GJul10-Sep-03 4:48
GJul10-Sep-03 4:48 
Generalall about exceptions Pin
fume9-Sep-03 22:09
fume9-Sep-03 22:09 
GeneralRe: all about exceptions Pin
SimonS9-Sep-03 22:11
SimonS9-Sep-03 22:11 
GeneralRe: all about exceptions Pin
fume10-Sep-03 14:08
fume10-Sep-03 14:08 
GeneralRe: all about exceptions Pin
fume10-Sep-03 14:17
fume10-Sep-03 14:17 
Generalerror bad dll calling convention Pin
Member 5728499-Sep-03 12:15
Member 5728499-Sep-03 12:15 
I'm getting the error bad dll calling convention when I call my dll written in vc++ from my vb app. The problem is because of the type / structure I'm passing my dll.

In vb, I've defined my call to the dll and created a type in vb that looks like this:

<br />
Declare Function test Lib "C:\TEMP\EngineTest\PSAEngine.dll" Alias "_test@10004" _<br />
(ByVal j As Integer, ByRef collateral As collateralvar)<br />
<br />
<br />
Type assetvar<br />
    cutoff_prin_bal(400) As Double<br />
    orig_gross_rate(400) As Double<br />
    orig_amort_term(400) As Double<br />
End Type<br />
<br />
Type collateralvar<br />
    subissue(100) As Integer<br />
    asset As assetvar<br />
End Type<br />


In my VC++ dll, I've defined my function and structure as:

<br />
extern "C"<br />
{<br />
__declspec( dllexport ) void test(int j, collateralvar collateral);<br />
}<br />
<br />
struct assetvar<br />
{<br />
	double cutoff_prin_bal[400];<br />
	double orig_gross_rate[400];<br />
	double orig_amort_term[400];<br />
};<br />
<br />
struct collateralvar<br />
{<br />
	int subissue[100];<br />
	struct assetvar asset;<br />
};<br />


Here is my call to the dll function:
<br />
Static collateral As collateralvar<br />
.<br />
.<br />
.<br />
test 0, collateral<br />


When I call the function test in my vb program it returns the error Bad DLL calling convention. Any ideas?
GeneralRe: error bad dll calling convention Pin
Hesham Amin9-Sep-03 21:43
Hesham Amin9-Sep-03 21:43 
GeneralRe: error bad dll calling convention Pin
Member 57284910-Sep-03 4:22
Member 57284910-Sep-03 4:22 
GeneralRe: error bad dll calling convention Pin
Member 57284910-Sep-03 7:22
Member 57284910-Sep-03 7:22 
GeneralNewbie to VB need some advice please Pin
Flack9-Sep-03 7:04
Flack9-Sep-03 7:04 
GeneralRe: Newbie to VB need some advice please Pin
Ray Cassick9-Sep-03 7:45
Ray Cassick9-Sep-03 7:45 
GeneralRe: Newbie to VB need some advice please Pin
NetPointerIN11-Sep-03 9:51
NetPointerIN11-Sep-03 9:51 
GeneralRe: Newbie to VB need some advice please Pin
Ray Cassick11-Sep-03 9:56
Ray Cassick11-Sep-03 9:56 
GeneralDeploy .Net Application using Access Database Pin
zengfu9-Sep-03 4:54
zengfu9-Sep-03 4:54 
GeneralRe: Deploy .Net Application using Access Database Pin
SimonS9-Sep-03 22:09
SimonS9-Sep-03 22:09 
GeneralAccessing a VC++ DLL in VB Pin
Member 5728498-Sep-03 12:18
Member 5728498-Sep-03 12:18 
GeneralRe: Accessing a VC++ DLL in VB Pin
Steve S9-Sep-03 6:22
Steve S9-Sep-03 6:22 
GeneralRe: Accessing a VC++ DLL in VB Pin
Member 5728499-Sep-03 7:02
Member 5728499-Sep-03 7:02 
GeneralRe: Accessing a VC++ DLL in VB Pin
Dave Kreskowiak10-Sep-03 3:31
mveDave Kreskowiak10-Sep-03 3:31 
GeneralRe: Accessing a VC++ DLL in VB Pin
Member 57284910-Sep-03 4:00
Member 57284910-Sep-03 4:00 
GeneralRe: Accessing a VC++ DLL in VB Pin
Dave Kreskowiak11-Sep-03 4:22
mveDave Kreskowiak11-Sep-03 4:22 
GeneralVB6 Connecting to Lotus Notes and Novell Groupwise Pin
matthew l7-Sep-03 23:52
matthew l7-Sep-03 23:52 
GeneralForm as Startup Object Pin
SuperGeek7-Sep-03 13:34
SuperGeek7-Sep-03 13:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.