Global class and WithEvents

Hello!

I have a class which I needed to make global because it is used in/ on 
different forms, and the class opens and closes port handles, so I 
cannot simply make a few more copies of them.

However, on some of the forms, I would need a notification about events 
that the class handles.

Normally in my form I would dim the class and receive the events by 
RaiseEvent like this:

private withevents m_Class as Class1

But since the class is global, I cannot do this.

Does somebody have any ideas? I don't want to poll the class with a 
timer to query the event...

Thank you!
Alex
0
Alexandros
8/31/2010 7:25:15 PM
vb.general.discussion 1016 articles. 0 followers. Follow

16 Replies
1837 Views

Similar Articles

[PageSpeed] 24

Consider using a Standard Module. It is by default global in its' scope. As 
a Form object loads it can pass a reference to itself to the Module via 
Public Property. (The same Public Property can be used to set the reference 
to Nothing as the corresponding Form unloads.) By creating a Public Sub 
within a Forms' code module your Standard Module can communicate with the 
Form using it's Module-Level Form Variable. (i.e. Call mForm1.MySub().)

Spence


"Alexandros Peropulous" <peropero@gmail.com> wrote in message 
news:%23u7%23sJUSLHA.796@TK2MSFTNGP02.phx.gbl...
> Hello!
>
> I have a class which I needed to make global because it is used in/ on 
> different forms, and the class opens and closes port handles, so I cannot 
> simply make a few more copies of them.
>
> However, on some of the forms, I would need a notification about events 
> that the class handles.
>
> Normally in my form I would dim the class and receive the events by 
> RaiseEvent like this:
>
> private withevents m_Class as Class1
>
> But since the class is global, I cannot do this.
>
> Does somebody have any ideas? I don't want to poll the class with a timer 
> to query the event...
>
> Thank you!
> Alex 


0
Spence
8/31/2010 8:00:56 PM
"Alexandros Peropulous" <peropero@gmail.com> wrote

> I have a class which I needed to make global because it is used in/ on
> different forms, and the class opens and closes port handles, so I
> cannot simply make a few more copies of them.

Can you define global, a little better?  Every class module you add is
available to any other code module in the project.  You don't get more
global than that unless you are talking about access from different
programs, which you did not mention....


> Normally in my form I would dim the class and receive the events by
> RaiseEvent like this:
>
> private withevents m_Class as Class1
>
> But since the class is global, I cannot do this.


Why can't you do that?  That is exactly how you go about recieving
events from a class....

LFS


0
Larry
8/31/2010 9:20:29 PM
On Tue, 31 Aug 2010 21:25:15 +0200, Alexandros Peropulous
<peropero@gmail.com> wrote:

>Hello!
>
>I have a class which I needed to make global because it is used in/ on 
>different forms, and the class opens and closes port handles, so I 
>cannot simply make a few more copies of them.
>
>However, on some of the forms, I would need a notification about events 
>that the class handles.
>
>Normally in my form I would dim the class and receive the events by 
>RaiseEvent like this:
>
>private withevents m_Class as Class1
>
>But since the class is global, I cannot do this.
>

Why not?

Creat
0
ralph
8/31/2010 11:57:53 PM
"Larry Serflaten" <serflaten@gmail.com> wrote in message 
news:i5k7ja$e4p$1@news.eternal-september.org...

: Why can't you do that?  That is exactly how you go about recieving
: events from a class....

I'm getting the idea he has a cls file with events that he wants to use 
globally.  But since WithEvents won't work in a module and he doesn't have a 
central form, but rather several different ones depending on various 
criteria, he wants to be able to instance his class with the events for use 
from any form.

That said, the OP might want to review this gem from Karl's site: 
http://vb.mvps.org/samples/SyncEvts/ (Several ways to share events (timers, 
in this demo) amongst multiple objects)

- Kev


