| |

VerySource

 Forgot password?
 Register
Search
View: 700|Reply: 5

Split a program into several DLLs !!!

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-18 06:40:01
| Show all posts |Read mode
I didn't plan well when I first wrote the program ... Now I want to split a program into several DLLs, but I always encounter a lot of trouble ...
So, can any program be split into several DLLs? (I ask this because if I ca n’t, then I wo n’t waste any effort)
My program is mainly a dialog box call, there are many resources, can it be disassembled?
If you want to divide, is there anything particularly important to pay attention to ???
I want to use loadlibrary to show the call, but there are only examples of calling functions in the book.

Sorry, the dynamic link library has not been studied for a long time, and there is still a lot of ignorance ... Can you think of the DLL as dynamically loaded code? Or are there many other restrictions? For example ... Can you only call it? Function? (If there is a dialog box, there will be a class, 唉 and messages, it's really messy ...)

Please heroes help me !!!
!!!!!!!!!!!!!!!!!!!
thanks, thanks!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!
Reply

Use magic Report

0

Threads

55

Posts

32.00

Credits

Newbie

Rank: 1

Credits
32.00

 China

Post time: 2020-1-28 00:45:01
| Show all posts
DLL is mainly for modularity, but your interface and messages are best placed in the main program.
Reply

Use magic Report

0

Threads

10

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-1-30 16:09:01
| Show all posts
Resources are best placed in a dll or a module, not a little here and there, increasing the chance of error. . .
Import with loadlibrary, Getprocaddress for functions, SetResourceHandle for resources
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-30 20:09:01
| Show all posts
Can be divided into several projects in the same solution, put the module into a project to generate as a DLL, EXE project can call the DLL project, without using Loadlibrary.
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-2-4 17:15:01
| Show all posts
My biggest problem now is actually this:
I originally double-clicked in the main window (which is a dialog box) to create a new dialog box.These two dialog boxes must respond to some messages, and both have right-click menus.
I want to separate them and put the sub-dialog in the DLL (including all related things of the sub-dialog) so that when the main window is double-clicked, the DLL is dynamically loaded to generate the dialog.
But there is a lot of data between the two of them, so it's troublesome ~~~~~
And if the sub-dialog is in my original modeless dialog, it will exit immediately after execution.
However, if you use a modal dialog box, the main window will not respond when the sub dialog box exists ...

Ugh...........
Reply

Use magic Report

0

Threads

5

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-3-31 17:30:02
| Show all posts
According to the meaning of the landlord, it can be implemented as follows: Make two dlls, and build a class (class A, class B) in each dll. All functions are implemented in class A or a class A 'can be associated with class A. Other functions (you can build multiple classes as needed). In the main program, define the members of class A and class B, and use the members of class A and class B to access the functions in the dll to implement the functions. In the same way, data can be exchanged between classes A and B. Due to message passing, you can receive messages through the winproc function in the main program, or you can pass messages between windows as needed.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list