Home > Software engineering >  MFC dialog box insert use activeX controls
MFC dialog box insert use activeX controls

Time:09-17

The original dialog insert an activex controls ocx, add the control class variables, and automatically generates the control class, can call normal control methods and properties, but recently updated the control method and the name, reinsert, but add a variable control types or the name of the original, the original method, no update, delete the original class after add variables, the type of the variable or the original can not be changed, and the master for guidance on how to update the inserted controls,

CodePudding user response:

Will generate the corresponding reference OCX objects. H. CPP files, to delete, add again OCX generated. H. CPP,

CodePudding user response:

Or, in the original automatically generated directly. H. CPP in modified to control the latest properties and methods,

CodePudding user response:

Will generate the corresponding reference OCX objects. H. CPP files, to delete, add again OCX. H. CPP,

- delete. H and. (including the original file) after the CPP, insert to add variables, but the variable type is the original control types cannot be changed, but the name of the new control have changed,

Or, in the original automatically generated directly. H. CPP in modified to control the latest properties and methods,

- manual to turn after the corresponding method and parameter types and operation will go wrong,,,,

CodePudding user response:

In a different directory to create a project and the current project of the same name dialog box, and then insert the controls, associated control variables, save the project,
The new controls generated. H. CPP copied, cover to the original project

Note that the backup

CodePudding user response:

in a different directory to create a project and the current project of the same name dialog box, and then insert the controls, associated control variables, save the project,
The new controls generated. H. CPP copied, cover to the original project

Pay attention to the backup


New project also regenerate (consistent with the original type and the name of the class of situation and the new control system automatically generated) are copied the respectively, but run "invalid number of parameters" box will appear problem, but call the function type and the number is normal, the key question is new insert controls the name is not the same as the original , at the same time there are updated in new control method, if newly generated in the new project is the name of the class and new control the name of the variable types, but in the original project also insert new control variable type is the original cannot be modified, how can you change the original control types (equivalent to no load control is the initialization state of how to restore), help to analysis the reason or give a thorough solution, thanks!

CodePudding user response:

Delete the rest of the engineering documents except DSW DSP (aps CLW NCB opt PLG) try

CodePudding user response:

1. Update control use regsvr32 first registered the old controls, and then use regsvr32 registered new control
2. Delete the inserted into the dialog box controls, delete the generated member variable, delete the generated. H. CPP files, cleaning solution

CodePudding user response:

First make sure you have a problem whether the active control, can find no registered computer to see if the interface has exposed, such as confirmed that no problem continues,

Then, 3 to 7 # actually about the same, this method is feasible and update after register and generate a kind of normal can, even if it doesn't matter you smart tips or original interface, new method can be directly by hand to lose you, why the situation is more, may be regarded as you call v laying into some declaration documents in the cache directory, etc., so the feasible way is closed, vs and clean up the cache directory (or restart) under the circumstances, to open and the introduction of the active control should go, also not in computer, and moved back home in the compile, or may consider using standard com to invoke and not through the wrapper classes

CodePudding user response:

First of all thank you for your concern and help support, finally found the solution to everyone here reported, in order to help more people,
http://www.cnblogs.com/scotth/p/3667192.html
Solution:
Updated activeX method: (ocx interface:)
Delete ocx variables are defined and mapping (DDX_Control)
Delete ocx corresponding. H and. CPP file
Close the project
With the text editor deleted in the project file (all. Vcproj) information about ocx (1) & lt; Globals> 2. Inside the last about the last time on the project control class of the line)
Open the project
To add ocx variable is solved

CodePudding user response:

  • Related