0
Kevin
9/1/2010 1:29:14 AM
On 01/09/2010 00:57, ralph wrote:
> On Tue, 31 Aug 2010 21:25:15 +0200, Alexandros Peropulous
> <peropero@gmail.com>  wrote:
>
>> Hello!
>>
>> I have a class which I needed to make global because it is used in/ on
>> different forms, and the class opens and closes port handles, so I
>> cannot simply make a few more copies of them.
>>
>> However, on some of the forms, I would need a notification about events
>> that the class handles.
>>
>> Normally in my form I would dim the class and receive the events by
>> RaiseEvent like this:
>>
>> private withevents m_Class as Class1
>>
>> But since the class is global, I cannot do this.
>>
>
> Why not?

If the object is "Global" in a COM server then I don't think there is an 
explicit instance that you can assign to a variable.

I assume they mean the Global where you can access the members without 
declaring an object, just like the VB and VBA objects.

This can be worked around byt only using a single explicit reference as 
others have suggested.

-- 
Dee Earley (dee.earley@icode.co.uk)
i-Catcher Development Team

iCode Systems

(Replies direct to my email address will be ignored.
Please reply to the group.)
0
Dee
9/2/2010 10:26:06 AM
I want to instantiate the class only ONCE, therefore I declare it in a 
module

Now here is all my code:

Module1:
--------------------------------------
Option Explicit

Public g As Class1

Public Sub Main()

     Set g = New Class1

     Form1.Show
     Form2.Show
     Form3.Show

End Sub
--------------------------------------

Class1:

Option Explicit

Public Event NewMessage(ByVal uString As String)

Public Sub SendGlobalMessage(ByVal u As String)

     RaiseEvent NewMessage(u)

End Sub
--------------------------------------
Form1:

Option Explicit

Private Sub Command1_Click()

     g.SendGlobalMessage Me.Text1.Text

     'I want form2 and form3 to get that event.
     'But I don't want to do this with a timer

End Sub

Private Sub Form_Load()

End Sub
--------------------------------------
Form2:

Option Explicit

Private WithEvents m As Class1

Private Sub m_NewMessage(ByVal uString As String)

     Me.Caption = uString

End Sub
--------------------------------------
Form3:

Option Explicit

Private WithEvents m As Class1

Private Sub m_NewMessage(ByVal uString As String)

     Me.Caption = uString

End Sub

0
Alexandros
9/2/2010 11:20:38 AM
"Alexandros Peropulous" <peropero@gmail.com> schrieb im Newsbeitrag
news:%23aXSPEpSLHA.5572@TK2MSFTNGP02.phx.gbl...

> I want to instantiate the class only ONCE, therefore
> I declare it in a module

Nothing wrong with that - and you've done that
already in Sub Main with:
Set g = New Class1

> Private Sub Command1_Click()
>
>      g.SendGlobalMessage Me.Text1.Text
>
>      'I want form2 and form3 to get that event.
>      'But I don't want to do this with a timer

No problem, just add a single Line:
Set m = g

into your Form_Load() routines of Form2 and Form3
and you're done.

The line: Set m = g  does not create an instance -
it just sets an additional Reference-Variable 'm'
to the instance which is also *pointed-to* by the
globally reachable Reference-Variable 'g'.

Maybe to make that a little bit more clear, a VB-
Object-Instance (created either per 'New' or
per 'CreateObject') is thereby allocated on the
Process-Heap and available/accessable
throughout the whole VB-Process/Thread.

You can manage the accessibility of this
always "globally available by principle"
Object-Instance over the scope your
Object-*Variables* (which are only Pointers
to this Instance).

So, in other words, if you decide to *create*
a new Instance in the "least hidden Private-Class",
but then manage, to pass the referencing Variable of
this "alleged privately created Instance"  (by Parameter
in an Event or however) to a globally defined
VB-Object-Variable of the same (Class-)Type,
then this is in no way different from what you
currently do (creating the instance in Sub Main) -
so it does not matter *where* you create the instance -
accessibility of the instance is only determined by one
(or the other) current Variable which points to it -
and this current Variables scope.

Olaf


