I want to create activeX objects (.OCX files) using VB.net visual studio 2010 or 2015.
Is there any way to create activex objects using these tools.
In my project i have software like graphics builder it will accept activex objects, by registering it.
So i want to create some new customized activex objects.
.Net Cannot create pure ActiveX controls.You can create a .NET DLL with a COM callable wrapper, which is actually a .DLL, using the COM Class.
If you don't need to call the component from a COM then create a standard .NET DLL.
Related
I've written a dll ActiveX, which, in turn, has some other dll dependencies. This ActiveX now has to be used by the client with Oracle Forms 6i, but they're having trouble with the integration. They get an error from Oracle Forms Runtime: xxxx - Unable To Locate Component referring to EDSDK.dll, which I use in the ActiveX dll.
I would like to create an activeX control(OCX) in VB .net 2010 is it possible?
I having a hard time determining how to make it because I only get a .dll file rather than a .ocx which can be seen in vb6. I hope you can answer my question.
Are you asking how to create an "ActiveX" control specifically or are you asking how to create controls that can be used by other CLR based applications?
To create an ActiveX control, see this link which walks you through the steps to do this: Creating an MFC ActiveX Control
To create standard controls, you use a dll (class library) and can add as many controls to it as you like. You don't need a dll for each control, although you can.
can anyone give me some steps to create DLL without using class which means it will just have methods in the header file and source file would be only DLLmain() plus other methods. I'm using Visual Studio 2005 to create MFC DLL, but it always generates class. I never create DLL before but I was told that I can create DLL without class/object oriented concepts, just plain functions.
thanks.
For a regular Win32 DLL:
In the New Project wizard, under Visual C++ / Win32, choose Win32 Project.
Then in the next page, choose DLL as application type.
You may want to select Export functions as well to get sample code of exported variables, functions and classes.
From there on, simply delete what you dont need (such as classes).
I no longer have the Windows Mobile SDK installed, but I'm pretty sure you'll find the same kind of wizard to create a Windows Mobile DLL project.
Of course, if you don't want C++ classes, forget about MFC!
I am creating a excel application in VB.net using VisualStudio 2008.
while adding reference Microsoft.office.interop.excel we have both managed ( On the .NET TAB) and unmanaged (on the COM TAB).
currently i am referencing the COM tab but it is not showing the errors properly.
can i use the excel interop on .NET tab?
which one is the better way to reference and what is the difference between those two?
Yes, do use the .NET interop library to create the namespace 'Microsoft.Office.Interop.Excel'
Then define an application object with
Private app As Microsoft.Office.Interop.Excel.Application
and either a) connect to an a running Excel application with
app = CType(GetObject([Class]:="Excel.Application"), Microsoft.Office.Interop.Excel.Application)
or b) create a new Excel application with
app = CType(CreateObject(ProgId:="Excel.Application"), Microsoft.Office.Interop.Excel.Application)
Good luck!
The .NET version of the Interop library is basically the COM component in a .NET wrapper. It is advisable to use the .NET implementation.
I am very new to VB.net. I have written these objects in VB6 before. I'm just lost in VB.net, but (kicking and screaming) I have to learn how to do this. I've been googling for hours with only minor steps forward. Can anyone post a link that explains start to finish how to do this?
I have managed to write the class object, What I can not tell is how to register it and where the name1 and name2 in the CreateObject("Name1.Name2") come from.
Regsrv32 will not work. It says "Entry Point not found" and will not register it. Also, I can not drop it into the Assemblies directory. I read something about a regasm command one uses, but I can't seem to make this work either.
Thanks in advance for any assistance.
I am going to assume you are not trying to write a COM DLL but rather a complete project that call various sub assemblies like a VB6 EXE call a ActiveX DLL. If you can be more specific about what you are trying to do it would help me better.
Several points about VB.NET versus VB6.
1) For .NET only projects there is no registration. If a EXE or DLL references another .NET DLL the only requirement is that the DLLs be present in the parent's directory.
2) You can do a COM style registration for .NET apps only by registering the .NET assembly in the GAC. However there are several requirements for doing this. Do a search on the .NET GAC and it will give you the scoop on how to do this.
3) You can setup the .NET assembly to use COM in which case it will operate by the rules of COM including registration with regsvr.
You will find for .NET only project that #2, or #3 only come in rare instances. #1 will apply for 90% of your DLL assemblies. Of This is dependent on your project.
A common use for CreateObject is allow for plug-ins or installable libraries. .NET handles this through the Reflection API. With the reflection API you can look in a directory, go through each .NET DLL and see what them and create objects from what you find. Search for .NET Reflection to read up on this.
If your project is .NET only then I recommend that you create a Assembly that is reference by both the master assembly and the individual sub assembly that define the interfaces of the objects you are creating. This when you use the reflection API and determine the Object type you can assign it to a variable of that interface and code it noramlly with intellisense and other aids.
if you have old COM ActiveX Controls or DLLs .NET will generate a wrapper class that exposes the ActiveX Objects to .NET. I would spend some time learning how .NET does this. What I do create a dummy project and have .NET reference the ActiveX stuff I need. I then find the wrapper projects and DLL it made and move them into a central area. That why when I work on subsquent projects using the same ActiveX stuff I know where all the wrappers are.
You have to go to your class library properties and select the option "Register for COM interop". This will make your assembly available to COM.
You want to create what's called a COM Callable Wrapper (aka CCW) for your .NET component. This basically entails setting up some COM interfaces with some GUIDs and either enabling "Register for COM Interop" in the project properties (as mentioned) or using regasm.exe.