N
Nick
I have read many postings regarding the above thread but don't seem to
have found the exact problem I am experiencing.
I am using VS.NET and have 2 projects within the 1 solution. First
project is a VB module (compiled to .EXE) and is the calling module.
The 2nd project is C and compiles to a DLL.
The DLL takes the definition of an ARC(4 Points) and converts this
geographically into a string of Points. The DLL was written in C
because of the math and speed requirements.
Here is the declare in VB:
Declare Function ConvertArctoString Lib "convarc.dll" Alias
"_ConvertArctoString@8" (ByVal sDir As Short, ByVal ParamArray
allPts() As AspMap.Point) As Integer
Here is the declare in C module:
#define CONVARC_API __declspec(dllexport)
CONVARC_API long PASCAL ConvertArctoString (long, PPOINTD);
The problem I am having is:
1. C DLL does not appear to load when I view the Modules window.
2. Can place a breakpoint in C source but when I DEBUG VB EXE the
breakpoint
in C module never reached and the IDE reports that no symbol
information could be found!
3. I get a GPF when I start assigning the coordinate x and y values in
the DLL with above declare. Cant use ByRef with ParamArray.
4. If I do NO assignment the VB variable appears to have been nulled
on return from the DLL!!
In light of this wrote simple function.
Here is the code:
CONVARC_API long PASCAL ArcStart2(PPOINTD arcPts)
{
arcPts[0].x = 999.0;
arcPts[0].y = 999.0;
return arcPts[0].x/2;
}
and the DECALRE/call from VB module:
Declare Function ArcStart2 Lib "convarc.dll" Alias "_ArcStart2@4"
(ByRef iPts As AspMap.Point) As Integer
Dim testPt As New AspMap.Point()
iNumPts = ArcStart2(testPt)
interestingly iNumPts gets returned with 499 so appears the assignment
works but the variable testPts gets set to "Nothing" on return from
DLL.
Am lost without debug and not sure how to get DLL to load. I can't
add as a reference in the VB project as I get an error saying it is
not a valid .NET assembly!
have found the exact problem I am experiencing.
I am using VS.NET and have 2 projects within the 1 solution. First
project is a VB module (compiled to .EXE) and is the calling module.
The 2nd project is C and compiles to a DLL.
The DLL takes the definition of an ARC(4 Points) and converts this
geographically into a string of Points. The DLL was written in C
because of the math and speed requirements.
Here is the declare in VB:
Declare Function ConvertArctoString Lib "convarc.dll" Alias
"_ConvertArctoString@8" (ByVal sDir As Short, ByVal ParamArray
allPts() As AspMap.Point) As Integer
Here is the declare in C module:
#define CONVARC_API __declspec(dllexport)
CONVARC_API long PASCAL ConvertArctoString (long, PPOINTD);
The problem I am having is:
1. C DLL does not appear to load when I view the Modules window.
2. Can place a breakpoint in C source but when I DEBUG VB EXE the
breakpoint
in C module never reached and the IDE reports that no symbol
information could be found!
3. I get a GPF when I start assigning the coordinate x and y values in
the DLL with above declare. Cant use ByRef with ParamArray.
4. If I do NO assignment the VB variable appears to have been nulled
on return from the DLL!!
In light of this wrote simple function.
Here is the code:
CONVARC_API long PASCAL ArcStart2(PPOINTD arcPts)
{
arcPts[0].x = 999.0;
arcPts[0].y = 999.0;
return arcPts[0].x/2;
}
and the DECALRE/call from VB module:
Declare Function ArcStart2 Lib "convarc.dll" Alias "_ArcStart2@4"
(ByRef iPts As AspMap.Point) As Integer
Dim testPt As New AspMap.Point()
iNumPts = ArcStart2(testPt)
interestingly iNumPts gets returned with 499 so appears the assignment
works but the variable testPts gets set to "Nothing" on return from
DLL.
Am lost without debug and not sure how to get DLL to load. I can't
add as a reference in the VB project as I get an error saying it is
not a valid .NET assembly!