标题:适配器模式(集合变堆栈)
取消只看楼主
ioriliao
Rank: 7Rank: 7Rank: 7
来 自:广东
等 级:贵宾
威 望:32
帖 子:2829
专家分:647
注 册:2006-11-30
结帖率:78.95%
 问题点数:0 回复次数:21 
适配器模式(集合变堆栈)
程序代码:

'''Stack.cls
Public Function Peeking() As Variant
    
End Function

Public Function Poping() As Variant
       
End Function

Public Sub Puting(ByVal S As Variant)
    
End Sub


Public Sub Dispose()

 
End Sub




程序代码:

'''IntStack.cls

Implements Stack

Private StackArr As New Collection



Private Sub Stack_Dispose()

 Set StackArr = Nothing
End Sub

Private Function Stack_Peeking() As Variant
    If StackArr.Count > 0 Then
       Stack_Peeking = StackArr.Count
    End If
End Function

Private Function Stack_Poping() As Variant
       Stack_Poping = CInt(StackArr.Item(StackArr.Count))
       StackArr.Remove (StackArr.Count)
End Function

Private Sub Stack_Puting(ByVal S As Variant)
       StackArr.Add CInt((S))
End Sub





程序代码:

'''StrStack.cls

Implements Stack

Private StackArr As New Collection



Private Sub Stack_Dispose()

 Set StackArr = Nothing
End Sub

Private Function Stack_Peeking() As Variant
    If StackArr.Count > 0 Then
       Stack_Peeking = StackArr.Count
    End If
End Function

Private Function Stack_Poping() As Variant
       Stack_Poping = CStr(StackArr.Item(StackArr.Count))
       StackArr.Remove (StackArr.Count)
End Function

Private Sub Stack_Puting(ByVal S As Variant)
       StackArr.Add CStr((S))
End Sub





程序代码:
Private Sub Form_Click()

Dim S1 As Stack
Set S1 = New IntStack

S1.Puting (3)
S1.Puting (2)
S1.Puting (6)


Debug.Print S1.Poping
Debug.Print S1.Poping

Debug.Print S1.Peeking

S1.Dispose

Set S1 = New StrStack

S1.Puting ("XXX")
S1.Puting ("YYY")
S1.Puting ("ZZZ")

Debug.Print S1.Poping
Debug.Print S1.Poping
Debug.Print S1.Poping


End Sub

搜索更多相关主题的帖子: 堆栈 Stack Sub Function End 
2008-03-02 21:28
ioriliao
Rank: 7Rank: 7Rank: 7
来 自:广东
等 级:贵宾
威 望:32
帖 子:2829
专家分:647
注 册:2006-11-30
得分:0 
做成ActiveX.exe类型.
能否看看你怎么的代码?
没有具体的需求我也很难给建义老兄你.

/images/2011/147787/2011051411021524.jpg" border="0" />
2008-03-03 11:30
ioriliao
Rank: 7Rank: 7Rank: 7
来 自:广东
等 级:贵宾
威 望:32
帖 子:2829
专家分:647
注 册:2006-11-30
得分:0 
ioriliao@
老兄也找找vb相关的ActiveX.exe的资料吧...
我很久没弄这个了...还记得点点.

/images/2011/147787/2011051411021524.jpg" border="0" />
2008-03-03 12:01
ioriliao
Rank: 7Rank: 7Rank: 7
来 自:广东
等 级:贵宾
威 望:32
帖 子:2829
专家分:647
注 册:2006-11-30
得分:0 
已收到邮件.
ActiveX.exe是在另一个进程空间的.

/images/2011/147787/2011051411021524.jpg" border="0" />
2008-03-03 12:44
ioriliao
Rank: 7Rank: 7Rank: 7
来 自:广东
等 级:贵宾
威 望:32
帖 子:2829
专家分:647
注 册:2006-11-30
得分:0 
请问哪部分代码是不停的处理的?

/images/2011/147787/2011051411021524.jpg" border="0" />
2008-03-03 12:47
ioriliao
Rank: 7Rank: 7Rank: 7
来 自:广东
等 级:贵宾
威 望:32
帖 子:2829
专家分:647
注 册:2006-11-30
得分:0 
类是一个广义概念来的...
对于vb来说就是DLL
ocx也是DLL来的
只不过分不同应用的DLL

/images/2011/147787/2011051411021524.jpg" border="0" />
2008-03-03 12:49
ioriliao
Rank: 7Rank: 7Rank: 7
来 自:广东
等 级:贵宾
威 望:32
帖 子:2829
专家分:647
注 册:2006-11-30
得分:0 
呵.....我现在邮箱看看去...

/images/2011/147787/2011051411021524.jpg" border="0" />
2008-03-03 13:07
ioriliao
Rank: 7Rank: 7Rank: 7
来 自:广东
等 级:贵宾
威 望:32
帖 子:2829
专家分:647
注 册:2006-11-30
得分:0 
老兄你把要改的代码在哪个窗体或模块?具体的..

/images/2011/147787/2011051411021524.jpg" border="0" />
2008-03-03 13:11
ioriliao
Rank: 7Rank: 7Rank: 7
来 自:广东
等 级:贵宾
威 望:32
帖 子:2829
专家分:647
注 册:2006-11-30
得分:0 
老兄...太多API了..看到晕了...
我API知识比较水.
现在我只能说一个大体的框架了...
因为不知道老兄程序的思路如何的...
这也紧是个设计ocx的一般框架

程序代码:

Private m_Flag As Boolean                                   '私有成员
Private m_GetData As Boolean
Private m_CompressByte As Boolean



Private Sub UserControl_Initialize()
    m_Flag = False                  '在控件初始化阶段将m_Flag设置False
End Sub

Public Property Set Flag(ByVal Value As Boolean)      '只写属性

        m_Flag = Value
        Timer1.Enabled = m_Flag
        
End Property

'''''''获得函数返回值设置成属性''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Property Get CompressByte() As Boolean         '只读属性

End Property

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Property Get GetData() As Boolean              '只读属性

End Property

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''


Private Function CompressByte(ByteArray() As Byte) As Boolean    '私有函数
    
End Function



Private Function GetData() As Boolean                             '私有函数
  
End Function


Private Sub SetArry(param() As Byte)

End Sub


Private Sub SetFlag()

End Sub


Private Sub Timer1_Timer()
'CompressByte(ByteArray() As Byte)
'GetData()
'SetArry(param() As Byte)
'SetFlag()
End Sub




/images/2011/147787/2011051411021524.jpg" border="0" />
2008-03-03 13:57
ioriliao
Rank: 7Rank: 7Rank: 7
来 自:广东
等 级:贵宾
威 望:32
帖 子:2829
专家分:647
注 册:2006-11-30
得分:0 
老兄是说关于图像处理方面的吧...
那么老兄真是问错人了.
我主要方向是专攻软件工程学及管理软件方面的,类erp.

/images/2011/147787/2011051411021524.jpg" border="0" />
2008-03-03 14:16



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-201685-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.403317 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved