May 14, 2009 at 7:05am UTC
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 May 18, 2009 at 9:29am UTC
May 14, 2009 at 12:18pm UTC
Is that a call or a declaration?
May 15, 2009 at 2:24am UTC
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 May 18, 2009 at 9:12am UTC
May 15, 2009 at 10:37am UTC
The function has two return types. Also, two of its parameters are called 'low'.
May 15, 2009 at 4:00pm UTC
double& does not exist. Use double* instead.
May 15, 2009 at 4:14pm UTC
matrebatre: What the hell are you talking about? It's a reference to a double.
May 15, 2009 at 4:26pm UTC
How are you calling the function? Your type doesn't match a double and there's no suitable conversion.
May 16, 2009 at 11:03am UTC
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 May 18, 2009 at 9:06am UTC
May 16, 2009 at 3:56pm UTC
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 May 18, 2009 at 9:29am UTC
May 17, 2009 at 1:48pm UTC
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 May 18, 2009 at 9:17am UTC
May 18, 2009 at 9:24am UTC
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 May 28, 2009 at 5:57am UTC
May 18, 2009 at 12:09pm UTC
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.]
May 19, 2009 at 12:54pm UTC
thanks
anyway , the problem have solved
let's stop this post~ ~