0
Schmidt
9/2/2010 12:00:04 PM
"Alexandros Peropulous" <peropero@gmail.com> wrote
> I want to instantiate the class only ONCE, therefore I declare it in a
> module

Then you need to be sure the New command is only executed ONCE.

> Option Explicit
>
> Public g As Class1
>
> Public Sub Main()
>
>      Set g = New Class1
>
>      Form1.Show
>      Form2.Show
>      Form3.Show
>
> End Sub

That should do it!  At that point you have one instance each of
Class1, Form1, Form2, and Form3.

To begin listening for messages, you need to get access to that
one global instance:


> --------------------------------------
> Form2:
>
> Option Explicit
>
> Private WithEvents m As Class1
>
> Private Sub m_NewMessage(ByVal uString As String)
>
>      Me.Caption = uString
>
> End Sub

In forms 2 and 3, you need that WithEvents declaration AND
a live instance of Class1.  To get the live instance, add:

Private Sub Form_Load()
    Set m = g
End Sub

That does not create a new instance, it makes m and g point to
the very same object, which is what you want to happen.  Including
the same in form 3, you end up with 3 (Class1 type) variables all
pointing to the same (Class1 type) object.

Then, to follow 'best practices' guidelines, you'd want to release
all of your objects when you are done with them:

Private Sub Form_Unload(Cancel As Integer)
    Set m = Nothing    ' < Forms 2 & 3

    If Forms.Count = 1 Then   ' < All forms
        Set g = Nothing
    End if
End Sub


HTH
LFS



0
Larry
9/2/2010 1:49:21 PM
On Thu, 02 Sep 2010 11:26:06 +0100, Dee Earley
<dee.earley@icode.co.uk> wrote:

>On 01/09/2010 00:57, ralph wrote:
>> On Tue, 31 Aug 2010 21:25:15 +0200, Alexandros Peropulous
>> <peropero@gmail.com>  wrote:
>>
>>> Hello!
>>>
>>> I have a class which I needed to make global because it is used in/ on
>>> different forms, and the class opens and closes port handles, so I
>>> cannot simply make a few more copies of them.
>>>
>>> However, on some of the forms, I would need a notification about events
>>> that the class handles.
>>>
>>> Normally in my form I would dim the class and receive the events by
>>> RaiseEvent like this:
>>>
>>> private withevents m_Class as Class1
>>>
>>> But since the class is global, I cannot do this.
>>>
>>
>> Why not?
>
>If the object is "Global" in a COM server then I don't think there is an 
>explicit instance that you can assign to a variable.
>
>I assume they mean the Global where you can access the members without 
>declaring an object, just like the VB and VBA objects.
>
>This can be worked around byt only using a single explicit reference as 
>others have suggested.

Are you talking about "late binding"???

I can't see where the OP suggested he was using late-binding or an
external component. 

-ralph
0
ralph
9/2/2010 2:16:35 PM
On 02/09/2010 15:16, ralph wrote:
> On Thu, 02 Sep 2010 11:26:06 +0100, Dee Earley
> <dee.earley@icode.co.uk>  wrote:
>
>> On 01/09/2010 00:57, ralph wrote:
>>> On Tue, 31 Aug 2010 21:25:15 +0200, Alexandros Peropulous
>>> <peropero@gmail.com>   wrote:
>>>
>>>> Hello!
>>>>
>>>> I have a class which I needed to make global because it is used in/ on
>>>> different forms, and the class opens and closes port handles, so I
>>>> cannot simply make a few more copies of them.
>>>>
>>>> However, on some of the forms, I would need a notification about events
>>>> that the class handles.
>>>>
>>>> Normally in my form I would dim the class and receive the events by
>>>> RaiseEvent like this:
>>>>
>>>> private withevents m_Class as Class1
>>>>
>>>> But since the class is global, I cannot do this.
>>>
>>> Why not?
>>
>> If the object is "Global" in a COM server then I don't think there is an
>> explicit instance that you can assign to a variable.
>>
>> I assume they mean the Global where you can access the members without
>> declaring an object, just like the VB and VBA objects.
>>
>> This can be worked around byt only using a single explicit reference as
>> others have suggested.
>
> Are you talking about "late binding"???

No, I never mentioned any form of binding.

> I can't see where the OP suggested he was using late-binding or an
> external component.

One of their previous posts was an OOP COM server hosting the Comm32 
control.
One of the instancing modes in a COM server is GlobalMultiuse.
I believe this is the "global" they are referring to.

-- 
Dee Earley (dee.earley@icode.co.uk)
i-Catcher Development Team

iCode Systems

(Replies direct to my email address will be ignored.
Please reply to the group.)
0
Dee
9/2/2010 3:39:48 PM
On Thu, 02 Sep 2010 16:39:48 +0100, Dee Earley
<dee.earley@icode.co.uk> wrote:


>
>> I can't see where the OP suggested he was using late-binding or an
>> external component.
>
>One of their previous posts was an OOP COM server hosting the Comm32 
>control.
>One of the instancing modes in a COM server is GlobalMultiuse.
>I believe this is the "global" they are referring to.

Still it wouldn't make any difference.

    Private WithEvents m_Class As Class1
    Set m_Class = globalInstanceOfClass1

is how it is done.

*unless "globalInstanceOfClass1" is an Object Reference to a type
Object and not of type Class1. But I doubt this is the case since the
OP was apparently able to implement an Class1.IConnection~ interface
before deciding to go "global".

But this is so obvious, I must be missing something. <g>

-ralph
0
ralph
9/2/2010 5:21:24 PM
"Dee Earley" <dee.earley@icode.co.uk> wrote
> One of their previous posts was an OOP COM server hosting the Comm32
> control.
> One of the instancing modes in a COM server is GlobalMultiuse.
> I believe this is the "global" they are referring to.

See the post from 09/02/2010.  Global simply meant application wide,
declared public in a standard module....

LFS



0
Larry
9/2/2010 5:21:42 PM
Jesus, thanks a lot!!
0
Alexandros
9/2/2010 7:10:36 PM
Let that be a lesson to ya...   :-)


"Alexandros Peropulous" <peropero@gmail.com> wrote in message 
news:OMHo2KtSLHA.2100@TK2MSFTNGP04.phx.gbl...
> Jesus, thanks a lot!! 


0
Spence
9/3/2010 1:08:57 AM
On 02/09/2010 18:21, ralph wrote:
> On Thu, 02 Sep 2010 16:39:48 +0100, Dee Earley
> <dee.earley@icode.co.uk>  wrote:
>
>
>>
>>> I can't see where the OP suggested he was using late-binding or an
>>> external component.
>>
>> One of their previous posts was an OOP COM server hosting the Comm32
>> control.
>> One of the instancing modes in a COM server is GlobalMultiuse.
>> I believe this is the "global" they are referring to.
>
> Still it wouldn't make any difference.
>
>      Private WithEvents m_Class As Class1
>      Set m_Class = globalInstanceOfClass1
>
> is how it is done.
>
> *unless "globalInstanceOfClass1" is an Object Reference to a type
> Object and not of type Class1. But I doubt this is the case since the
> OP was apparently able to implement an Class1.IConnection~ interface
> before deciding to go "global".
>
> But this is so obvious, I must be missing something.<g>

I don't think Global (in COM instancing) gives you access to a single 
instance to assign as you will.

As it has already been determined to be a single global variable, this 
is all moot now though :)

-- 
Dee Earley (dee.earley@icode.co.uk)
i-Catcher Development Team

iCode Systems

(Replies direct to my email address will be ignored.
Please reply to the group.)
0
Dee
9/6/2010 7:54:00 AM
On 06/09/2010 08:54, Dee Earley wrote:
> On 02/09/2010 18:21, ralph wrote:
>> But this is so obvious, I must be missing something.<g>
>
> I don't think Global (in COM instancing) gives you access to a single
> instance to assign as you will.

Having said that, this works:
Dim X As VB.Global

   Set X = VB.Global
   MsgBox X.Forms.Count

Oh well :)

