How to add a vs2005 .tlb reference to a vb6 app - c#

Error referencing vs2005 c#
file(.tlb extension) in
vb6 application.
error message:
Can't create activeX object

You need to make your app callable by COM

If you did not compile the c# library yourself on the same computer, you will need to register it with regtlib.
In my experience if it does not show up in the Project|Reference Dialog by itself, don't bother adding it manually. Something went wrong before and it won't help to add it manually.

Related

dll reference Error in c# windows form App project

I am trying to add a dll into my windows form application type project. However, when I am adding the dll to reference folder it is throwing an error and restricting me to add the same. Enclosed is a screenshot. Can anyone please let me know, under which condition we get this error and how to fix it?
Note: I am not aware, the dll has been produced using what tool or version/type of it.
screenshot of error
The message is:
A reference to C:\xyz.dll. dll could not be added, Please make sure
that the file is accessible and that it is a valid assembly or COM
component.
It's is exactly what you read and the message says.
Either thhis DLL doesn't contain any .NET code or class, or this DLL isn't a valid ActiveX DLL containing a typelib.
You can not add a DLL as a reference if it is not one of the above.
This is a possible duplicate to

dll File not accessible

I know this question has been asked before but all the steps advised doesn't seem to work for me.
I am trying to use WebCamLib.dll to my project but it keeps giving me this error:
please make sure the file is accessible and that is a valid assembly
or com component
I tried to register the dll to SYSTEM32 and I get this error
The module C:\WebCamLib.dll" was loaded but the entry-point
DllRegisterServer was not found.
Make sure that "C:\WebCamLib.dll" is a valid DLL or OCX file and then
try again.
Please suggest a way. Thank you in advance.
The library you are trying to use is a managed library, you don't need to register it or use dllimport. Just add a reference from inside your project to the dll.
First option is DLL file may be corrupt. Make sure it is working with other applications.
My second opinion is you are trying to use this DLL as COM object which is not.

adding matlab COM reference in visual studio fails

I'm trying to invoke a matlab function from my c# code.
I understand that i need to add a COM reference to mlapp.tlb but apparently my matlab isn't installed correctly so vs 2012 doesn't find the reference in the COM list.
I tried adding the reference by browsing to mlapp.tlb from the add reference menu but i get the following error:
mlapp.tlc bould not be added. please make sure that the file is accessible and that it is a valid assembly or COM component.
Can someone help?
Thank you.
An unclean installation of MATLAB could well be the cause of this issue. It might be fixed by registering MATLAB as a COM server. Have you seen http://www.mathworks.com/matlabcentral/answers/101093?

How to write C# to call vb6 code?

I have an activeX DLL in VB6 , and i've been asked to run some tests with it. since i dont have VB6 environment anymore, i thought it'll be best to try and make a simple C# program that will call the registered COM Dll. to do that i copied the DLL into c:\windows\system32, used regsrv32 to register the DLL, restarted the computer and this DLL is added to COM so I added it to my project and referenced to it from my project. I created an object from it and tried to invoke a function from that but there is nothing available but DllUnusedClass and DllUnused.
You say you've added a reference to the COM dll to your project, now I would right click on the reference and select "View in object browser". This will show you which types are available in the referenced dll.
It may be you're not creating the appropriate type of object, so viewing it in object browser should help you decide which type of object to create.
Make sure that any class you have in the VB6 project, that you want to access from your .Net application, has the Instancing property set to 6 - GlobalMultiUse so that it is in scope.
I have tested your scenario with the Instancing property set to the default 5 - MultiUse and experienced the same issue you described.

Using VAMP Plugins with C#

I am wondering how to use VAMP Plugins with C# for Visual Studio 2008? I have downloaded multiple VAMP Plugins already. Currently, I have tested them using Sonic Visualiser and it looks great! However, I am having some problems incorporating it to my C# program.
My problem is that whenever I try to reference the .dll file, it gives me an error, something about 'make sure you are referencing a valid assembly or COM object'. How do I get around this?
Thank you very much!
I think you mean these: http://www.vamp-plugins.org/
As far as I can see, they are written in C++, so you can't add them as reference. You need to use P/Invoke to use those plugins.

Categories

Resources