ActiveX Docs Solution 
Author Message
 ActiveX Docs Solution

Dear fellow programmers:

I would like to extend my most sincerest apologies for having sent you
a message regarding the above subject.  I have had some immensely
difficult personal times these last few days and for a moment, I wasn't
thinking straight.

I have been looking for answers on the above since October,1999 and I
have exhausted a lot of time and energy trying to solve the problem.
And what I failed to realize (until this morning), is that all of you
have been doing so as well.

Well, anyway.  I want to make up for my mistake by providing you with a
simple API call that will remove the offending SubKey in your registry
that is preventing your ActiveX applications from "installing and

ActiveX documents should still be compiled with "Binary Compatibility"
and the security settings on IE should be dropped to "Low" to allow the
ActiveX app to install.  You should also select "Internet Package" in
the Package and Deployment Wizard if you want to reduce your .CAB files
from Megabytes in size down to Kilobytes in size.

Copy and paste this code into the Declarations section of a module
inside of a new "Standard EXE" project.  Run this API call however you
wish.  I have designed a tiny standard EXE project that my customers
will install and run only once -- PRIOR to installing my ActiveX
Documents applications.


Public Const HKEY_CLASSES_ROOT = &H80000000

Declare Function RegDeleteKey& Lib "advapi32.dll" Alias _
      "RegDeleteKeyA" (ByVal hKey As Long _
                     , ByVal lpSubKey As String)


Private Sub OptimizeBtn_Click()

   On Error Resume Next

   Screen.MousePointer = 11

   Dim KeyDeleted As Long

   ' get rid of the .VBD entry in the Registry
   ' (it will invoke the "Open/Save" dialog otherwise
   KeyDeleted = RegDeleteKey(HKEY_CLASSES_ROOT, ".vbd")

   Screen.MousePointer = 1

   MsgBox "Your computer is now ready to have web applications " _
         & "installed on it.", vbInformation, App.Title

   Unload Me


End Sub

I also suggest that you avoid any code whatsoever in the "Initialize"
event of your user documents.  Use the "Show" event instead.

Some people have experienced problems trying the "end" their apps.  I
suggest you consider "navigating" to a static .HTML file or .ASP page
that tells the user that they have exited the program.

Also, in order to properly implement the above API routine, I suggest
beginning your application using a simple .HTML page or ASP that acts
as a common entry point to your program.  On this HTML page, you could
have 1 button that launches the .API application above.  The 2nd button
could then run the ActiveX application itself, afterwards.

A nifty trick you can use also is a set of frames to HOST your ActiveX
application.  For example, consider a frame along the left side of your
screen.  It could be used as a static MENU for your application
allowing the user to load any .VBD file into another frame.

As for application state, you might also consider writing a global
handler that accepts the name of the .VBD file as a parameter.  You can
then use that as you will to decide on your coding needs.

One last thing, I use the "Internet Transfer Control" in my
application.  Because I need to use FTP to load new files onto my
client's machines from my website, I needed a global routine to call to
format the FTP call properly.  HERE's a tip:
ActiveX Documents do not support the "Me" Keyword.  Instead, pass to
your custom FTP sub procedure a parameter that accepts the name of the
Internet Control as a parameter.  Funny enough, there is NO error and
it works for the calling .VBD file.

Public Sub FileFTP(ByVal FTPMethod As String _
                 , ByVal File1 As String _
                 , ByVal File2 As String _
                 , ByVal InetCtrl As Control)

   InetCtrl.AccessType = icDirect
   InetCtrl.Protocol = icFTP
   InetCtrl.Execute FTP_Connect _
         , FTPMethod & " " & File1 & " " & File2

End Sub

Anyway, once again everyone, I sincerely apologize for my last
message.  Take this code and use it.  I have other suggestions on
coding practices as well as other very useful coding routines.  Feel
free to get ahold of me if you have any specific questions.


John D. Bradley
OffBeat Software Inc.

Sent via http://www.*-*-*.com/
Before you buy.

Sat, 06 Jul 2002 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. ActiveX Docs Solution

2. ActiveX Docs Solution

3. ActiveX Docs Solution

4. My solution to writing to Word Docs

5. How to create ActiveX Docs in .NET?

6. Shape,Line,DHTML,ActiveX Docs

7. ADO and ActiveX Docs not working

8. Deploying ActiveX Docs SOLVED!!!!!

9. Why Does IE4 Load ActiveX Docs Twice?

10. Activex Docs - Multiple IE

11. ActiveX Docs and IE4

12. ADO and ActiveX Docs not working


Powered by phpBB® Forum Software