Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Mystery Class Module purpose?

Posted on 2006-07-24
6
Medium Priority
?
589 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 2000 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
Independent Software Vendors: 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
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…
Suggested Courses

636 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