473,287 Members | 1,515 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

Error in VB 6.0 : Class not Registered. Looking for object with CLSID :{....}

53
Hi ,

I am having a .Net Activex control. I have done coding for COMRegistering and Unregistereing in C#.Net. The code is follows..
[ComRegisterFunction]
static void ComRegister(Type t)
{
string keyName = @"CLSID\" + t.GUID.ToString("B");
using (RegistryKey key =
Registry.ClassesRoot.OpenSubKey(keyName, true))
{
key.CreateSubKey("Control").Close();
using (RegistryKey subkey = key.CreateSubKey("MiscStatus"))
{
subkey.SetValue("", "131457");
}
using (RegistryKey subkey = key.CreateSubKey("TypeLib"))
{
Guid libid = Marshal.GetTypeLibGuidForAssembly(t.Assembly);
subkey.SetValue("", libid.ToString("B"));
}
using (RegistryKey subkey = key.CreateSubKey("Version"))
{
Version ver = t.Assembly.GetName().Version;
string version =
string.Format("{0}.{1}",
ver.Major,
ver.Minor);
if (version == "0.0") version = "1.0";
subkey.SetValue("", version);
}
}
}

[ComUnregisterFunction]
static void ComUnregister(Type t)
{
// Delete entire CLSID\{clsid} subtree
string keyName = @"CLSID\" + t.GUID.ToString("B");
Registry.ClassesRoot.DeleteSubKeyTree(keyName);
}

When i Build this .Net project this control is getting registering in the registry and i am able to add this .net control in vb 6.0 form also. its working fine.

I want to test this dll on any other system other than developer machine....
Then i tried to register this dll through Regasm.. The control is registered succefully. but when i tried to add this control in to vb 6.0 form.. I am getting this error: Class not Registered .Looking for Object with ClsId :{...}..

Then i send full .net project to that system and build the .net appliaction. then it is registered fine and working fine in vb 6.0 also.. the problem is comming if i registered that dll through command line.. what is the solution for this...

Plz Help ....
Jan 14 '08 #1
9 17486
debasisdas
8,127 Expert 4TB
Try to register the DLL using REGSVR32 .
Jan 14 '08 #2
DKn
53
Try to register the DLL using REGSVR32 .
Yes i have done that .
.NET commandPrompt, i run the Command regsvr32 MyDotNetControl.dll.
error :MyDotNelControl.dll was loaded, but the DllRegisterServer Entry point was not found. the file can not be registered.
Jan 14 '08 #3
QVeen72
1,445 Expert 1GB
Hi,

If you want to use the .net dll in VB6,
While registering with regasm, you have to generate the "TypeLibrary" :

Expand|Select|Wrap|Line Numbers
  1. regasm myAssembly.dll  /tlb:myAssembly.tlb
  2.  
OR, if you have already registered(Without Type Library),
you can LateBind the Objects in VB6:
Expand|Select|Wrap|Line Numbers
  1. Dim tObj As Object
  2. Set tObj = CreateObject("MyProjName.MyClassName")
  3.  

Regards
Veena
Jan 14 '08 #4
DKn
53
Hi,
When i build my .net Project , both dll and tlb files are getting generated in bin debug folder.

I have tried this code in vb 6.0

Private Sub Form_Load()
Dim Obj As VBControlExtender
Set Obj = Form1.Controls.Add("MyProjName.MyClassName")
Obj.Visible = True

End Sub

Getting run time error: Class not registered.Looking for object with CLSID{....}
Is there any other solution....


Hi,

If you want to use the .net dll in VB6,
While registering with regasm, you have to generate the "TypeLibrary" :

Expand|Select|Wrap|Line Numbers
  1. regasm myAssembly.dll  /tlb:myAssembly.tlb
  2.  
OR, if you have already registered(Without Type Library),
you can LateBind the Objects in VB6:
Expand|Select|Wrap|Line Numbers
  1. Dim tObj As Object
  2. Set tObj = CreateObject("MyProjName.MyClassName")
  3.  

Regards
Veena
Jan 14 '08 #5
QVeen72
1,445 Expert 1GB
Hi,

its an ActiveX Dll or an ActiveX ocx..?
My previous code was for ActiveX Dll

If ActiveX ocx, then remove the code,
add the Control to the project
and from toolbox, directly place the Control on the Form..

Regards
Veena
Jan 14 '08 #6
DKn
53
Its .Net ActiveX Control.. when i drag and drop to the vb 6.0 form.. the same error...Class not registered.Looking for object with clsid :{...} is coming..
Jan 14 '08 #7
DKn
53
Hi,
If I register through .Net code... In the registry Editor, the control is registered with the GUID under classRoot . InProcServer32 CodeBase Entry is coming.
When I registered through Regasm this entry (codeBase value) is not there under InProcServer32. This is the only difference I observed....

Is this is the Reason, I am getting the error : Class not registered. Looking for object with clsid :{...}

Please anybody help me...

Its .Net ActiveX Control.. when i drag and drop to the vb 6.0 form.. the same error...Class not registered.Looking for object with clsid :{...} is coming..
Jan 14 '08 #8
Killer42
8,435 Expert 8TB
I suspect the .Net forum would provide a better response to this question.
Jan 15 '08 #9
DKn
53
Hi, i got the solution for this problem...
We need to Use this command..
Regasm /codebase myDotNetControl.dll
Now its working fine in other systems also..
But, the .Net dll must be strong named to use the Codebase command.....

I suspect the .Net forum would provide a better response to this question.
Jan 16 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Shabbs | last post by:
hi I am getting this error message :- Run-time error 713 Class not registered Looking for object with CLSID:{20DD1B9E-87C4-11D1-8BE3-0000F8754DA1} when ever i click on components which i...
4
by: Ahmed | last post by:
i have tried running the csharpsite in my Microsoft Visual C#.net and after i hit the run button i keep getting the same error which is : Server Error in '/csharpsite' Application COM object with...
4
by: Shiraz | last post by:
Hi I just made an installer package for an application in .NET which also uses COM dlls. It seems to work fine on my machine but when tried it on a co-worker's machine, the application installs,...
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
0
by: Nonee | last post by:
Hello- I have a form with the mediaplayer referenced to play mp3's and avi's and I believe that is what is causing the problem. I am not sure, but I am hoping. Anyway, I "published" the vb.net...
0
by: Nonee | last post by:
Anyone, anyone? : ) Hello- I have a form with the mediaplayer referenced to play mp3's and avi's and I believe that is what is causing the problem. I am not sure, but I am hoping. ...
5
by: krafla | last post by:
I have a similar problem with a program i made with VB 6.0 - the only control I used is MSFlexGrid - the program was developed on an XP machine. and the first time to use it on another machine i got...
0
by: DKn | last post by:
Hi , I am having a .Net Activex control. I have done coding for COMRegistering and Unregistereing in C#.Net. The code is follows.. static void ComRegister(Type t) { ...
2
by: pavanip | last post by:
Hi, I developed a windows application in Vb.Net 2003.It is working fine in this. But when I am trying to convert this into .Net 2005 I am getting this error. Class not registered...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.