-- 
Dee Earley (dee.earley@icode.co.uk)
i-Catcher Development Team

iCode Systems

(Replies direct to my email address will be ignored.
Please reply to the group.)
0
Dee
9/6/2010 7:56:35 AM
Reply:

Similar Artilces:

Exchange cant pick out DC server as a Global Catalog
Hi Guys, Can anyone help me out on this. I just installed a new Domain Controller for my domain and made it a Global Catalog Server.Using replmon under server flag, its status is a GC. But when I tried viewing from My Exchange Server under directory Access the server didnt appear under Global Catalog Servers.I need Exchange to see this as a GC coz I want to shut down and primary GC to test this backup GC. Any way out? Thanks for your response. -- Buchi On Sat, 13 Aug 2005 08:19:05 -0700, "Buchi" <Buchi@discussions.microsoft.com> wrote: >Hi Guys, >Can anyone help...

Error 1004 Method 'Range' of object 'Global' failed
Hi I am being plagued by a problem which I cannot resolve, so I turn to the Repository Of All Knowledge..... I have a procedure in a VB application (not within Excel, but an application I've created myself). It contains the following code: Dim xl As Excel.Application Dim wb As Excel.Workbook Dim ws As Excel.Worksheet Dim rng As Excel.Range Dim x As Integer Set xl = New Excel.Application xl.Visible = True Set wb = xl.Workbooks.Add Set ws = wb.Worksheets(1) Set rng = ws.Range("A1") For x = wb.Worksheets.Count To 2 Step -1 wb.Worksheets(x).Delete Next x For Each fld In r...

remove containers from the global address book
question: doese anyone know how i can remove specific containers and their contents from the global address list so my users dont have the option to view them within outlook?? I am running exchange 5.5 (clients use outlook 2k) Any help appreciated ...

associating a custom class to a resource
Let's say you have your own collection of customized common controls, all derived from the original ones. So, CustomEdit derived from CEdit, CustomButton derived from CButton, etc. Now, let's say you only provide clients with the headers of your classes, a lib file and a DLL containing the implementation. When creating an edit box in the resource editor, how can you associate it with CustomEdit instead of CEdit? The only way I am able to do this right now is to first associate it with CEdit, and then go make the change in the code to CustomEdit. In other words, I can't see the Cu...

global variable in MFC Regular DLL -pls urgent
Hi, I created a MFC Regular DLL and declare a variable int __declspec( dllexport ) g_iVar= 4; When i try to access these variable inthe application by importing g_iVar i am getting the value of g_iVar as 0 not 4. And i try to set the g_iVar to 10 in the application and try to access the value inside dll exported function i am getting it a 4 and not 10. Please help me out. Reny hi, Try setting the value of the g_iVar in the InitInstance() of the Dll and then use it. As far as the second case wherein you set the value of the g_iVar to 10 but the exported function of the dll reading i...

serialisation of classes to generate XMLDocument
I need to generate input XML for another application by serialising classes defined in an XSD document. The code below will generate the XML I require but I need to generate this in memory rather than creating a file. I assume I should be using System.IO.MemoryStream but can't get this to work. ' XML will be serialized to file.xml, in UTF-8, with BOM. Dim tw As New System.Xml.XmlTextWriter( _ New System.IO.FileStream("file.xml", System.IO.FileMode.Create), _ New System.Text.UTF8Encoding(True)) ser.Serialize(tw, domainObj...

Global Address List- how to restrict
I have my main domain say school.edu and set up a sub domain called students.school.edu with another 2003 Exchange server for training only. My question's are; I can see the global address list in this sub domain (the 2nd sub domain student exchange server) and DO NOT want students to see that. What can I do there? The other question is I see where I can restrict so users can only receive from certain users but can I make it so they can only send to certain users or groups? I would not want the 2nd exch server to send but to only ones in the student group. I need this setup ri...

runtime error class not registered
When I open Outlook 2003 I get an error message "A Runtime Error has occurred, do you wish to debug? Line 297 Error: Class not Registered." I upgraded from Office 2000. I have Norton @005 on my computer and never received this message before. ...

AfxBeginThread, Thread Pool and Runtime Class
I am trying to change an ISAPI Extension so it uses Thread Pooling. I've downloaded the sample from Microsoft and able to get it running. The problem I am encountering has to do with the AfxBeginThread function and a Runtime Class. I don't know how to let the class know how to pass any parameters through the UI thread. The unconverted ISAPI Extension uses this call: CClientSession* pWinThread = (CClientSession*)AfxBeginThread(RUNTIME_CLASS(CClientSession)); Whereas the sample uses: CWinThread* pWinThread = AfxBeginThread((AFX_THREADPROC)ThreadProc, m_hIoPort); Note the MS Example...

MS Project Professional 2003 Global.mpt
Hello Everyone, I loaded Project Professional 2003 on my desktop. Project Server 2003 is not online as yet. When I try to open a file (old or new)I receive the message "Could not open Global.MPT file. I have tried everything and I cannot get it to work. Does anyone have a solution? Thanks, Daryl I think you're in the wrong newsgroup >-----Original Message----- >Hello Everyone, >I loaded Project Professional 2003 on my desktop. Project >Server 2003 is not online as yet. When I try to open a >file (old or new)I receive the message "Could not open ...

Moving subclasses to different classes
I'm having trouble figuring out how to move subclasses to different classes (to re-assign budget categories to differnt umbrella budget areas). I see a "MOVE" button at the bottom of the list of Classes but can't figure out how to make it active. Anyone know the secret to moving classes without deleting them, recreating them under a new high level class, and re-assigning the transactions? Thanks in Advance!! Never mind -- you just delete the class and ask it to reassign things to a new subclass bucket. PRODUCT WISHLIST: Have the "MOVE" button active...

calling protected method by another class
Hello, I do not understand one thing. Method CView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint); is protected and in spite of that it is called by CDocument. How is that possible? Can you please explain? Vaclav "Vaclav" <vjedlicka@atlas.cz> ha scritto nel messaggio news:uQdS%23MV$HHA.3400@TK2MSFTNGP03.phx.gbl... > Hello, > > I do not understand one thing. > > Method > > CView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint); > > is protected and in spite of that it is called by CDocument. How is that > possible? >...

email address not updating in global list
We have a single Exchnage 2003 server. An exchnage enabled user account was created with the wrong spelling. I went to ADUC and right clicked on the object and renamed it. I then when into the properties and changed the spelling everywhere I could find it. I can manually send an email to the correct address, but When I go to Outlook 2003 and look inthe global list, the incorrect spelling is there. I made this correction over a week ago. I then went to Exchnage System Manager, and fond the Default Offline Address list and right clicked on the object and selected rebuild. But it s...

Making contacts appear in the global address list
Hi, I have SBS Pro including exchange 2003. I cannot figure out why I cannot get Contacts to appear in my global address list. I have a number of email addresses that would be really useful to everyone in the organisation (Courier email address etc). I have set up all of these addresses as Contacts in Active Directory under MYSERVER.local - Contacts - . I have also checked the filter for my Global Address List and it should include contacts. However none of these contacts will show. I have been struggling with this for some time now so the server has had plenty of time to replicate the chang...

How to shrink UML Class diagram?
Hi, I just want to print a UML diagram with class names only. How to shrink the Class box to just one row containing only the class name? thanks, -Kay ...

how to globally change souce data on plot
I have a x-y scatter chart with about 40 individual lines originating from individual spreadsheet tab for each line. I need to clone this chart multiple times, changing only the column references for the x and y parameters. To accomplish this I currently go to "chart," "source data" and manually change the x and y references for each line. Is there a way to globally change the cell references for all line on the chart? This web page describes a technique to change series formulas en masse: http://peltiertech.com/Excel/Charts/ChgSrsFmla.html It provides a link t...

