| Author |
Message |
bxchan

|
Posted: Visual C++ Language, it is neither a .NET assembly or registered Activex Control |
Top |
Hi, I try to add a TestEngine.dll from CSR website to my VC++ .Net 2005 but I saw the error message below
"Could not add a reference to file ‘TestEngine.dll’ because it is neither a .NET assembly or registered Activex Control."
May I know what is the procedure to add this dll file
Very appreciate if any help provide.
Thanks.
Visual C++10
|
| |
|
| |
 |
Mike Danes

|
Posted: Visual C++ Language, it is neither a .NET assembly or registered Activex Control |
Top |
If it's not an .NET assembly or Active X control then I suppose it is a normal dll and in that case you need a lib file for it, a TestEngine.lib file. If you have such a file go to Project Properties, Configuration Properties, Linker, Input and add TestEngine.lib in Additional Dependencies field.
|
| |
|
| |
 |
bxchan

|
Posted: Visual C++ Language, it is neither a .NET assembly or registered Activex Control |
Top |
Thank You For Reply.
I have add the TestEngine.lib in Additional Dependencies field.
After finish compiling. I try to execute. It was pop up with another error like below. Although I try to put the TestEngine.dll and Test Engine.lib in the same folder with the source code but still no luck.
An unhandled exception of type 'System.DllNotFoundException' occurred in d1.exe
Additional information: Unable to load DLL 'TestEngine.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
What else can I do
|
| |
|
| |
 |
Mike Danes

|
Posted: Visual C++ Language, it is neither a .NET assembly or registered Activex Control |
Top |
Try placing the dll in the same folder with the d1.exe, not with the source.
|
| |
|
| |
 |
bxchan

|
Posted: Visual C++ Language, it is neither a .NET assembly or registered Activex Control |
Top |
Yes, I try to put with the same directory with the exe file but still pop up with the same msg while execute.
I do check add the fullpath of the dll and check the filename but still no luck. I try to make a simple dll myself, the dll file that i created seem work well. but the TestEngine.dll still face the same problem.
What else I can do
|
| |
|
| |
 |
Mike Danes

|
Posted: Visual C++ Language, it is neither a .NET assembly or registered Activex Control |
Top |
Hmm... maybe that dll depends on another dll. Try using Dependency Walker on it to see if it does not depend on something else. Dependency Walker is normally installed by Visual Studio. Do a search for depends.exe in the VS directory.
|
| |
|
| |
 |
bxchan

|
Posted: Visual C++ Language, it is neither a .NET assembly or registered Activex Control |
Top |
Thank you.
Yes, by using the depends.exe, I had found that it missing another 2 dependent dll files. after i gather those dll, I able sucessful compile the code and execute it.
But it seem doesn't work as what I expected. I suspect that dll doesn't work well. How can we debug the dll to check that dll is working corrrectly
|
| |
|
| |
 |
Mike Danes

|
Posted: Visual C++ Language, it is neither a .NET assembly or registered Activex Control |
Top |
" How can we debug the dll to check that dll is working corrrectly "
That really depends on the dll and if you don't have the source code for the dll you can't do much about it. Are you sure you are using the dll correctly Maybe you should ask the providers of this dll for documentation or samples
|
| |
|
| |
 |
abcdefgqwerty2

|
Posted: Visual C++ Language, it is neither a .NET assembly or registered Activex Control |
Top |
I have this same problem. How do you add the .dll though when it wont let you and gives that error message I have the .lib file added, but I cant figure out how to add the .dll.
|
| |
|
| |
 |
Mike Danes

|
Posted: Visual C++ Language, it is neither a .NET assembly or registered Activex Control |
Top |
What error message Usually you don't add dll files but lib files.
|
| |
|
| |
 |
abcdefgqwerty2

|
Posted: Visual C++ Language, it is neither a .NET assembly or registered Activex Control |
Top |
It says cannot add reference because it is neither .net assembly nor registered active x control. I linked in the .lib files for the 3 .dlls i need. All I need is to link in the .libs and put in include for the .h files Normally I would add reference to .dll but in this case I get the error.
|
| |
|
| |
 |
Mike Danes

|
Posted: Visual C++ Language, it is neither a .NET assembly or registered Activex Control |
Top |
OK, not I get it. You are trying to add a dll as a reference in a CLR project. That only works if the dll that you want to add is a managed dll. From the error you are getting I suppose it is not, it's just a normal, native, dll. So in short, yes, you just need to link in the .lib files and include the appropiate headers.
|
| |
|
| |
 |
abcdefgqwerty2

|
Posted: Visual C++ Language, it is neither a .NET assembly or registered Activex Control |
Top |
Ok thanks. One last question what type of project would I want so I can use unmanaged c++ is win32 app unmanaged by default
|
| |
|
| |
 |
Mike Danes

|
Posted: Visual C++ Language, it is neither a .NET assembly or registered Activex Control |
Top |
Yes, Win32 Project/Win32 Console Application are unmanaged by default.
|
| |
|
| |
 |
| |