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?
Related
I am working in VS 2012 C# and trying to add reference to zlib.dll, which I downloaded from ZLIB web-site. I am getting the following error message while trying to add reference:
A reference to 'C:\CTS\T4ClientSim\bin\zlib1.dll' could
not be added. Please make sure that file is accessible, and that is
a valid assembly or COM component.
I tried to launch VS as administrator, but it did not help.
Any help?
Motivation:
I want be able to retrieve and view Certificates from a Windows CA on a local Machine. I don't want to access the Browser-Keystores of the Machine, but the Windows CA (Windows Certifcate Authority (Service)).
I want to to do this in C#-Code.
My Investigation so far:
I found several Examples that are using the following line:
ICertView2 certView = new CERTADMINLib.CCertView();
...
I think i'm able to use this line and the ICertView2 Structure, i reached my Goal.
If a write this Line into my C#-Code in Visual Studio, it says to me, that it don't know ICertView2 and CERTADMINLib.
So if searched the Web again and found out the i need to import a Reference. I need the COM Library certadmin.dll, that fortunately exists in my C:\Windows\System32 Folder.
So i tried to add the Reference over the Solutionexplorer->Project->References->Add Reference->COM. But it is not listed there, only a similar looking Library called "CertCli 1.0 Type Library". I added this and also was able to type an
using CERTCLIENTLib;
but unfortuneatly, the needed "ICertView2" Class is not in there.
If i type
using CERTADMINLib;
that should be typed in order to be able to use the ICertView2, Visual Studio says to me, that it also don't know "CERTADMINLib".
Further i found hints on the net, that one need to register the certadm.dll beforehand, in order to make it available in Visual Studio. I tried to register the dll-File, but it doesn't work.
If i invoke the following Command:
C:\Windows\System32>regsvr32.exe C:\Windows\System32\certadm.dll
and get a Dialogbox telling me the following:
'Error while loading the Module "C:\Windows\System32\certadm.dll". ... The specified Module could not be found.'
The Version of certadm.dll ist "5.2.3790.3959".
I'm using "Windows 7 Enterpise SP1".
Can you tell me, how i'm able to register and futher make the appropriate Reference available in Visual Studio?
If i've forgotten further Information, please let me know, so i can add them.
Microsoft changed much from XP to Win7. To be able to reference it you will have to tlbimp certadm.dll. Tlbimp.exe can be found in your .NET SDK's and such. Then you will have to import this library in your .NET solution.
Although i have to warn you, i have not mangaged to get any code working in Win7 that works in XP.
You can also look at this link:
http://blogs.msdn.com/b/alejacma/archive/2012/04/04/how-to-get-info-from-client-certificates-issued-by-a-ca-c-vs-2010.aspx
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.
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.
Ok, this line of code:
XMLHTTP40 http = new XMLHTTP40();
Throws a System.Runtime.InteropServices.COMException and complains that:
Retrieving the COM class factory for component with CLSID {88D969C5-F192-11D4-A65F-0040963251E5} failed due to the following error: 80040154.
I have googled that and I guess the DLL needs to be registered because its a COM DLL. That's fine, but when I try to register it I get this error:
C:\some\directory\path\etc\Interop.MSXML2.dll was loaded, but the DllRegisterServer entry point was not found.This file can not be registered.
Apparently this is working on another guys box (he wrote the code, so yeah.. :P). This COM object does not show up in my list of available COM references so I just reference the DLL which is sitting in the bin\Debug directory of the project. When I add the reference to this DLL to my project, I get access to all of the symbols in VisualStudio. I'm wondering, is there something that I can install that would register the DLL and have it show up in my list of COM objects that I can reference? I installed what I thought was the MSXML 4.0 library but when I looked in the directory there wasn't anything in there.
Any ideas?
You need to actually have MSXML4 installed on your box for it to work. THe interop dll doesn't contain any runtime code it only helps .NET talk to MSXML4.
However why would you not use the System.Xml namespace instead of using a COM component?
You need to register (regsvr32) msxml4.dll, not the interop assembly. msxml4.dll is the COM server.