VC++ 2005 migration problem

L

lewisksh

hi, i have 1 MFC project which is written using VC++2003 but i need to
migrate to VC++2005. The program (VC++2003) is working fine. but there

is erros occur when running in VC++2005, and i just able to figure out
that the problem was come from the following code.


# ifdef WIN32
# if defined(MPSC_EXPORT)
# define MPSC_API __declspec( dllexport )
# elif defined(MPSC_IMPORT)
# define MPSC_API __declspec( dllimport )
# else /* for static libraries */
# define MPSC_API
# endif
# else /* !MD_WIN32 */
# define MPSC_API
# endif


would any one can tell me why this coding will be the problem for my
program?
thanks
 
D

David Lowndes

hi, i have 1 MFC project which is written using VC++2003 but i need to
migrate to VC++2005. The program (VC++2003) is working fine. but there
is erros occur when running in VC++2005, and i just able to figure out
that the problem was come from the following code.


# ifdef WIN32
# if defined(MPSC_EXPORT)
# define MPSC_API __declspec( dllexport )
# elif defined(MPSC_IMPORT)
# define MPSC_API __declspec( dllimport )
# else /* for static libraries */
# define MPSC_API
# endif
# else /* !MD_WIN32 */
# define MPSC_API
# endif


would any one can tell me why this coding will be the problem for my
program?

It might help if you told us exactly what the errors are, and why you
think those definitions are responsible for it.

Dave
 
L

lewisksh

thanks for the reply. after compliation(VS2005), the program can run
but when i click on certain button which will call the function from
the dll files , the program terminate immediately. So, i'm thinking
there is a problem in the code which use to load the dll files. But
when i run tha same program(complile from VS2003), it was no error.

there is a error message, state "debug assertion failed" which come
from commit.c.
_VALIDATE_RETURN((filedes >= 0 && (unsigned)filedes <
(unsigned)_nhandle), EBADF, -1);

would there is the possibility the problem is come from the dll files?

thanks
 
D

David Lowndes

thanks for the reply. after compliation(VS2005), the program can run
but when i click on certain button which will call the function from
the dll files , the program terminate immediately.

OK, so debug your program and find exactly where it crashes.
So, i'm thinking
there is a problem in the code which use to load the dll files.

You're guessing - don't! Debug it and find out exactly where it
crashes.
would there is the possibility the problem is come from the dll files?

It's possible that you also need to rebuild the DLL with VS2005, but
you've not given us any information to know whether that might be the
case or not.

Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top