Home > Software engineering >  If the window of the operation in the VBP another VBP
If the window of the operation in the VBP another VBP

Time:10-15

My program is a VBG, contains a number of VBP, such as in the appended drawings:



A: MainExecPp (TopPpExeProject. VBP)
B: TopPpExecDll (TopPpExecProject. VBP) - & gt; This is a DLL
D: TopPpfanucDll (topppfanucProject. VBP) - & gt; This is a DLL
E: toppfanucE264Dll (topppfanucE264Project. VBP) - & gt; This is a DLL

My main job is in E: toppfanucE264Dll (topppfanucE264Project. VBP) in the following class module topppfanucE264 (topppfanucE264. CLS) to write code to do some secondary development,
Now I have a question: due to the needs of work, I was in class module topppfanucE264 (topppfanucE264. CLS) to add the registered machine code: if unregistered will terminate the program, originally I use END statement, the VB error said "DLL module does not support this function, so I just want to use other ways to unload the main window FormMain (C) in the appended drawings, but the problem comes again: how the class module F: topppfanucE264 (topppfanucE264. CLS) called B: TopPpExecDll FormMain (TopPpExecProject. VBP) in the window then uninstall it?

Masters have this experience please instruct me,

The younger brother thanked first,

CodePudding user response:

Your DLL, should is ActiveX DLL!
The ActiveX DLL at least one of the "public class", you do this operation window "interface" in the appropriate class,
With its Public Sub or "transit the" Function, can be very convenient operation window of DLL,

CodePudding user response:

As long as is reference relationship between project, as they are, as a project just cited not directly call the reference code,

CodePudding user response:

refer to the second floor caozhy response:
as long as is reference relationship between projects, as they are, as a project just cited not directly call the reference code,
version said is right, I F: topppfanucE264 (topppfanucE264. CLS) is cited, can't through some method B: TopPpExecDll (FormMain in TopPpExecProject. VBP) the window? If not, what am I supposed to in F: topppfanucE264 (topppfanucE264. CLS) to write code to my running program termination,
Please edition big give some ideas...

CodePudding user response:

reference xiao_wanghui reply: 3/f
Quote: refer to the second floor caozhy response:

As long as is reference relationship between project, as they are, as a project just cited not directly call the reference code,
version said is right, I F: topppfanucE264 (topppfanucE264. CLS) is cited, can't through some method B: TopPpExecDll (FormMain in TopPpExecProject. VBP) the window? If not, what am I supposed to in F: topppfanucE264 (topppfanucE264. CLS) to write code to my running program termination,
Please edition big give some ideas...

The window as instance incoming,
The interface or let the dependency inversion,

CodePudding user response:

reference 1st floor Chen8013 response:
your DLL, should is ActiveX DLL!
The ActiveX DLL at least one of the "public class", you do this operation window "interface" in the appropriate class,
With its Public Sub or "transit the" Function, can be very convenient operation window of DLL,
is trying to your suggestion, and the subsequent,

CodePudding user response:

reference 4 floor caozhy response:
Quote: reference xiao_wanghui reply: 3/f

Quote: refer to the second floor caozhy response:

As long as is reference relationship between project, as they are, as a project just cited not directly call the reference code,
version said is right, I F: topppfanucE264 (topppfanucE264. CLS) is cited, can't through some method B: TopPpExecDll (FormMain in TopPpExecProject. VBP) the window? If not, what am I supposed to in F: topppfanucE264 (topppfanucE264. CLS) to write code to my running program termination,
Please edition big give some ideas...

The window as instance incoming,
1: try to FormMain import TopPpExec. CLS: Private WithEvents oFormMain As FormMain

2: then TopPpExec. ClsZ by:
Public Sub moCancel ()
The Set oFormMain=new FormMain
Unload oFormMain
END SUB

3: reference in TopPpfanucE264 moCancel (), the results FormMain failed to uninstall, FormMain is frozen at this time,

I don't think there's anything else I deal with the right place,

Another day I send up the source code,
  • Related