Solved

Mystery Class Module purpose?

Posted on 2006-07-24
6
586 Views
Last Modified: 2008-02-01
I have a VB6 application that is several years old, and has been running fine. I had a subcontract coder help me with the coding years ago.

Now, I am editing the code, and find (what I think is) a Class Module, named Application (saved as Application.cls). I do not understand its purpose or operation. I can comment out the code, and the application seems to still run fine, but, if I remove the cls module, I get an error:

"No creatable public component detected. Press F1 for more information."

The VB6 help then says "ActiveX EXE, ActiveX DLL, and ActiveX Control project types require that you have a least one public creatable class module."

The code in Application.cls looks like this:

***********************************
Option Explicit
Private frm As New frmMain
Public hWnd As Long

Private Sub Class_Initialize()
'    frm.Show
    hWnd = frmMain.hWnd
End Sub


Private Sub Class_Terminate()
'    Unload frm
'    Set frm = Nothing
End Sub
***********************************

What does this code do, and how is it invoked?
0
Comment
Question by:lee88
[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
  • 3
  • 3
6 Comments
 

Author Comment

by:lee88
ID: 17167065
I just noticed that the project type is set as "ActiveX EXE" instead of "Standard EXE". This application runs as a desktop application. What does "ActiveX EXE" project type mean?
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 17167079
ActiveX Exe means that the application can run standalone AND also can be initiated by external applications (like MS Excel, Word etc).

The error means that all your classes are "Private" resp "PublicNotCreatable"
0
 

Author Comment

by:lee88
ID: 17167130
angelIII, thanks for the answer. What does "resp" mean?
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 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17167150
respectively
0
 

Author Comment

by:lee88
ID: 17167389
Thanks again for the answer. (The light bulb finally turns on).  I do have a second application (also written by my subcontract coder years ago) that creates an instance of the first application:

Private modObjKB As Object
Set modObjKB = CreateObject("KioskBrowser.Application")

So, having the first app's type as "ActiveX EXE" and having the Application.cls Class Module, shown above, allows the second app to create an instance of the first app. Correct?

Last question: Does the ".Application" portion of the "KioskBrowser.Application" argument in the CreateObject function refer specifically to the name of the class module, "Application.cls", or is the word "Application" special or intrinsic to VB? ("Application" sounds like a Keyword).

Your help is very much appreciated!


0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17167456
>So, having the first app's type as "ActiveX EXE" and having the Application.cls Class Module, shown above, allows the second app to create an instance of the first app. Correct?
yes.

>Last question: Does the ".Application" portion of the "KioskBrowser.Application" argument in the CreateObject function refer specifically to the name of the class module, "Application.cls", or is the word "Application" special or intrinsic to VB? ("Application" sounds like a Keyword).
Yes.

0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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 process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

730 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