0

We try migrate our vb6 project to use sxs tehnology ....but have problem with dynamic add control to form (VBControlExtender ).

Problem is when add control to form with "Controls.Add" got instance of VBControlExtender that is not functional....rise error like "object doesn't support this property or method" or "Invalid object use" when use property or method

I found that people have like same problem (Strange Case of the missing method, Legacy vb6 application with SXS = "object doesn't support this property or method.") and suggestion is implement "Direct user control". Can somebody know how implement this in vb6 code? How we can fix problem with sxs and dynamic add control to form?

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
bojan
  • 11
  • 2
  • The [answer](https://stackoverflow.com/a/5522225/11683) you are referring to shows the complete code in IDL. [Compile a type library](https://learn.microsoft.com/en-us/windows/desktop/com/midl-compiler) from it and reference it from VB. – GSerg May 16 '19 at 11:00
  • @GSerg this code is incomplete? - uuid(GUIDHERE-0000-1111-2222-2B5E1A72D6BF) - library <> – bojan May 16 '19 at 11:09
  • `typedef`s for controls that you are using, like shown, and `importlib`s for libraries in which these controls reside, as shown. Generate any new guid for the uuid. – GSerg May 16 '19 at 11:11
  • Possible duplicate of [Strange Case of the missing method: SXS and Controls.Add results in "object doesn't support this property or method"?](https://stackoverflow.com/questions/5507879/strange-case-of-the-missing-method-sxs-and-controls-add-results-in-object-does) – StayOnTarget May 16 '19 at 11:58
  • You could / should add a comment to the answer in the other question asking for any clarifications you need. – StayOnTarget May 16 '19 at 11:58
  • @DaveInCaz Leaving comments anywhere requires 50 rep. The OP has posted an answer there requesting clarification, which was deleted. – GSerg May 16 '19 at 14:42
  • @GSerg ACK, you're right of course, I didn't think of that. – StayOnTarget May 16 '19 at 14:49
  • @bojan the other question's answer seems correct to me but leaves a lot of steps out in terms of how to actually implement it. I think you would have to use the midl compiler to create a TLB file based on the example there (maybe modified to your specific case) and then reference that TLB in your project. I know this is probably not enough info to fully help, these are pretty arcane topics. – StayOnTarget May 16 '19 at 15:21
  • here we again, we don't solve this problem and we do not know how :( How can force VB6 that work with dynamic add control and object VBControlExtender work properly with sxs tehnology. Can someone give same example how it solve this problem? How build "Direct User Controls" which explain "wqw" in related topic(https://stackoverflow.com/questions/5507879/strange-case-of-the-missing-method-sxs-and-controls-add-results-in-object-does/5519984#5519984).... – bojan Jul 31 '19 at 12:12

0 Answers0