Is It possible to add dll refrence of c# file into Labwindow - labwindows

Is It possible to add dll refrence of c# file into Labwindow.
Hi I want to use dotnet program written in c# in Labwindow/cvi in c language is it possible or not??

Your question poses other questions, but in a nutshell, Yes, you can use a .net/c# .dll within CVI. The easiest way is to include a header file and .lib generated for that .dll. The CVI project should compile/build and run.

yes it is possible
on help>Contents>index> dll you will find Exporting DLL Functions and Variables
there is 3 way to do so , but i suguest " Using the Export Qualifier Method "
best regards

Related

How to use PDFbox dll in QTP vbscript

I need to use PDFbox dll in QTP vbscript , initially I tried to convert PDFbox jar to respective PDFbox dll with help of ikvmbin-7.2.4630.5, it was successfully so that i can use pdfbox.dll in c# and VB.NET similarly i need to use it with vbscript - QTP . Initially tried to access the converted PDFbox.dll using DotNetFactory.CreateInstance
Set TestPDFDoc = DotNetFactory.CreateInstance("org.apache.pdfbox.pdmodel.PDDocument","D:\\PDF\\PDF\\pdfbox-1.7.1.dll")
while executing it throws me but it throws me
Type 'org.apache.pdfbox.pdmodel.PDDocument' not found in any loaded assembly
can anyone help me out
Thanks
I don't think you need to escape the backslashes, ie use \\ instead of just \ ? I don't know QTP, but in VBScript, you don't need to escape backslashes.
Ie try
Set TestPDFDoc = _
DotNetFactory.CreateInstance("org.apache.pdfbox.pdmodel.PDDocument", _
"D:\PDF\PDF\pdfbox-1.7.1.dll")
Most likely, the error occurs because one or more assemblies referenced by your .dll could not be found. Use a .NET dependency viewer tool (for example, the open-source ILSpy) to determine the referenced assemblies and place them to the same folder as pdfbox-1.7.1.dll. I guess you need to place some of the IKVM.NET assemblies next to your .dll.

Error when trying to zip files VB.NET 2003

I have to make a simple zip file using Visual Studio and VB.NET 2003.
After some googling I got to this page: http://www.digioz.com/tutorials/zip_unzip_vbNET/Zip_and_Unzip_VB_NET_1.html wich basically provides me 3 DLLs with classes that are ready to zip files.
When I try to create an instance of the class like the tutorial tells me to:
Dim zp As New CGZipLibrary.CGZipFiles
I get this error:
COM object with CLSID {293364BA-43F8-11D3-BC2D-4000000A2806} is either not valid or not registered.
Ideas?
If anybody got a better/easier approach to zip files using VB.NET 2003 it would be helpful too.
Thanks.
EDIT:
Thanks for all who answered, but I've used a different approach than the suggested ones to zip my files.
I used the Shell function of the Microsoft.VisualBasic.Interaction class like this:
Shell("zip -j " & fileName, AppWinStyle.Hide, True)
Thanks again for those who dedicated their time trying to help me!
It looks like that library you are trying to use is an old COM dll. That means you have to register the dll first using regsvr32.exe before you can use it. However, I would recommend using a native .NET (managed) library. Unless it doesn't meet your needs, I'd simply recommend looking at the GZipStream class which is part of the .NET framework.
Have you tried this one? This is pretty good: ionic.zip.reduced, a dotnetzip library.
Example:
Using zip As ZipFile = New ZipFile()
zip.AddFile("c:\photos\personal\7440-N49th.png")
zip.AddFile("c:\Desktop\2008_Annual_Report.pdf")
zip.AddFile("ReadMe.txt")
zip.Save("MyZipFile.zip")
End Using
More VB.NET examples of Ionic.ZIP
UPDATE:
Your problem is that VS2003 can't use the targeting of the dll which was created in a newer (eg. VS2005) version of VS. For many have tried to use that, a tool was created which you can download here. For more information, visit this site.
Another option that I use in most of my projects is #ZipLib (SharpZipLib), downloads available here:
http://www.icsharpcode.net/opensource/sharpziplib/Download.aspx
Documentation and samples for both VB and C# are available at the same site. It has specific binary assemblies (dll) for .NET framework 1.1, as well as later versions. It's likely that some of the other libraries that you're run across are compiled for .NET 2.0 or later, which won't work in VS2003.
Don't let the name fool you -- it's written in C# (hence the name) but the compiled assemblies work just fine in VB.NET. It supports Zip, GZip, tar, and BZip2 archives.

Get IDL code from TypeLibrary programmatically

I am writing code to perform the following steps;
Register a .net .dll and generate a .tlb using regasm.exe
Register a .net .dll and generate a .tlb using regasm.exe
Generate the IDL code from the typeLibrary and store it in a file.
Edit the IDL code making minor changes.
Recompile the IDL into a .tlb using Midl.exe.
The step I am stuck on, as I am sure you have guessed, is the generation of the IDL. I know this can be done manually by using the OleViewer that comes with the Windows API, however I would like to remove this manual step.
I cant seem to find anyway to operate the OleViewer via command line or find any other method of generating the IDL code.
Anybody got any ideas? I know the code to generate the IDL must be in the OleViewer somewhere... perhaps there is a way to access it?
Wine has an open source implementation of oleview
http://source.winehq.org/git/wine.git/tree/HEAD:/programs/oleview
Perhaps you'd be able to use the idl enumeration functions in typelib.c
http://source.winehq.org/git/wine.git/blob/HEAD:/programs/oleview/typelib.c

How to build static library using RAD Studio 2010?

I have been confused by C++ Builder 2010 assuming my library is dynamic. I did not find any options or help in documents regarding what I need to change in the project to build static library.
Now I produce DLL, but I need to produce LIB, so I can just link it to the project and forgot about DLL. BTW it produces LIB, but for dynamic linkage only.
Did you tried Project Props -> Config properties -> Config Type -> Static library (.lib) ?
I know this is old but AFAIK Delphi 2010 doesn't support .bpi (static) files. It was removed at some point. This has been a ballache for us too, as we have a large project that we want to break down into units and for various reasons dynamic libraries won't cut it.
You have to choose "Static Library" when you create the project. You can't convert it once the project already exists. This will create a statically linked library. It should be easy to add your existing source files to the new project and just build.

Converting static linked library to dynamic linked library under windows

I am in the midst of evaluating the benefits of changing our program from 30+ statically linked libraries to 30+ dynamically linked libraries. We hope by changing to DLL, it will reduce the link time.
One immediate problem is the requirement to add __declspec in front of all the classes to create the lib file for other dlls to link. Is there a way to get around that? Is there a flag in the compiler to force a lib generation so to make all classes inside the DLL available for export? If not, is there any existing script/program that will do that? That will certainly make the switch from statically linked library to a dynamic one a lot easier. If not, what is the rationale behind __declspec? Why not an option to make all dll functions exportable?
Thank you.
Perhaps it's too late, but have you looked into using a DEF file?
There is one another way to solve your problem.
You just need to create one definition file(.def) and export all the methods or class you want to share.
U will also have to set :
Properties->Linker->Input->Module Definition File -> add name of your created .def file.
Now use run time dynamic linking:
In project where you want to call the exported methods use LoadLibrary to get handle of your Dll and call the required method using GetProcAddress.