Global Address List Formatting
Is the window that comes up when reviewing the Global Address List, or the Select Names window that comes up when composing an e-mail message, an Outlook Form or Exchange Form? If so, can it be changed so that the Company Field comes directly after the Name field, as opposed to the Business Phone, which is the default? If it can be, can you direct me to the Steps for making those changes? You can use details templates to customize the appearance of the dialog boxes that appear when a user requests to see receipient properties in address lists. You can modify these settings from Exchan...

UML Class Diagram in Visio
Hello, I am trying to use Visio to work on a UML Class Diagram for a Squeak project. I am trying to figure out how to hide the visibility icons (+, -, etc) from the predefined Class object. Also, where the methods are, I need to get rid of the () (method call parens) that are automatically appended to the methods. This is because private/public is not really relevant in Squeak, and methods (or messages) don't have parens. Any help is greatly appreciated, -- Jason Whitehurst Unfortunately, there is no way to hide the visibility icons and the () in the Operations section. -- -ronn...

How to make a CEdit class unmodifiable
How do you make a CEdit unmodifiable by the user? I am using a multiline CEdit control for a remote console application and I need to display output on this window. However I do not want the user to be able to type within the output box. If I disable the control, the text gets grayed out and is hard to read,the user cannot select the text to copy, or scroll through its contents. So how do I get the CEdit to just allow the user to select and copy the text, without modifying it in anyway? Nick "Nick Schultz" <nick.schultz@flir.com> wrote in message news:%23EtIIFO7I...

creating a light-weight CWnd-derived class
I would like to create a very light-weight, standalone, non-visible, NULL-parented CWnd-derived class, without relying on any resource created in ..rc file (like CDialog which requires a dialog template). This light-weight class is used as a private message and timer handler, with a HWND which can be passed to, in my case, DirectShow API for event notifications; and in general use, I can instantiate such class in anywhere and in any UI-thread with ease. I did consider deriving from CStatic, as the class is simple and small enough. However, it requires a parent CWnd, i.e. it cannot be a...

Serializing a collection class
Hi, is it possible to serialize a top-level class with a collection of items? For example, is this possible: <ParkingLot ...> <ParkedCar><Make>Ford</Make></ParkedCar> <ParkedMotorcycle><Make>Honda</Make></ParkedMotorcycle> <ParkedCar><Make>Hyondai</Make></ParkedCar> <ParkedCar><Make>Volvo</Make></ParkedCar> .... lots of other cars and motorcycles ... </ParkingLot> I know it is possible to serialize a known number of vehicles, with a class like this: public class ParkingLot { ...

how do i access my outlook express for my online class
Please assist me, I'm taking a college course that uses, FLexnet and I am required to log on to outlook express. Please advise, I need to post home work and check in. Crystal "outlook express to access flex net" <outlook express to access flex net@discussions.microsoft.com> wrote in message news:4271352C-9C4C-4593-A63D-6D2F33026E30@microsoft.com... > Please assist me, I'm taking a college course that uses, FLexnet and I > am > required to log on to outlook express. Please advise, I need to post > home > work and check in. Ask in a newsgroup for...

Rename the Global Address List (GAL)
Is it possible to rename the Global Address List? If so, how? Greg On Thu, 9 Dec 2004 08:13:04 -0800, "Greg" <Greg@discussions.microsoft.com> wrote: >Is it possible to rename the Global Address List? If so, how? > >Greg I don't believe you can rename what appears in the Outlook Client as "Global Address List" ...

Global address book lastname, firstname.
In the global address book how can I make it display firstname then lastname instead of the other way around. I am using exchange 5.5 ...

How to call function of Dialog box from custom tree control class?
Hi to all, I am creating a dialog based apllication in MFC. In which I have created my own Tree class derived from CTreeCtrl which shows all the image files and folders(.bmp,.jpg etc). Now my problem is when user selects the file from tree ctrl that image should be displayed in the dialog box. I tried to call the function of dialog box's ShowImages(CString strPath) from tree controls OnSelectionChanged event handler function but it fails for assertion at the time of CClientDC dc(this); this function. Tree is in the same dialog where i want show the Images. P...