Home > database >  OLE control error problem
OLE control error problem

Time:09-30

I wrote the program using a Microsoft's own calendar control, on the current machine running normally, but in the other machine after an error "error accessing external object property at line5... ", I read the newspaper is wrong should be I use control problem, do you have which friend encountered such a problem, how to solve? Have a similar problem, after I compile the program, on the other machine running on time, found that the part of the calendar control is a blank, can't show calendar, estimation is also a calendar control problems, how do I solve this problem, has encountered such a problem?

CodePudding user response:

Ocx is need to register, register a try on the new machine, but I forget the ocx name

CodePudding 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 stable

CodePudding user response:

Having ㄑ ㄎ

CodePudding user response:

Try to manually register mscal. Ocx controls, the control file first mscal. Ocx kao to system32 directory
Regsvr32 % 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:

references 9 f david0927cs2006 response:
try manual registration mscal. Ocx controls, the control file first mscal. Ocx kao to system32 directory
Regsvr32 % 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



Release program if you want to do, had better be in packaging, directly on the control register

CodePudding user response:

Control related documents is: mscomct2. Ocx ~
  • Related