User Defined Type (UDT) as parameter in public Sub in class module (VB6)

后端 未结 7 1168
感动是毒
感动是毒 2020-12-04 22:41

I\'ve tried to solve this problem, but can\'t find any solution. I have a UDT defined in a normal module, and wanted to use it as parameter in a Public Sub in a

7条回答
  •  难免孤独
    2020-12-04 23:27

    I had the same error message and after checking the application, I found that in the property window for the class, the "Instancing" setting was set to "1 - Private" for the referenced object. I changed it to "5 - MultiUse" and got the same error message. I then went back to a version of the project module prior to when I added that referenced object and added it again the project - it defaulted to "1 - Private". I changed it to "5 - MultiUse" before doing anything else and closed the project to for it to update before compiling. I re-opened the project, verified it was still set to "5 - MultiUse", then compiled the project and it compiled cleanly without the error message.

    When the error message was saying it didn't allow referencing a private object, the object really was private. Once I declared it not private, and the project module accepted that new setting, it compiled cleanly.

提交回复
热议问题