Dllimport, Help needed

  • Thread starter Thread starter alex
  • Start date Start date
A

alex

Hi,
I try to use a c++ dll in a CS-project.
First i call a test method to receive the given parameter an compare
both:
extern DLLEXPORT char * DLL_Test(char *str){
return str;
}
This method is defined in a header file, in a seperate project of the
solution which provides the dll functions.
This works fine.
But when i try to start the application on another pc which doesnt have
an installed visual studio instance, but the same
installed .NET framework, the import of the dll failed.
 
alex said:
Hi,
I try to use a c++ dll in a CS-project.
First i call a test method to receive the given parameter an compare
both:
extern DLLEXPORT char * DLL_Test(char *str){
return str;
}
This method is defined in a header file, in a seperate project of the
solution which provides the dll functions.
This works fine.
But when i try to start the application on another pc which doesnt have
an installed visual studio instance, but the same
installed .NET framework, the import of the dll failed.

You are probably missing MSVC runtime libraries and/or MFC (if your dll uses
it). You have to redistribute it or use static linking option in msvc. Check
with dependency walker utility (http://www.dependencywalker.com/) which dlls
your dll tries to load.

Regards,
Goran
 
Thanks,
the problem was the usage of mfc. I set to use mfc in a static library.
Now it works.

Greetings,
Alex
 

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

Back
Top