Re: Calling function in another dll.
jis wrote:
Hi C++ gurus
I have a problem.
But it's not a _C++_ problem. Just so you know...
I am trying to call a function which is in another dll. but i have
problems when i run in release mode.it works good in debug mode, iam
using vc++ .
Consider asking in 'microsoft.public.vc.language', then. At least DLLs
are more on topic there.
this is what iam doing
typedef void (CALLBACK *atc_crypt)(double Nbr);
'CALLBACK' is some kind of macro, isn't it? Most likely OS- or
compiler-specific. In that case you need to post to the newsgroup
dedicated to your OS or your compiler.
atc_crypt crypt;
HINSTANCE hDLL = LoadLibrary("D:\\Programs\\crypt.dll");
You don't check the value of 'hDLL' for validity. Why? Are you sure
it's valid?
crypt = GetProcAddress(HMODULE(hDLL ), "atc_crypt");
You don't check the value of 'crypt' for validity. Why?
crypt(Nbr);
What is the type of 'Nbr'?
i get exception while running in release mode.
What kind of exception? Try the FAQ, section 5, questions 5.8 and 5.9,
see if they help.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask