Solved

Mystery Class Module purpose?

Posted on 2006-07-24
6
587 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
Technology Partners: 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

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
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…

690 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