Mostrar Mensajes

Esta sección te permite ver todos los posts escritos por este usuario. Ten en cuenta que sólo puedes ver los posts escritos en zonas a las que tienes acceso en este momento.


Mensajes - TheWatcher

Páginas: [1] 2
1
Visual Basic 6 / Re:Advancevb Codes
« en: Julio 10, 2016, 11:09:22 am »
Hi cobein,

The lfFaceName() field of Type LOGFONT that you're using in your mCaptioner.bas module in your nccaption project has a wrong size. It should be declared as
Código: [Seleccionar]
    lfFaceName(31)              As Byteor better
Código: [Seleccionar]
    lfFaceName(0 To 31)         As Bytei.e. it should be exactly 32 bytes long.

While your declaration works in this particular case for the nccaption project's purposes because the lfFaceName comes the last among the UDT member fields, many other derivative UDTs use the entire LOGFONT UDT to describe their own individual member fields. If the LOGFONT UDT has at least one byte extra or missing, the alignment in such derivative UDTs is going to be badly broken which is likely, in its turn, to make your VB calls broken and/or incompatible with the APIs you're calling.

Please see Leandro's ClsSkinner.cls module for many examples of user defined types that are derived from (i.e. are using) the LOGFONT UDT and are misaligned for use in (i.e. are incompatible with) other languages, libraries, and WinAPI. See also my notification of this bug addressed to Leandro here.

2
Visual Basic 6 / Re:cómo hacer transparente PictureBox ?
« en: Junio 15, 2016, 07:59:26 am »
Just as a handy tip, there's also a compatible GdiTransparentBlt() API directly in the Gdi32.dll library under any contemporary MS Windows OS starting with Windows 2000 Professional/Server and up.

So, if you have Gdi32.dll already loaded for other purposes in your application, there is no need to map yet another extra graphics library in the process address space.

3
Visual Basic 6 / Re:Skins sin OCX L.Ascierto adaptar Excel
« en: Junio 14, 2016, 05:10:22 am »
Hi Leandro,

While we're at it, are you aware that your declaration of Type LOGFONT in your ClsSkinner.cls isn't exactly correct and causes misalignment of derivative UDTs throughout the module:

Código: [Seleccionar]
Private Type LOGFONT
    lfHeight                            As Long
    lfWidth                             As Long
    lfEscapement                        As Long
    lfOrientation                       As Long
    lfWeight                            As Long
    lfItalic                            As Byte
    lfUnderline                         As Byte
    lfStrikeOut                         As Byte
    lfCharSet                           As Byte
    lfOutPrecision                      As Byte
    lfClipPrecision                     As Byte
    lfQuality                           As Byte
    lfPitchAndFamily                    As Byte
    lfFacename(LF_FACESIZE)             As Byte ' That's not correct!
End Type

Such a declaration makes LOGFONT exactly one byte longer than necessary as lfFacename(LF_FACESIZE) where Const LF_FACESIZE As Long = 32 effectively produces a 33-byte long array: lfFacename(LF_FACESIZE) = lfFacename(32) = lfFacename(0 To 32) = 33 bytes long.

IMO the declaration should be corrected to lfFacename(LF_FACESIZE - 1) to make sure the skin files are compatible with, and usable in, other languages and applications.

(Actually, I noticed this bug a couple years ago when fixing/porting your code to FBSL but was too lazy to notify y'all in due time. Anyway, as they say Better late than never ... :) )

4
Visual Basic 6 / Typo in ClsSnapWebSite.cls
« en: Mayo 08, 2013, 06:40:54 am »
Hola Leandro,

Private Sub DrawRectangle() seems to have a typo:

Código: (VB) [Seleccionar]
Private Sub DrawRectangle(hdc As Long, X As Long, Y As Long, Width As Long, Height As Long, oColor As OLE_COLOR)
    Dim hPen As Long, OldhPen As Long
    Dim OldBrush As Long
    hPen = CreatePen(0, 1, oColor)
    OldhPen = SelectObject(hdc, hPen)
    OldBrush = SelectObject(hdc, GetStockObject(NULL_BRUSH))
    Rectangle hdc, 0, 0, Width, Height
    DeleteObject SelectObject(hdc, Height) ' MUST BE A TYPO. SHOULD BE DeleteObject SelectObject(hdc, OldhPen)?
    Call SelectObject(hdc, OldBrush)
End Sub

Saludos,

TheWatcher

5
Visual Basic 6 / Re:Extract PNG and ICO from resource DLL
« en: Febrero 18, 2011, 07:15:07 am »
Hi again cliv,

Exactly what you are doing wrong is that Leandro's code is for separate PNG image resources and not for Vista icons in PNG format:
... I assume you are referring to images .PNG and not a Vista-like icons which have a png image in the same icon ...

But ignoring this, you've again added your two new PNG images like two extra icons into your Resurse.dll. Please do not misinterpret these two distinctly different resource types next time you compile your dynamic link libraries. In case you don't know how to exploit resources in 3rd-party executables, here's a couple of useful links to the software that can help:

http://www.heaventools.com/
http://www.softpedia.com/get/Programming/File-Editors/Resource-Hacker.shtml

In the meantime, please have your project and your dll corrected to use Leandro's code to load your PNG images from a dll both by name and by ordinal identifiers HERE.

By the way, what prevents you now from also adding code to display true icons with sizes larger than 32x32? You already have all the code explained in the above examples. It will never be a simple copy-and-paste matter but rather a trial-and-error one. Otherwise I am afraid it is exactly what I call developing projects for someone instead of his own self for free. ;)

