Solved

Problems with ActiveX control

Posted on 2001-07-09
15
864 Views
Last Modified: 2010-07-27
I have an ActiveX control that I want to publish on the internet. I have recently encountered a big problem, when I add a referance to mshtml.tlb (Microsoft HTML Object Library). When I add it to my control it works fine on the win98 I have VB on, but when I try to run it (compiled ocx, packaged it with the package and deployment wizard) on  a win2k computer the program just won't start. If I remove the referance it works without problems!

any ideas?
thx
0
Comment
Question by:kristofer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
  • 3
  • +1
15 Comments
 
LVL 7

Expert Comment

by:Inteqam
ID: 6265352
maybe you are not distributing the tlb file.
0
 
LVL 2

Author Comment

by:kristofer
ID: 6265369
I am, it's in the list, and furthermore the file (MSHTML.tlb) is allready on the win2k comp. I can run programs that uses it, just not ActiveX controls. If I turn it into a document dll, register it and run the vbp file it works fine!
0
 
LVL 7

Expert Comment

by:Inteqam
ID: 6265420
then, i think it is a licensing problem.
this is my 2 cents.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Expert Comment

by:WolfgangKoenig
ID: 6265452
Try the late binding, perhaps it will solve your problem.
(Because of typelib conflicts):
---------------------------------------------------------
Dim MyObject As Object
Set MyObject = CreateObject("MSHTML.HTMLxxx")

and so on ...

Hope this helps
WoK
0
 
LVL 7

Expert Comment

by:Inteqam
ID: 6265480
good idea
good luck :o)
0
 
LVL 2

Author Comment

by:kristofer
ID: 6268029
OK, Wolfgang. Could you please, or anyone explain that a little further. Say I want to load an html webpage from "webbrowser1" to htmlDoc1 where htmlDoc1 is an IHTMLDocument.

Normally, I'd just type:
dim htmlDoc as IHTMLDocument
set htmlDoc = webbrowser1.Document

thx
0
 
LVL 4

Expert Comment

by:WolfgangKoenig
ID: 6268425
First you must(can) remove the project reference to the
Microsoft HTML Object Library. Then do following:

dim htmlDoc as Object
set htmlDoc = CreateObject("MSHTML.IHTMLDocument")

Thats late binding (without a hard project reference to the HSHTML type lib).
Thats all.

Best regards
WoK
0
 
LVL 2

Author Comment

by:kristofer
ID: 6268564
Have you tried that code out? are the "" supposed to be there? when I try I get a run time error:

Run-time error '429':
ActiveX component can't create object

Ideas?
0
 
LVL 8

Expert Comment

by:Dave_Greene
ID: 6270892
It could be a problem with the setup wizard not correctly registering the mshtml.tlb...  could you post your setup.inf file here
0
 
LVL 4

Expert Comment

by:WolfgangKoenig
ID: 6272620
You are right ... I have the same problem
I think you can't do it so (regretfully) ...
and therefore you can't invoke
it through CreateObject("MSHTML.HTMLDocument").
I search the registry and find that the progid of MSHTML is
'htmlfile', therefore when you write:

Dim Myhtmldoc As Object
Set Myhtmldoc = CreateObject("htmlfile")

it should function. It provides an object of the type:
"HTMLDocument". Crazy at all ...

Hope this helps
WoK

0
 
LVL 2

Author Comment

by:kristofer
ID: 6272841
OK, that seems to work... Atleast I don't get an error msg... However I need a lot more than the HTMLDocument. I need the following...

HTMLWindow2
HTMLDocument
IHTMLDocument
IHTMLElementCollection
IHTMLElement
IHTMLInputFileElement
IHTMLInputTextElement
IHTMLInputButtonElement

I tried CreateObject("htmlfile.HTMLWindow2") etc. but that didn't work... how do I search the registry? complicated I guess...
0
 
LVL 2

Author Comment

by:kristofer
ID: 6272894
NO... that didn't work either. It worked on the win98 I developed it on, but not on the win2k's that my clients will use... I get "Object does not support this property or method".

increased points to 50 then doubled... any ideas?
0
 
LVL 4

Accepted Solution

by:
WolfgangKoenig earned 100 total points
ID: 6273815
The problem you have is the incompatiblity between
WIn98 and WIN2000 mshtml.tlb (+.dll).

tlb stands for type lib

Type libs are backward compatible! and thats the reason
whye you should recompile your control on the win2000
system.
Then i should function under WIN95 and WIN2000!!

This should helps and you don't need
late binding anymore ...

Nice day
WoK

0
 
LVL 8

Expert Comment

by:Dave_Greene
ID: 6273891
<<how do I search the registry?>>

Go to Start > Run ... type regedit hit Enter
0
 
LVL 2

Author Comment

by:kristofer
ID: 6297758
Took some time to install VB on the win2k, but it seems to be working fine now. thanks
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Change the path of the data source in my Excel pivot table with macro 4 54
passing a value with stream reader AFTER a ";" 3 83
vbModal 12 66
backup program with robocopy 6 71
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question