Solved

Problems with ActiveX control

Posted on 2001-07-09
15
857 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
  • 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
 
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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

705 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now