Mike Lobanovsky :)

6
Visual Basic 6 / Re:Extract PNG and ICO from resource DLL
« en: Febrero 18, 2011, 04:32:20 am »
He-he, thanks for your help Leandro, :)

Seems like Cliv won't need to search the net for the missing pieces of knowledge this time because they are all already here, cleaned, parceled and posted at no extra charge! :D

Respect and cheers, :)

Mike Lobanovsky

7
Visual Basic 6 / Re:Extract PNG and ICO from resource DLL
« en: Febrero 17, 2011, 09:42:22 am »
Cliv,

La Volpe's code is excellent, and this man has spent countless years fiddling with images of all sorts, and his product is the essence of his rich experience in this area. Two thirds of his Icon Resource Organizer are dedicated exactly to what you are asking here for -- to just load the icon and display it, however simple it may sound -- and only one third of it concerns ways to convert the icon to another format, which is not what you intend to do, at least at this stage of your progress.

Do you think that if loading and displaying icons correctly were a simple matter of two or three lines of code, La Volpe would have masochistically bloated it up to 200KB on some evil purpose of making things harder for you, me, or anybody else? Definitely no. His code is the absolute minimum required to resolve the tasks which he has formulated when starting to develop his project.

So, now you know how to load and display simpler icon formats using simple Windows API's provided that you know the exact icon names and/or ordinal identifiers and their original sizes, and IMHO this is already a great leap forward compared to what you knew when you launched this thread. Your next step should be to study ways of how to extract this data from a 3rd-party executable whose contents is Pandora's box, especially if it is as crooked as the dll which you use in your example. This data resides in the group icon structure of your dll. Google for smaller bits of knowledge over the net, study simple icon formats, file and image headers, etc. and develop this simple example above so that it can handle these simple tasks automatically.

No sooner than you can do it with simple icon formats within any executables you can get hold of, should you proceed to more advanced topics like PNG-based Vista "icons".

Forums are meant for helping you resolve lesser issues in your existing projects and not for someone developing your projects for youself instead of your own self. There's another great thing by La Volpe besides his great VB code that is very relevant in this case: HitchHiker's Guide to Getting Help on the Forums. Please make it your everyday reference too... :)

8
Visual Basic 6 / Re:[Auto Delete]
« en: Febrero 16, 2011, 10:15:26 pm »
http://www.catch22.net/tuts/selfdel

Saludos

Mike Lobanovsky

9
Visual Basic 6 / Re:Extract PNG and ICO from resource DLL
« en: Febrero 16, 2011, 02:28:51 pm »
Hi cliv,

1. The problem with your dll still persists. You are evidently using the VB6 resource compiler or some simple analog to compile your icons under string names rather than under ordinal number identifiers. This is why the Windows API functions fail to load them correctly when the usual "#X" (X is the icon's ordinal number) string is passed as the resource identifier. You must use the resources' explicit string names for the functions to behave correctly with your dll.

2. The ExtractIcon and DrawIcon APIs are bound to the system's SM_CXICON and SM_CYICON metric values for icons and will not let you draw the icon's image to an arbitrary size including its original size without distortion if it (I mean "size") does not correspond to the system metric settings. To bypass this limitation, you'll have to use a couple of slightly more advanced API functions:
Código: [Seleccionar]
Option Explicit
Private Declare Function LoadLibrary Lib "kernel32.dll" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Private Declare Function LoadImage Lib "user32" Alias "LoadImageA" (ByVal hinst As Long, ByVal lpszName As String, ByVal uType As Long, ByVal cxDesired As Long, ByVal cyDesired As Long, ByVal fuLoad As Long) As Long
Private Declare Function DrawIconEx Lib "user32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal hIcon As Long, ByVal cxWidth As Long, ByVal cyWidth As Long, ByVal istepIfAniCur As Long, ByVal hbrFlickerFreeDraw As Long, ByVal diFlags As Long) As Long
Private Declare Function DestroyIcon Lib "user32.dll" (ByVal hIcon As Long) As Long

Private Const IMAGE_ICON = 1
Private Const DI_NORMAL = &H3

Private Sub Form_Load()
    Dim hIcon As Long
    Dim hLib As Long
   
    Me.AutoRedraw = True

    hLib = LoadLibrary("Resurse.dll")
   
    hIcon = LoadImage(hLib, "ICON_0", IMAGE_ICON, 0, 0, 0)
    Call DrawIconEx(Me.hdc, 0, 0, hIcon, 32, 32, 0, 0, DI_NORMAL)
    DestroyIcon hIcon
   
    hIcon = LoadImage(hLib, "ICON_1", IMAGE_ICON, 0, 0, 0)
    Call DrawIconEx(Me.hdc, 34, 0, hIcon, 32, 32, 0, 0, DI_NORMAL)
    DestroyIcon hIcon
   
    hIcon = LoadImage(hLib, "ICON_2", IMAGE_ICON, 0, 0, 0)
    Call DrawIconEx(Me.hdc, 68, 0, hIcon, 32, 32, 0, 0, DI_NORMAL)
    DestroyIcon hIcon

    hIcon = LoadImage(hLib, "ICON_7", IMAGE_ICON, 0, 0, 0)
    Call DrawIconEx(Me.hdc, 102, 0, hIcon, 48, 48, 0, 0, DI_NORMAL)
    DestroyIcon hIcon

    hIcon = LoadImage(hLib, "ICON_8", IMAGE_ICON, 0, 0, 0)
    Call DrawIconEx(Me.hdc, 152, 0, hIcon, 48, 48, 0, 0, DI_NORMAL)
    DestroyIcon hIcon

    hIcon = LoadImage(hLib, "ICON_9", IMAGE_ICON, 0, 0, 0)
    Call DrawIconEx(Me.hdc, 202, 0, hIcon, 64, 64, 0, 0, DI_NORMAL)
    DestroyIcon hIcon

    hIcon = LoadImage(hLib, "ICON_10", IMAGE_ICON, 0, 0, 0)
    Call DrawIconEx(Me.hdc, 0, 64, hIcon, 64, 64, 0, 0, DI_NORMAL)
    DestroyIcon hIcon

End Sub

3. The above code enumerates all the images in your dll that can be drawn without distortion to their native sizes using simple Windows APIs. If you want to display Vista and 7 icons which are not true icons but rather transparent PNG images, you will have to use GDI+ APIs instead. But I think that can be left for you as your home exercise... :)

Mike Lobanovsky

10
Visual Basic 6 / Re:Problema Matematico
« en: Octubre 30, 2010, 02:45:50 pm »
Leandro,

Por favor, mire este problema desde otro punto de vista.

Los datos de píxeles en la huella de la imagen en la memoria no es siempre apretados. Debemos distinguir entre la anchura de una "imagen" y la anchura de una "scanline". "Scanline" es una representación de una línea de la imagen en la memoria que en muchos casos tiene que estar lleno de bytes adicionales ("padding") a la cercana frontera de un "WORD" o un "DWORD". Esto depende del formato de la imagen.

Por favor, búsqueda de alineación de los datos de píxeles en el Internet porque mi español es demasiado pobre para describir este problema en detalle.

Tal vez usted también necesitará la siguiente tabla para hacer los cálculos de "padding" más fácil. Está escrito en Fbsl pero usted será capaz de hacerlo aplicable para VB también cambiando "0x" a "&H", "BOr" a "Or" y "BAnd" a "And":


Saludos

Mike Lobanovsky

11
Visual Basic 6 / Re:dibujar poligonos regulares y obtener sus propiedades
« en: Octubre 30, 2010, 01:06:39 pm »
Esto es para su atención:

Código: (VB) [Seleccionar]
Private Function DrawPoligonRegular(ByVal hdc As Long, ByVal Color As Long, ByVal BorderColor As Long, NumLados As Long, MedLad As Double, Xi As Long, Yi As Long, Optional Rotation As Long) As Poligono
'============================
' ML: Por favor, perdoname por mis mensajes en espanol traducida por Google
'============================

Dim i As Double
Dim mAngInt As Double
Dim Area As Double
Dim Perimetro As Double
Dim Apotema As Double
Dim AngI As Double
Dim A As Double
Dim B As Double

Dim nTri As Long
Dim Count As Long
Dim RGN As Long
Dim bColor As Long
Dim Pen As Long
'============================
Dim oldPen As Long ' ML: Necesitamos esta variable con el fin de permanecer campatible con los requisitos de Windows
'============================


Dim Vertice() As Coord

On Error GoTo Fin
If NumLados < 3 Then Err.Raise 1
nTri = NumLados - 2 'numero de triangulos por vertice (si los trazamos en una hoja _
nos damos cuenta de esta logica).

mAngInt = nTri * 180 / NumLados 'medida de cada angulo interno (un triangulo _
tiene 180 grados y como tenemos el total de triangulos, entoces se hace esto).

AngI = 180 - mAngInt 'si trazamos una linea recta del _
centro del poligono a cada vertice del poligono forman angulos iguales, _
y es aqui donde almacenamos la medida de esos angulos ().

A = MedLad / 2 'Aqui va el Cateto Opuesto del triangulo rectangulo _
formado por la linea del centro al vertice, y del vertice a la mitad de la distancia _
del vertice inmediato.

Apotema = A / (Seno(90 - (mAngInt / 2))) 'quiero aclarar que no me acuerdo de si _
el Apotema es la distancia del centro al vertice o si es del centro a la mitad _
de un lado, y lo puse que es al vertice, corrijan si me equivoco, _
(de cualquier forma seria la hipotenusa de nuestro triangulo formado).

B = Sqr(Apotema ^ 2 - A ^ 2) 'sacamos el Cateto Adyacente, con clasico teorema de pitagoras
Perimetro = NumLados * MedLad 'perimetro seria lo mas sencillo...
Area = ((A * B) / 2) * NumLados * 2 'como ya tenemos las medidas de los catetos _
entoces los multiplicamos, y los dividimos entre 2(Formula del triangulo) y _
despues los multiplicamos por el doble de el total de lados (ya que nuestro _
triangulo fue dividido entre 2 inicialmente para convertirlo en triangulo rectangulo).

ReDim Vertice(1 To NumLados)
For i = Rotation To 360 + Rotation Step AngI
If Count < NumLados Then
Count = Count + 1
Vertice(Count).X = Xi - (Seno(i) * Apotema)
Vertice(Count).Y = Yi - (Seno(i, True) * Apotema)
End If
'MoveToEx hdc, Xi - (Seno(i) * Apotema), Yi - (Seno(i, True) * Apotema), 0
'LineTo hdc, Xi - (Seno(i + AngI) * Apotema), Yi - (Seno(i + AngI, True) * Apotema)
Next

Call OleTranslateColor(Color, 0, Color)
Call OleTranslateColor(BorderColor, 0, BorderColor)
RGN = CreatePolygonRgn(Vertice(1), NumLados, 2)
bColor = CreateSolidBrush(Color)
Pen = CreatePen(0, 2, BorderColor)

Call FillRgn(hdc, RGN, bColor)
Call SetPolyFillMode(hdc, 2)
'============================
' Call DeleteObject(SelectObject(hdc, Pen)) ' ML: Es demasiado pronto para hacer eso!
oldPen = SelectObject(hdc, Pen)
'============================
Call Polygon(hdc, Vertice(1), NumLados)

'============================
Call SelectObject(hdc, oldPen) ' ML: Windows integridad GDI es atacado si DC se queda con un objeto que no es nativa
'============================
Call DeleteObject(RGN)
Call DeleteObject(bColor)
Call DeleteObject(Pen) ' ML: Este objeto no se elimina si se mantiene seleccionada en un DC!

Fin:
With DrawPoligonRegular
.Apotema = Apotema 'si me equivoque entonces seria B
.Area = Area
.MedidaAnguloInterno = mAngInt
.Perimetro = Perimetro
.Finished = Not CBool(Err.Number)
End With

End Function


Este enfoque es común para todos los objetos GDI de Windows.

12
Visual Basic 6 / Re:Hola, ayuda con DeleteObject del HDC
« en: Marzo 01, 2010, 04:13:30 pm »
Hola Leandro y xmbeat,

Más correcciones deben hacerse aquí para hacer el código de Windows-compatible. DeleteDC () nunca debe ser usado para un DC que obtuvo con GetDC (). Usted debe usar ReleaseDC () en su lugar:

Citar
Private Sub ChkMenu_MouseOver(Index As Integer)
 
   
    Dim DC As Long, hDCMemory As Long, hBmp As Long
    Dim OldhBmp As Long
    Dim hDeskWnd As Long
    If Index = ChkMenu.UBound Then Exit Sub
    With FrmPopUp
    .Move Me.Left + ChkMenu(Index).Left * Screen.TwipsPerPixelX, _
        Me.Top + (ChkMenu(Index).Top + ChkMenu(Index).Height) * Screen.TwipsPerPixelY
   
    hDeskWnd = GetDesktopWindow()
    DC = GetDC(hDeskWnd)

    DC = GetDC(0)
    hDCMemory = CreateCompatibleDC(0)
    hBmp = CreateCompatibleBitmap(DC, PicArray(Index).Width, PicArray(Index).Height)
    OldhBmp = SelectObject(hDCMemory, hBmp)
       
    PrintWindow PicArray(Index).hWnd, hDCMemory, 0
    SetStretchBltMode .Picture1.hDC, vbPaletteModeNone
    StretchBlt .Picture1.hDC, 0, 0, .Picture1.ScaleWidth, .Picture1.ScaleHeight, _
    hDCMemory, 0, 0, PicArray(Index).Width, PicArray(Index).Height, vbSrcCopy
   
    Select Case Index
    Case 0
        .Label1.Caption = "Descricion del Menu"
        .Label2.Caption = "Menu Tip:"
    Case 1
    Case 2
    '....
    End Select
    Mi = Index
    .Visible = True
    SetWindowPos .hWnd, -1, 0, 0, 0, 0, 3
    .Picture1.Refresh
    End With
    SelectObject hDCMemory, OldhBmp
    DeleteDC DC
    ReleaseDC hDeskWnd, DC
    DeleteDC hDCMemory
    DeleteObject hBmp
End Sub

Espero que esto ayude. Si no, la causa de la pérdida de memoria no está en esta función.

Saludos,

Mike  8)

13
Visual Basic 6 / Re:Fugas de GDI
« en: Enero 21, 2010, 01:27:57 am »
Muchas gracias por sus cálidas palabras de bienvenida. Espero que puedan beneficiarse mutuamente el uno del otro ahora y en el futuro.

También he enviado un mensaje personal en el foro FBSL (en Inglés, para un cambio :) ).

Tal vez usted también gusta lo que ves en este enlace:
http://www.fbsl.net/phpbb2/viewtopic.php?p=8394#8394

Mike  :)

14
Visual Basic 6 / Re:Fugas de GDI
« en: Enero 20, 2010, 09:52:28 pm »
http://msdn.microsoft.com/en-us/library/aa923962.aspx :
Citar
BOOL DeleteObject(
  HGDIOBJ hObject
);

 Parameters

hObject

    [in] Handle to a logical pen, brush, font, bitmap, region, or palette.

 Return Value

Nonzero indicates success.

Zero indicates that the specified handle is not valid or that the handle is currently selected into a device context.

To get extended error information, call GetLastError.
 Remarks

Do not delete a drawing object (pen or brush) while it is still selected into a device context.
Lamentablemente esto también se aplica a otros objetos GDI, como por ejemplo, mapas de bits.

http://msdn.microsoft.com/en-us/library/aa932923.aspx :
Citar
HGDIOBJ SelectObject(
  HDC hdc,
  HGDIOBJ hgdiobj
);

 Parameters

hdc

    [in] Handle to the device context.

hgdiobj

    [in] Handle to the object to be selected.

    The specified object must have been created by using one of the following functions.
...................

 Return Value

If the selected object is not a region, the handle of the object being replaced indicates success.
..................
 Remarks

This function returns the previously selected object of the specified type.

An application should always replace a new object with the original, default object after it has finished drawing with the new object.
..................

Con el fin de que sea completamente compatible con las especificaciones de Windows, el código de RenderStretchFromDC () debería tener el siguiente aspecto:

Código: [Seleccionar]
Private Function RenderStretchFromDC(ByVal DestDC As Long, _
                                ByVal DestX As Long, _
                                ByVal DestY As Long, _
                                ByVal DestW As Long, _
                                ByVal DestH As Long, _
                                ByVal SrcDC As Long, _
                                ByVal x As Long, _
                                ByVal y As Long, _
                                ByVal Width As Long, _
                                ByVal Height As Long, _
                                ByVal Size As Long, _
                                Optional MaskColor As Long = -1)
                               
Dim Sx2 As Long

Sx2 = Size * 2

If MaskColor <> -1 Then
    Dim mDC     As Long
    Dim mX      As Long
    Dim mY      As Long
    Dim DC      As Long
    Dim hBmp    As Long
    Dim hOldBmp    As Long ' storage for the original BMP allocated automatically when CreateCompatibleDC() is called

    mDC = DestDC
    DC = GetDC(0)
    DestDC = CreateCompatibleDC(0)
    hBmp = CreateCompatibleBitmap(DC, DestW, DestH)
    hOldBmp = SelectObject(DestDC, hBmp) ' save the original BMP for later reselection
    mX = DestX: mY = DestY
    DestX = 0: DestY = 0
End If

SetStretchBltMode DestDC, vbPaletteModeNone

BitBlt DestDC, DestX, DestY, Size, Size, SrcDC, x, y, vbSrcCopy  'TOP_LEFT
StretchBlt DestDC, DestX + Size, DestY, DestW - Sx2, Size, SrcDC, x + Size, y, Width - Sx2, Size, vbSrcCopy 'TOP_CENTER
BitBlt DestDC, DestX + DestW - Size, DestY, Size, Size, SrcDC, x + Width - Size, y, vbSrcCopy 'TOP_RIGHT
StretchBlt DestDC, DestX, DestY + Size, Size, DestH - Sx2, SrcDC, x, y + Size, Size, Height - Sx2, vbSrcCopy 'MID_LEFT
StretchBlt DestDC, DestX + Size, DestY + Size, DestW - Sx2, DestH - Sx2, SrcDC, x + Size, y + Size, Width - Sx2, Height - Sx2, vbSrcCopy 'MID_CENTER
StretchBlt DestDC, DestX + DestW - Size, DestY + Size, Size, DestH - Sx2, SrcDC, x + Width - Size, y + Size, Size, Height - Sx2, vbSrcCopy 'MID_RIGHT
BitBlt DestDC, DestX, DestY + DestH - Size, Size, Size, SrcDC, x, y + Height - Size, vbSrcCopy 'BOTTOM_LEFT
StretchBlt DestDC, DestX + Size, DestY + DestH - Size, DestW - Sx2, Size, SrcDC, x + Size, y + Height - Size, Width - Sx2, Size, vbSrcCopy   'BOTTOM_CENTER
BitBlt DestDC, DestX + DestW - Size, DestY + DestH - Size, Size, Size, SrcDC, x + Width - Size, y + Height - Size, vbSrcCopy 'BOTTOM_RIGHT

If MaskColor <> -1 Then
    TransparentBlt mDC, mX, mY, DestW, DestH, DestDC, 0, 0, DestW, DestH, MaskColor
    SelectObject DestDC, hOldBmp  ' reselect the original BMP and deselect the new BMP
    DeleteObject hBmp                  ' now you are free to delete the new BMP
    DeleteDC DC
    DeleteDC DestDC                    ' delete DestDC with its original BMP
End If

End Function

Hay muchas piezas de código similar en las aplicaciones de ejemplo presentado en este sitio web. Mientras que las muestras pequeñas pueden parecer relativamente estable, porque la pintura relativamente poco lo que se hace, los grandes programas pueden sufrir caídas inesperadas y congelar al azar.

El manejo cuidadoso y limpio de objetos GDI a menudo pueden hacer que el código se comporte de una manera más previsible y previsto, debido al hecho de que la asignación automática / cancelación de asignación de memoria del sistema será compatible con los requisitos generales de Windows.

Espero sinceramente que mis observaciones hará que el contenido de su excelente sitio web todavía un poco mejor, si se puede hacer en absoluto.

Mike :)

15
Visual Basic 6 / Re:Fugas de GDI
« en: Enero 20, 2010, 04:23:52 am »
Las muestras "DrawGrip", "DrawSelectionEx", "FillRectEx", "DrawAlphaSelection", "Texto espejado" tienen los mismos fugas GDI debido a los mismos problemas con la creación y supresión de los objetos dentro de la DC.

Páginas: [1] 2