CodePudding user response:
Ocx is need to register, register a try on the new machine, but I forget the ocx nameCodePudding user response:
OCX is need to register, may be can not find the control,CodePudding user response:
Will the OCX files packaged together with the program, in the first place using OCX place using a try... To catch the exception and its own register OCX controls,There are many ways to register to the registry and regsvr32.
CodePudding user response:
Upstairs, thank you for your answer, I try, thank you!!!!!!CodePudding user response:
In PB program implementation, so that the installer will only responsible for OCX copy to the appropriate directory path, the path, PB program must be able to get advice copy to the Windows system directory or with executable directory,
Specific code:
//first define the API function, if OCX in with executable directory, use GetCurrentDirectory function; If OCX controls the system directory, use the GetSystemDirectory function,
The Function ulong GetCurrentDirectory (ulong nBufferLength, ref string lpBuffer) Library "kernel32. DLL" Alias for "GetCurrentDirectoryA
"The Function uint GetSystemDirectory (ref string lpBuffer, uint uSize) Library "kernel32. DLL" Alias for "GetSystemDirectoryA
"
//in the PB Application (Application) Open event, assuming OCX files in the Windows system directory,
String ls_PathName, ls_Command
Ulong ll_RequiredBufferSize
Ls_PathName=Space (255)
Ll_RequiredBufferSize=GetSystemDirectory (ls_PathName, 255)
IF ll_RequiredBufferSize=0 or ll_RequiredBufferSize & gt; THEN 255
//error message
The else
Ls_Command="Regsvr32/s" + "-" "+ ls_PathName +" \ Myocx ocx "+" - ", "
The Run (ls_Command)
...
End the if
Regsvr32 "/s" behind the execution parameter is to hide the registered success message box,
According to do it, but the program still stubborn error, dizzy!!!!!!
CodePudding user response:
OCX is need to register, register to restart the computer after a try, and don't compiled into machine code is compiled, pb compiled machine code is not very stableCodePudding user response:
Having ㄑ ㄎCodePudding user response:
Try to manually register mscal. Ocx controls, the control file first mscal. Ocx kao to system32 directoryRegsvr32 % SystemRoot % \ system32 \ MSCAL OCX/
If the part of the calendar control is a blank, can't show the calendar, good yao can remove control register, and then try to register a
Regsvr32 % SystemRoot % \ system32 \ MSCAL OCX/u
Regsvr32 % SystemRoot % \ system32 \ MSCAL OCX
CodePudding user response: