2015-10-14 39 views
0

我有一個公共子SysSetSizeDisp(eSize1,eSize2)的DLL。 當我通過外部項目調用此子系統時,系統返回錯誤32797. 我嘗試註銷並註冊我的dll,聲明變量,然後設置「新語句」。 有人知道這個問題嗎?VB6錯誤32797使用sizeform從創建的dll,如何解決?

這裏我的功能代碼:

Public Sub SysSetSizeDisp(eSmall As eBsDispSize, eBig As eBsDispSize) 
Const STG_FUNC As String = "SysSetSizeDisp" 

Dim fK As Single 
Dim fRH As Integer 
Dim fRW As Integer 

    If eSmall > eBig Then Exit Sub 

    If DpyCnf.WinSizeMax = SysDpyGetCurrentResolution() Then 
     fRH = -H_TESTATA/Screen.TwipsPerPixelY 
     fRW = -135/Screen.TwipsPerPixelY 
    Else 
     fRH = 0 
     fRW = 0 
    End If 

    Select Case eSmall 
    Case Is = eDSize320x240 
     fSCALA1W = 320 * Screen.TwipsPerPixelX 
     fSCALA1H = 240 * Screen.TwipsPerPixelY 
    Case Is = eDSize640x480 
     fSCALA1W = 640 * Screen.TwipsPerPixelX 
     fSCALA1H = 480 * Screen.TwipsPerPixelY 
    Case Is = eDSize800x600 
     fSCALA1W = 800 * Screen.TwipsPerPixelX 
     fSCALA1H = 600 * Screen.TwipsPerPixelY 
    Case Is = eDSize1024x768 
     fSCALA1W = 1024 * Screen.TwipsPerPixelX 
     fSCALA1H = 768 * Screen.TwipsPerPixelY 
    Case Is = eDSize1152x864 
     fSCALA1W = 1152 * Screen.TwipsPerPixelX 
     fSCALA1H = 864 * Screen.TwipsPerPixelY 
    Case Is = eDSize1280x960 
     fSCALA1W = 1280 * Screen.TwipsPerPixelX 
     fSCALA1H = 960 * Screen.TwipsPerPixelY 
    Case Is = eDSize1280x1024 
     fSCALA1W = 1280 * Screen.TwipsPerPixelX 
     fSCALA1H = 1024 * Screen.TwipsPerPixelY 
    Case Is = eDSize1600x1280 
     fSCALA1W = 1600 * Screen.TwipsPerPixelX 
     fSCALA1H = 1280 * Screen.TwipsPerPixelY 
    End Select 

    Select Case eBig 
    Case Is = eDSize320x240 
     fSCALA2W = 320 * Screen.TwipsPerPixelX 
     fSCALA2H = 240 * Screen.TwipsPerPixelY 
    Case Is = eDSize640x480 
     fSCALA2W = (640 + fRW) * Screen.TwipsPerPixelX 
     fSCALA2H = (480 + fRH) * Screen.TwipsPerPixelY 
    Case Is = eDSize800x600 
     fSCALA2W = (800 + fRW) * Screen.TwipsPerPixelX 
     fSCALA2H = (600 - fRH) * Screen.TwipsPerPixelY 
    Case Is = eDSize1024x768 
     fSCALA2W = (1024 + fRW) * Screen.TwipsPerPixelX 
     fSCALA2H = (768 + fRH) * Screen.TwipsPerPixelY 
    Case Is = eDSize1152x864 
     fSCALA2W = (1152 + fRW) * Screen.TwipsPerPixelX 
     fSCALA2H = (864 + fRH) * Screen.TwipsPerPixelY 
    Case Is = eDSize1280x960 
     fSCALA2W = (1280 + fRW) * Screen.TwipsPerPixelX 
     fSCALA2H = (960 + fRH) * Screen.TwipsPerPixelY 
    Case Is = eDSize1280x1024 
     fSCALA2W = (1280 + fRW) * Screen.TwipsPerPixelX 
     fSCALA2H = (1024 + fRH) * Screen.TwipsPerPixelY 
    Case Is = eDSize1600x1280 
     fSCALA2W = (1600 + fRW) * Screen.TwipsPerPixelX 
     fSCALA2H = (1280 + fRH) * Screen.TwipsPerPixelY 
    End Select 

    fK = 9675/9600 

    fSCALA1W = fSCALA1W * fK 
    fSCALA1H = fSCALA1H * fK 
    fSCALA2W = fSCALA2W * fK 
    fSCALA2H = fSCALA2H * fK 

    DpyCnf.WinSizeMin = eSmall 
    DpyCnf.WinSizeMax = eBig 

    Exit Sub 
EH: 
    Debug.Assert False 
    cErr.MemoSave Err, STG_ME & "." & STG_FUNC 
End Sub 
+0

什麼是DpyCnf,eBsDispSize等等?如果SysSetSizeDisp是表單,類或公共模塊的方法?沒有足夠的信息。 – milevyo

+0

eBsDispSize是枚舉,表示屏幕大小,dpyCnf是一種類型,其中定義了簡單類型變量和兩個枚舉eBsDispSize變量。所有在公共模塊 –

+0

我見過,被拒絕訪問所有的DLL的方法,在課堂上或在模塊中。 –

回答

0

解決, 我重新編譯的DLL,清理註冊表,DLL的未註冊的最後一個版本,然後再重新註冊它(無修改DLL源)。 可能有些引用已損壞

相關問題