Click here to Skip to main content
15,896,118 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi all,

I want to create a COM DLL using VSS 2010 and need to register to Registry. My aim is I want use that created DLL like "Excel.Application", "Word.Application", "Wscript.Shell" kind-of.

I want to create instance using CreateObject / New OleObject methods and use the same in my Scripting (VBScript or JavaScript).

Any one help me to create a COM object and how to register it?

I tried to create COM Object and tried to register using RegSvr32.exe. It says "dll was loaded but no entry point found. Make sure valid dll or ocx"

Here is my code for your ref...

VB
<ComClass(ComClass1.ClassId, ComClass1.InterfaceId, ComClass1.EventsId)> _
Public Class ComClass1


    Public Const ClassId As String = "b3b13b6c-6de5-47cb-ad6f-0ae5c7ce5c59"
    Public Const InterfaceId As String = "68536b50-1b47-42d5-970f-d3d34b56d681"
    Public Const EventsId As String = "413fa5c3-76fa-44d0-b753-1f3d3f52dbaf"


    ' A creatable COM class must have a Public Sub New()
    ' with no parameters, otherwise, the class will not be
    ' registered in the COM registry and cannot be created
    ' via CreateObject.
    Public Sub New()
        MyBase.New()
    End Sub


    Public Sub Test1()
        Console.WriteLine("Test1....")
    End Sub

End Class
Posted
Updated 20-Jun-11 2:49am
v2

The file may be corrupted so you need to repair that file, better get it from disc.

Quote taken from below post

Another suggested solution was to run regsvr32 %WinDir%\system32\pngfilt.dll in the command prompt. This promised to re-set the png functionality from Vista’s source files, and as with the fix described above, it seems to work for some. But when I tried this, I got yet another error message: “The module C:\Windows\system32\pngfilt.dll was loaded but the entry-point dllregisterserver was not found. Make sure that C:\Windows\system32\pngfilt.dll is a valid DLL or OCX file and then try again.” A colleague suggested using the System File Checker to repair that file from the Vista DVD. Which would have been great if I had gotten a Vista DVD with this laptop. But mine only came with the option to create a recovery or restoration CD, which would not fix that corrupt file.
Fixing the PNG bug in IE7[^]

Free attachments
How to fix corrupted files in Windows XP[^]
XP DLL Library Restore : Restore And Repair All Corrupt DLL Files Back[^]
Fix Corrupt DLL Library File In Windows XP and Windows Vista[^](Youtube Video)

Explanation of Regsvr32 usage and error messages[^]
How to fix missing/corrupt DLL files[^]
 
Share this answer
 
Comments
[no name] 24-Jun-11 6:41am    
Good Call. My 5 too.
Have you followed all of the required steps? Have a look at this article which should help you see if you've missed anthing

Exposing .NET Components to COM[^]
 
Share this answer
 
Hey Guys,

Actually Now I created a COM dll using VS2010 and its working fine. I can create instance of that object from VBScript and JavaScript as well.

Now I am on the way to other problem?

In my VB code, function is returning an 2D array. I have to access this in JavaScript like

var obj = new ActiveXObject("MyProgID")
var values = obj.function1() // throws error


So function1 returns a String()() array. While executing my JavaScript code, it throws error. Not assigning to variant values.

How I can do this?

Am i want to convert my VBArray to JavaScript array and then return?
OR
Am i want to type cast the returning array in my JavaScript code before assigning?

Can you help me how to do this?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900