Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
How to selfdestroy a class with references on forms
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Dieter Peters  
View profile  
 More options Apr 11 2000, 3:00 am
Newsgroups: microsoft.public.vb.enterprise
From: "Dieter Peters" <p...@rgu.de>
Date: 2000/04/11
Subject: How to selfdestroy a class with references on forms
I have a "little" problem with references in a class.

The situation:  A DLL project with one class and one form

The DLL has a public function ShowList e.g. it reads a file and displays a
result in a listview in a form.
I can't kill the form because I need it for later use. Sometimes I need more
than one list (form).
At this point I have to kill the class by a button_click in a form. The
problem is, that some
references of the forms (no controls) remain in the class. That means the
class never runs
through the Terminate and never frees the allocated memory (not the
complete).

So my question is if anybody solved problems like this?
Is my solution wrong, or do I need some mysterious api-functions?
What is the "right" way, if there is any?

Dieter


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Zima  
View profile  
 More options Apr 11 2000, 3:00 am
Newsgroups: microsoft.public.vb.enterprise
From: "Zima" <zimow...@NOSPAMexecpc.com>
Date: 2000/04/11
Subject: Re: How to selfdestroy a class with references on forms
Couple more things to clarify previous post (I didn't realize it might not
be obvious). In class constructor you want to setup m_frmWhatever to hold
the pointer to your form. You can do this like this:

Private Sub Class_Initialize()
    Load MyForm
    set m_frmWhatever = MyForm
End Sub

I'm assuming it's obvious m_frmWhatever is defined as private member at the
class scope like this:

Private m_frmWhatever As Form

Also, I'm assuming you've got your own implementations to display the form,
something like this:

Public Sub ShowMyForm()
    m_frmWhatever.Show
End Sub

Finally, I had a little typo with the pointer assignment from class object
to client level var. Don't use parantheses to pass property as I had it.

' TYPO: Set frmDLLForm = oObj.FormList()

use it like this:

Set frmDLLForm = oObj.FormList

That should do it.
Bye now.

"Dieter Peters" <p...@rgu.de> wrote in message

news:e1TaxB7o$GA.219@cppssbbsa02.microsoft.com...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dieter Peters  
View profile  
 More options Apr 12 2000, 3:00 am
Newsgroups: microsoft.public.vb.enterprise
From: "Dieter Peters" <p...@rgu.de>
Date: 2000/04/12
Subject: Re: How to selfdestroy a class with references on forms

Zima <zimow...@NOSPAMexecpc.com> schrieb in im Newsbeitrag:
O2$QkL8o$GA.255@cppssbbsa04...

Ok, I see... but I forgot to show the whole problem (depends on my English).
Let me try to explain again:
I have a project (ActiveX-DLL), one form, one class.
Then I need to have several instances of e.g. Form1  (in Class1: set
oForm(Index) = Form1)
Then each instanced form needs a reference to Class1 (in Form1: Public
cParent = Class1) because they use subs and functions in Class1.
The problem occurs when closing (unload) the forms and leaving Class1. I
think the problem depends on crossreferencing form and class. And this is
the (a) real problem...

Dieter


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »