Yapmış olduğum yıllık izin takip projem normalde Windows 10 x64 ve Office 2016 x64 ile Office 365 x86 da sıkıntısız çalışıyor fakat yeni başladığım işyerinde Windows 7 x86 ile Office 365 x86 kurulu projemi burada kullanmak istedim ama bana "çok zararlı hata ... " ile "out memory" hatası verip döngüye girip programın kodlama kısmını açıyor. Benim tahminimce işletim sisteminin ve officenin x64 olmamasından kaynaklandığını düşündüm ve aşağıdaki kodları ekledim ama genede aynı sorunla karşılaşmaya devam ediyorum siz değerli üstadlar dan ricam bana bir yardımcı olsanız.
UserForm1 içine
- Kod: Tümünü seç
Private Sub UserForm_Activate()
Module1_x86.MaxMinButton (Me.Caption)
Module2_x64.MaxMinButton (Me.Caption)
End Sub
Modül1_x86 için
- Kod: Tümünü seç
Option Explicit
Public Const MinBox = &H10000
Public Const MaxBox = &H20000
Public Const Style = (-16)
Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare PtrSafe Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Declare PtrSafe Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Declare PtrSafe Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long
Public Sub MaxMinButton(ByVal FormCaption As String)
Dim hWnd As Long
Dim IngStyle As Long
hWnd = FindWindow(vbNullString, FormCaption)
IngStyle = GetWindowLong(hWnd, Style)
IngStyle = IngStyle Or MinBox
IngStyle = IngStyle Or MaxBox
SetWindowLong hWnd, Style, IngStyle
DrawMenuBar hWnd
End Sub
Modül2_x64 için
- Kod: Tümünü seç
Option Explicit
Public Const MinBox = &H10000
Public Const MaxBox = &H20000
Public Const Style = (-16)
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Declare Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long
Public Sub MaxMinButton(ByVal FormCaption As String)
Dim hWnd As Long
Dim IngStyle As Long
hWnd = FindWindow(vbNullString, FormCaption)
IngStyle = GetWindowLong(hWnd, Style)
IngStyle = IngStyle Or MinBox
IngStyle = IngStyle Or MaxBox
SetWindowLong hWnd, Style, IngStyle
DrawMenuBar hWnd
End Sub
Eklediğim bu kodları x86 ve x64 göre değiştirerek kullandığım halde aynı hatayı almaya devam ettim.
Rica ediyorum bana bir yardımcı olun.