Re: dll eat my functions :< by Bonj
Bonj
Sun Feb 08 07:18:12 CST 2004
You're absolutely sure that it's the difference in parameters that causes
the difference in whether it works, and nothing to do with the way the
exported (or not) function is being called? How are you deducing that the
function "does not exist in the DLL?" Remember the error 'can't find entry
point' is fairly generic and doesn't necessarily mean that the function
point blank doesn't exist, I've had it when it's being called wrong. For
instance if you're calling it from VB and you use ByRef instead of ByVal
then it'll not like it.
I'm no expert, but if you're right, then logic states that it should be
either one or a combination of the parameters
long nPoints, float* pY, LPCTSTR szFlags, int makeCopy
that it's got beef with. Since it's OK with just the 'long lRegionID'.
Probably quite laborious, but try adding each of them in turn, and see if it
manages to export it then.
Then you'll narrow it down to exactly which parameter is causing the
problem. Maybe then you will realise why, or be able to think of a different
way of passing that data - since you seem to be in the relatively fortunate
position where you control the development of both caller and callee.
Other points that might be useless and/or works-but-a-bit-hacky, but you
could give them a shot anyhow:
- extern "C" functions might be more easily exported from a DLL when wrapped
by a standard C++ function?
- aren't exported functions supposed to be __stdcall?
"Fu Chen" <novalet@yahoo.com.cn> wrote in message
news:46c1ab97.0402072210.1cf8da11@posting.google.com...
> Hi!
> I think it maybe a question difficult to answer. But I hope there are
> some people share the same experience with me will give me some hint.
> I find one dll project very weird.
> There are some functions in the dll to be export. They are declare
> with extern "C" _declspec(dllexport).
> But some function(about 5%) can't be find in the generated dll. (I
> used ultraedit to search for the name in the dll binary)
> I finally find out it have some relation to its parameter. for example
> int funcNoUse(long lRegionID)
> {
> return 0;
> }
> will be ok, it's generated in the dll.
>
> But if i change it to
> int funcNoUse(long lRegionID, long nPoints, float* pY, LPCTSTR
> szFlags, int makeCopy)
> {
> return 0;
> }
> it will not exist in the dll.
>
> I really don't know what's up. I have test it on two computer one with
> VS7 and another with VS7.1 have the same result.
>
> any idea?