|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
I am having a devil of time calling a "C" dll from VB6. The "C" function was created in Visual Studio, same for the VB6. Does anyone have a sample "C" project, etc. that can help?
Dan Errors range from "file not found" to "bad calling convention", with an occasional "can't find dll entry point" thrown in for good measure.Dan |
|
#2
|
||||
|
||||
|
How are you trying to call the dll function in vb?
|
|
#3
|
|||
|
|||
|
I have tried both byVal and byRef in separate *.cpp's of course.
The errors "file not..." an "can't find entry..." i believe a can fix. BUT the "bad calling..." error has me stumped... |
|
#4
|
||||
|
||||
|
how are you declaring the function in the vb code
|
|
#5
|
|||
|
|||
|
How much can I stuff in this little box..?? Note that "interp" is a subroutine.
Here the first few lines of the VB.. Option Base 1 ' sets the array index to 1 / Declare Sub interp Lib "E:\Simulations\Current\interpolation_v0b.dll" (ByRef inputTemp As Double, ByRef inputAtmPres As Double, ByRef inputPres As Double, ByRef inputPrdFlow As Double, ByRef ProdPurity As Double, ByRef AirConsump As Double, ByRef PressDrop As Double, ByRef PermPurity As Double) / Sub Test() ' Dim inputTemp As Double ' Input Temp Dim inputAtmPres As Double ' Input Atm Pres Dim inputPres As Double ' Input Inlet Pres . . Call interp(inputTemp, inputAtmPres, inputPres, inputPrdFlow, ProdPurity, AirConsump, PressDrop, PermPurity) . . . . And here are the first few lines of the *.cpp // interpolation_v0b.cpp : Defines the entry point for the DLL application. // #include "stdafx.h" extern "C" __declspec(dllexport) void interp(double &t,double &ap,double &ip,double &f, double &o2,double &ac,double &dp,double &po2); BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { return TRUE; } . . . . |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Need help applying C dll's in VB6 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|