B?n nh?n ?c m?t thng bo l?i "H? th?ng l?i & H80004005" t? m?t ?ng d?ng Visual Basic 6.0 khi phn m?t MFC ActiveX i?u khi?n l?p b?t k? c?a s? l?p h?c th?c hi?n b?i Comctl32.dll

D?ch tiu ? D?ch tiu ?
ID c?a bi: 223152 - Xem s?n ph?m m bi ny p d?ng vo.
Bung t?t c? | Thu g?n t?t c?

? Trang ny

TRI?U CH?NG

M?t MFC ActiveX ki?m sot phn l?p r?ng b?t k? c?a s? cc l?p h?c th?c hi?n b?i Comctl32.dll nguyn nhn l?i sau ? ?c nm t? m?t Visual Basic 6.0 exe.
"L?i h? th?ng & H80004005 (-2147467259). L?i khng xc ?nh"
Phin b?n g? l?i c?a ActiveX ki?m sot gy ra m?t ASSERT trong t?p tin Ctlcore.cpp, ? ph?n cu?i c?a COleControl::CreateControlWindow, trn ho?c g?n d?ng 662.

V?n ? ny x?y ra ch? khi b?n xy d?ng m?t .exe t? Visual Basic 6.0 v ch?y n t? bn ngoi mi tr?ng pht tri?n Visual Basic.

NGUYN NHN

Microsoft Visual Basic executables khng th? kh?i t?o cc ph? bi?n ki?m sot th vi?n (Comctl32.dll) theo m?c ?nh, k?t qu? l CreateEx cu?c g?i th?t b?i trong COleControl::CreateControlWindow. G?i GetLastError() cho 0x0000057F - khng th? t?m th?y c?a s? l?p h?c, trong ch? ra s? ki?m sot chung th vi?n c?n ph?i ?c kh?i t?o m?t cch r? rng.

GI?I PHP

Bn trong InitInstance c?a b?n i?u khi?n ActiveX, lm cho m?t g?i ?n:
InitCommonControls(void)
ho?c
InitCommonControlsEx(LPINITCOMMONCONTROLSEX lpInitCtrls)
i?u ny ?m b?o r?ng Comctl32.dll n?p v kh?i t?o, b?t k? c?a container i?u khi?n ang ch?y.

Thay v? c?a g?i InitCommonControls t? m? c?a i?u khi?n, b?n c?ng c th? g?i n tr?c ti?p t? ?ng d?ng khch Visual Basic:
  • Lm cho m?t tuyn b? chung cho cc h?nh th?c tng ?ng; cho V d?:
    Private Declare Sub InitCommonControls Lib "comctl32.dll" ()
  • Thm m?t cu?c g?i ?n:
    InitCommonControls
    					
    trong phng php Form_Load.
Trong m?t s? tr?ng h?p, i?u ny c th? l qu mu?n ? kh?i t?o cc th vi?n i?u khi?n chung. Do , n ?c khuy?n khch ? thm cu?c g?i ny trong cc InitInstance c?a s? ki?m sot.

T?NH TR?NG

Hnh vi ny l do thi?t k?.

THNG TIN THM

Cc b?c ? t?o l?i hnh vi

  1. S? d?ng Visual C++, MFC ActiveX control thu?t s?, t?o ra m?t m?c ?nh i?u khi?n ActiveX.
  2. Trong ph?n ci ?t i?u khi?n c?a AppWizard (b?c 2 c?a cc Visual C++ 6.0 AppWizard), thu?c l?p window ? phn l?p, ch?n m?t trong sau: msctls_hotkey32, msctls_progress32, msctls_statusbar32, msctls_trackbar32, msctls_updown32, SysAnimate32, SysHeader32, SysListView32, SysTabControl32, ho?c SysTreeView32.
  3. Xy d?ng s? ki?m sot.
  4. M? Microsoft Visual Basic 6.0 v t?o ra m?t tiu chu?n m?i Exe d? n.
  5. T? cc D an tr?nh n, nh?p vo Thanh phn, v ch?n i?u khi?n m b?n v?a t?o ra b?ng cch s? d?ng Microsoft Visual c + +.
  6. Ch?n i?u khi?n v v? trong cc h?nh th?c c?a s?.
  7. T? cc Tp tr?nh n, nh?p vo Lm cho Project.exe, v xy d?ng cc exe.
  8. i ?n Windows Explorer v ch?y t?p tin th?c thi ny.

Thu?c tnh

ID c?a bi: 223152 - L?n xem xt sau cng: 21 Thang Tam 2011 - Xem xt l?i: 2.0
p d?ng
  • Microsoft Foundation Class Library 4.2, khi ?c dng v?i:
    • Microsoft Visual Basic 5.0 Learning Edition
    • Microsoft Visual Basic 5.0 Professional Edition
    • Microsoft Visual Basic 6.0 Professional Edition
    • Microsoft Visual Basic 5.0 Enterprise Edition
T? kha:
kberrmsg kbtshoot kbcmnctrls kbctrl kbprb kbmt KB223152 KbMtvi
My d?ch
QUAN TRONG: Bi vi?t ny ?c d?ch b?ng ph?n m?m d?ch my c?a Microsoft ch? khng ph?i do con ng?i d?ch. Microsoft cung c?p cc bi vi?t do con ng?i d?ch v c? cc bi vi?t do my d?ch ? b?n c th? truy c?p vo t?t c? cc bi vi?t trong C s? Ki?n th?c c?a chng ti b?ng ngn ng? c?a b?n. Tuy nhin, bi vi?t do my d?ch khng ph?i lc no c?ng hon h?o. Lo?i bi vi?t ny c th? ch?a cc sai st v? t? v?ng, c php ho?c ng? php, gi?ng nh m?t ng?i n?c ngoi c th? m?c sai st khi ni ngn ng? c?a b?n. Microsoft khng ch?u trch nhi?m v? b?t k? s? thi?u chnh xc, sai st ho?c thi?t h?i no do vi?c d?ch sai n?i dung ho?c do ho?t ?ng s? d?ng c?a khch hng gy ra. Microsoft c?ng th?ng xuyn c?p nh?t ph?n m?m d?ch my ny.
Nh?p chu?t vo y ? xem b?n ti?ng Anh c?a bi vi?t ny:223152

Cung cp Phan hi

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com