expected constructor, destructor, or type conversion before "double"

dll compile occur error when in dev c++

sloved: --> it have some syntax error, i find out that if i don't post all my code , it difficult for
others to tell where the mistake is

i haven't declared the directory of function also~ ~


it say line 56:
expected constructor, destructor, or type conversion before "double"

line 56:
happy double __stdcall PassValue1(double enterjudge,double low[1],double low[2],double& siu)

who can tell me how to amend it~ ~



Last edited on
Is that a call or a declaration?
1
2
3
4
5
6
7
8

happy double __stdcall PassValue1(double enterjudge,double low[1],double low[2],double& siu)

{
   double sad;
  return(sad);
}


it is a function
Last edited on
The function has two return types. Also, two of its parameters are called 'low'.
double& does not exist. Use double* instead.
matrebatre: What the hell are you talking about? It's a reference to a double.
How are you calling the function? Your type doesn't match a double and there's no suitable conversion.
To kbw
How are you calling the function?


i call a function through a exe file



Your type doesn't match a double and there's no suitable conversion.


i haven't post all my code, i will return a double variable
hope that i haven't misunderstand your meaning, i don't know what "suitable conversion " means~ ~

1
2
3
4
5
6
happy double __stdcall PassValue1(double enterjudge,double low[1],double low[2],double& siu)
{
    double sad;
    return(sad);
}

Last edited on
Apparently, I was a little too subtle the first time, so...
The function has two return types.
happy double __stdcall PassValue1(

two of its parameters are called 'low'.
double enterjudge,double low[1],double low[2],double& siu
helios
The function has two return types.

OH~ ~
i haven"t post the code
 
#define happy __declspec(dllexport) 

it make the function symbol export to DLL(the book say that), btw does it necessary?

that mean in all
1
2
3
4
5
6
7
#define happy __declspec(dllexport)
happy double __stdcall PassValue1 (double enterjudge,double low[1],double low[2],double& siu)
{
    double sad;
    return(sad);
}
Last edited on

double __stdcall PassValue1 ( double enterjudge,double low[1],double low[2],double& siu)

two of its parameters are called 'low'


does it work to pass a array form exe to dll like this way ?
if wrong , what is the correct code of passing a array?
thanks
Last edited on

helios (2688) May 16, 2009 at 12:14am

matrebatre: What the hell are you talking about? It's a reference to a double.



matrebatre is right , as a called function should not use a "&"

just call function use a "&"

below are call function
PassValue1 (double &enterjudge,double& low[1],double &low[2],double& siu)


below are called function, which define what the function do
1
2
3
4
5
 happy double __stdcall PassValue1 (double enterjudge,double low[1],double low[2],double siu) // --> should not have a "&"
{
    double sad;
    return(sad);
}


but the way, after typing the problem in here, i know clearer of the problem
Last edited on
Passing a reference to a double as a parameter to a function is perfectly legal. It implies the function will modify the argument (and the caller will see the change) whereas in chiwing's suggestion the caller would not see any change.

One or the other is "correct" but not both, but it's impossible to say without knowing what the arguments really are and what the function really does.

[unless of course one must stick to C function calls in the DLL API... I am not a windows programmer so I don't know.]
thanks
anyway , the problem have solved

let's stop this post~ ~
Topic archived. No new replies allowed.