[elektro-etc] VB6 kerdes

Famulus Számítástechnika hwsw at famulus.hu
Sun Feb 10 00:13:52 CET 2008


Sot van a kiralyi ut is....

A Global object is an application object
that enables you to access
application-level properties and methods.

Szivathat meg, hogy
a minden honnan lathatasoghoz
az indito modulban kell  deklaracionak lennie...
...es nem egy Form-al hanem
ezzel az indito modullal !!! kell
inditani a programot....megpedig
a Sub Main() proceduraval...

A project Propertiesben atallitando!!

----------------
Option Explicit

Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" 
(Destination As Any, Source As Any, ByVal Length As Long)

Global Const Interpolacio_per_sec = 2500
Global Const Skala = 0.0254

Global StopMain As Boolean
Global Rajzolhat As Boolean

-----------------
Sub Main()

    formMain.Show

End Sub

----------------
Sub SysTimeIr()

    Dim TizedDummy As Integer

    TizedDummy = 10 * Round(Timer, 1) Mod 10
    If TizedDummy <> TizedSec Then
        TizedSec = TizedDummy
        formMain.lblSysTime.Caption = " " & Time & "." & TizedSec
    End If

End Sub

-------------
Function Incr(Value As Variant, Optional Increment As Variant = 1) As 
Variant
    Value = Value + Increment
    Incr = Value
End Function

----------------

En egyebkent ha Form-al indul a program
akkor tartok e celbol egy kulon modult
Globaldef neven es ez tartelmaz minden
olyan deklaarciot amit tobb helyrol kell latni

--------GLOBAL DEF----

Option Explicit

Public Const LoginProba = 3

Public Dummy As Variant
Public StrSQL As String

Public Tizedes As Integer

Public MyCn As New ADODB.Connection
Public SQLCn As New ADODB.Connection
Public MyComm As ADODB.Command
Public SQLComm As ADODB.Command
Public MyPrm As ADODB.Parameter

Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Declare Function SetCapture Lib "user32" (ByVal hwnd As Long) As Long
Declare Function ReleaseCapture Lib "user32" () As Long

Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal 
lpBuffer As String, nSize As Long) As Long

Public Const CB_SHOWDROPDOWN = &H14F
Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" (ByVal 
hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As 
Long) As Long

--------------------------

KJ


----- Original Message ----- 
From: "Famulus Számítástechnika" <hwsw at famulus.hu>
To: <elektro-etc at tesla.hu>
Sent: Saturday, February 09, 2008 11:55 PM
Subject: Re: [elektro-etc] VB6 kerdes


> Ez a cim a help-ben
>
> Understanding the Scope of Variables
>
> Ezen belul...
>
> Variables Used by All Modules
>
> To make a module-level variable available to other modules,
> use the Public keyword to declare the variable.
>
> The values in public variables are available to all procedures in your 
> application.
> Like all module-level variables, public variables are declared
> in the Declarations section at the top of the module. For example:
>
> Public intTemp As Integer
>
>
> Tovabbi finomsagok...
>
> Advanced Variable Topics
>
>
> KJ
>
>>> Küzdök ezzel a VB6-al és még mindig homályos egy-két dolog.
>>>
>>> Van egy modulban egy tömb. Ki lehet ezt emelni valahogy úgy, mint
>>> C-ben pointerrel és igy a modulon kivül  tudjam piszkálni a tömböt ?
>>> Ne kelljen már mindig töltögetni.
>>>
>>> Ha lehet valahogy, egy példa nem ártana.
>>>
>>> Köszi
>>>
>>> Üdv.  Zoli
>>
>>
>> Nem teljesen ertelek, de
>>
>> egy Modul-ban definilat Public tomb
>> mindig barhonnan lathato a neve alapjan is...
>>
>> Illetve letezik a ByRef lehetoseg a
>> fuggveny/eljaras hivas parmeterezesenel
>> azert, hogy ne stack-en at kelljen
>> manipulalni, gondolom ez kell neked ...
>>
>> De ez az ALAPERTELMEZES is.
>>
>> A ByVal az meg kiirando...
>>
>> KJ
>>
>>
>>
>>
>> -- 
>> No virus found in this incoming message.
>> Checked by AVG Free Edition. Version: 7.5.516 / Virus Database:
>> 269.19.21/1267 - Release Date: 2008.02.08. 20:12
>>
>>
>
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 
> 269.19.21/1267 - Release Date: 2008.02.08. 20:12
>
> 



More information about the Elektro-etc mailing list