Custom eVC++ DLL Problem in eVB 
Author Message
 Custom eVC++ DLL Problem in eVB

I have developed a simple DLL in eVC that provides some complex math
calculations for my eVB client application.

I also ported the same code to VC++ and VB for PC users.

The Win32 PC application works fine every time.

The WinCE version simply stalls/freezes during testing and doesn't generate
any errors.

Example of the eVC DLL code

double APIENTRY DMSToDec(int Degrees, int Minutes, int Seconds)
{
    //Implementation code

Quote:
}

double APIENTRY DecToRads(double DecValue)
{
    //Implementation code

Quote:
}

Def file created and functions exported.

VB Definition
***********

Declare Function DMSToDec Lib "Windows\MYDLL.DLL" (ByVal Degrees as Integer,
Minutes as Integer, Seconds as Integer) as Double
Declare Function DecToRads Lib "Windows\MYDLL.DLL" (ByVal DecValue as
double) as Double

Now, I believe that the double data type is not valid for declaration
satatements, amoung others, so I converted the code accordingly.

Declare Function DMSToDec Lib "Windows\MYDLL.DLL" (ByVal Degrees as Integer,
Minutes as Integer, Seconds as Integer) as Variant
Declare Function DecToRads Lib "Windows\MYDLL.DLL" (ByVal DecValue as
Variant) as Variant

I also tried passing the variants ByRef.  Nothing works.   I now read that a
function declaration cannot return a variant.  I'm confused...  It appears
that I cannot use a declaration the returns any variation of a floating
point variable.

The lack of any error message except the occassional "fatal error in
pvbload.exe" and the fact I can't terminate the running app from within
WinCE has me stumped.

Any ideas would be appreciated.

Regards

Shane Brodie



Sat, 03 Jan 2004 06:55:47 GMT  
 Custom eVC++ DLL Problem in eVB
Shane,

I am not of much use to you re C++, but I can tell you that a C++ in should
translate to a VB Long, not int - and you also appear to have missed the
ByVal from the remaining parameters:

Declare Function DMSToDec Lib "Windows\MYDLL.DLL" (ByVal Degrees as Long,
ByVal Minutes as Long, ByVal Seconds as Long) as Variant

I think you are right re the double parameters, so perhaps doing something
like this:

MyDoubleVariant = CDbl(0)

Before passing it "ByVal" may force it to pass as a double given that the
variant sub-type will now be double... just an idea.

HTH

Dino



Quote:
> I have developed a simple DLL in eVC that provides some complex math
> calculations for my eVB client application.

> I also ported the same code to VC++ and VB for PC users.

> The Win32 PC application works fine every time.

> The WinCE version simply stalls/freezes during testing and doesn't
generate
> any errors.

> Example of the eVC DLL code

> double APIENTRY DMSToDec(int Degrees, int Minutes, int Seconds)
> {
>     //Implementation code
> }
> double APIENTRY DecToRads(double DecValue)
> {
>     //Implementation code
> }

> Def file created and functions exported.

> VB Definition
> ***********

> Declare Function DMSToDec Lib "Windows\MYDLL.DLL" (ByVal Degrees as
Integer,
> Minutes as Integer, Seconds as Integer) as Double
> Declare Function DecToRads Lib "Windows\MYDLL.DLL" (ByVal DecValue as
> double) as Double

> Now, I believe that the double data type is not valid for declaration
> satatements, amoung others, so I converted the code accordingly.

> Declare Function DMSToDec Lib "Windows\MYDLL.DLL" (ByVal Degrees as
Integer,
> Minutes as Integer, Seconds as Integer) as Variant
> Declare Function DecToRads Lib "Windows\MYDLL.DLL" (ByVal DecValue as
> Variant) as Variant

> I also tried passing the variants ByRef.  Nothing works.   I now read that
a
> function declaration cannot return a variant.  I'm confused...  It appears
> that I cannot use a declaration the returns any variation of a floating
> point variable.

> The lack of any error message except the occassional "fatal error in
> pvbload.exe" and the fact I can't terminate the running app from within
> WinCE has me stumped.

> Any ideas would be appreciated.

> Regards

> Shane Brodie



Sat, 03 Jan 2004 08:22:48 GMT  
 Custom eVC++ DLL Problem in eVB
Thanks for the hint.  Will give that a try.


Quote:
> Shane,

> I am not of much use to you re C++, but I can tell you that a C++ in
should
> translate to a VB Long, not int - and you also appear to have missed the
> ByVal from the remaining parameters:

> Declare Function DMSToDec Lib "Windows\MYDLL.DLL" (ByVal Degrees as Long,
> ByVal Minutes as Long, ByVal Seconds as Long) as Variant

> I think you are right re the double parameters, so perhaps doing something
> like this:

> MyDoubleVariant = CDbl(0)

> Before passing it "ByVal" may force it to pass as a double given that the
> variant sub-type will now be double... just an idea.

> HTH

> Dino



> > I have developed a simple DLL in eVC that provides some complex math
> > calculations for my eVB client application.

> > I also ported the same code to VC++ and VB for PC users.

> > The Win32 PC application works fine every time.

> > The WinCE version simply stalls/freezes during testing and doesn't
> generate
> > any errors.

> > Example of the eVC DLL code

> > double APIENTRY DMSToDec(int Degrees, int Minutes, int Seconds)
> > {
> >     //Implementation code
> > }
> > double APIENTRY DecToRads(double DecValue)
> > {
> >     //Implementation code
> > }

> > Def file created and functions exported.

> > VB Definition
> > ***********

> > Declare Function DMSToDec Lib "Windows\MYDLL.DLL" (ByVal Degrees as
> Integer,
> > Minutes as Integer, Seconds as Integer) as Double
> > Declare Function DecToRads Lib "Windows\MYDLL.DLL" (ByVal DecValue as
> > double) as Double

> > Now, I believe that the double data type is not valid for declaration
> > satatements, amoung others, so I converted the code accordingly.

> > Declare Function DMSToDec Lib "Windows\MYDLL.DLL" (ByVal Degrees as
> Integer,
> > Minutes as Integer, Seconds as Integer) as Variant
> > Declare Function DecToRads Lib "Windows\MYDLL.DLL" (ByVal DecValue as
> > Variant) as Variant

> > I also tried passing the variants ByRef.  Nothing works.   I now read
that
> a
> > function declaration cannot return a variant.  I'm confused...  It
appears
> > that I cannot use a declaration the returns any variation of a floating
> > point variable.

> > The lack of any error message except the occassional "fatal error in
> > pvbload.exe" and the fact I can't terminate the running app from within
> > WinCE has me stumped.

> > Any ideas would be appreciated.

> > Regards

> > Shane Brodie



Sun, 04 Jan 2004 11:42:29 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. NewB Q: Calls to eVC++ DLL from eVB app

2. Passing String from eVB to eVC++ DLL

3. eVC++ dll use in eVB

4. Debugging an eVC++ DLL from an eVB application?????

5. Custom data types in eVB/eVC

6. Calling eVC DLL from eVB App ??

7. calling eVC COM DLL from eVB app

8. Question about calling a EVC .dll in EVB

9. evb/evc dll question

10. Calling eVC dll from eVB

11. Can I use eVC DLL In eVB ?

12. I can't connect the device from eVB or eVC++

 

 
Powered by phpBB® Forum Software