Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CreateObject function gives error! "ActiveX component can't create..."

Status
Not open for further replies.

tara8

Programmer
Nov 12, 2003
18
0
0
CA
Same as just posted thread, except I had to put a subject in.

I am getting this error:

"ActiveX component can't create object"

at this line of my code:

Set myObject = CreateObject("myProject.myClass", "myServerName")

(I've left out the real variable names).

Any ideas?

Also, my co-worker has the same code, only he's changed something in the object's interface and instead of getting the same error as me, he gets:

"Type mismatch"

More detail...

I'm trying to instantiate a class module that was compiled into an ActiveX DLL and registered as a COM component. Whenever I try to do this at the line of code that uses the CreateObject() function I get the "ActiveX component can't create object" error message ("Type mismatch" for my co-worker). The rest of the application works except for when I try to instantiate a certain class module that is new to the application. All other class modules are instantiated the same way, but for some reason a few new ones give me that error. We are using a 3-tiered application. I'm having problems accessing the 2nd tier from the 1st tier. And only for other machines than mine or my co-workers. This used to work (two weeks ago!), but just recently we've re-compiled the application and now it doesn't work.

I posted this in the Visual Basic 5.0/6.0 forum but so far no luck and I need a solution fast! Hopefully there's more results here in the COM forum.

This one is really frustrating!
 
type in comand line:
regsvr32 yourActiveX.dll

Ion Filipski
1c.bmp
 
Yes, the class was registered...

We fixed the problem... but still don't know why it had to be fixed that way...

We changed the project's compatibility to "Project", compiled it, then changed the project's compatibility back to "Binary", and replaced the copy of the dll. We had to do this for all projects that in the application that were affected.

Argh!?! Oh well... it's fixed.

Thanks for your input!
 
Yes, the class was registered...

We fixed the problem... but still don't know why it had to be fixed that way...

We changed the project's compatibility to "Project", compiled it, then changed the project's compatibility back to "Binary", and replaced the copy of the dll. We had to do this for all projects that in the application that were affected.

Argh!?! Oh well... it's fixed.

Thanks for your input!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top