Home > Software engineering >  About the problem of dynamic link library
About the problem of dynamic link library

Time:10-27

I am a novice, searched some tutorials, and online learning, is one more size, blood and helloword such dynamic link library tutorial
Trying to find the dynamic link library to write only when int, double, void, bool such types of variables can be defined, such as string: no, I want to achieve in a specified directory file write a Duan Dongxi function, make it link libraries, and then use in my installer, do excuse me such link library of file operations can be implemented? How to implement, basic can't find the information,

CodePudding user response:

Void *=any type

CodePudding user response:

https://msdn.microsoft.com/zh-cn/library/ms235636.aspx

CodePudding user response:

If you want to write a string of STL code, suggest you use a char array, or use c malloc, free function to dynamically allocated string of preservation and char array for operation, I don't know what you are to write a dynamic library, but if use malloc and free, if the dynamic of the rolls, please free Chambers in the dynamic,

CodePudding user response:

reference renwotao2009 reply: 3/f
if you want to write the STL string this code, it is recommended that you use a char array, or use c malloc, free function to dynamically allocated string of preservation and char array for operation, I don't know what you are to write a dynamic library, but if use malloc and free, if the dynamic of the rolls, please free Chambers in the dynamic,


I am not familiar with C and C + +, I am using C #, doing the installation package should I choose two paths, I'd like to break this record two paths, after writing a dat file, I make a dynamic link library because that way I can reference it directly, and then give me two paths repository functions (such as writePath (string installPath, string servicePath)), like this,,, that is about file operations, do not know,

CodePudding user response:

refer to the second floor lqbk1 response:
https://msdn.microsoft.com/zh-cn/library/ms235636.aspx


The size of this comparison, useless, basically, I saw, would have written, but can't write about the operation of the file

CodePudding user response:

reference 4 floor qwe135792468 response:
Quote: reference renwotao2009 reply: 3/f

If you want to write a string of STL code, suggest you use a char array, or use c malloc, free function to dynamically allocated string of preservation and char array for operation, I don't know what you are to write a dynamic library, but if use malloc and free, if the dynamic of the rolls, please free Chambers in the dynamic,


I am not familiar with C and C + +, I am using C #, doing the installation package should I choose two paths, I'd like to break this record two paths, after writing a dat file, I make a dynamic link library because that way I can reference it directly, and then give me two paths repository functions (such as writePath (string installPath, string servicePath)), like this,,, that is about file operations, don't know, but
encapsulated into a utility class? Call is also very simple!

CodePudding user response:

reference 5 floor qwe135792468 reply:
Quote: refer to the second floor lqbk1 response:

https://msdn.microsoft.com/zh-cn/library/ms235636.aspx


The size of this comparison, useless, basically, I saw, would have written, but can't write about the operation of the file

The building Lord ah, learn how to ask questions, how to express their needs, this is the thing that is important...
Please Google "question the wisdom of"?


Write into the file, fwrite over directly in c...

Don't use string parameters with const char *

CodePudding user response:

Bool also cannot use, can only be compatible with the type of C

CodePudding user response:

Fopen/fwrite fclose ()
Or using Win32 API CreateFile/WriteFile/Close () to write documents

CodePudding user response:

refer to 7th floor lqbk1 response:
Quote: refer to fifth floor qwe135792468 response:

Quote: refer to the second floor lqbk1 response:

https://msdn.microsoft.com/zh-cn/library/ms235636.aspx


The size of this comparison, useless, basically, I saw, would have written, but can't write about the operation of the file

The building Lord ah, learn how to ask questions, how to express their needs, this is the thing that is important...
Please Google "question the wisdom of"?


Write into the file, fwrite over directly in c...

Don't use string parameters with const char *


In question has been said,,, is not only the title,,, always not a description of all the problems in the title?

CodePudding user response:

String is an object, not a memory, not suitable for as a DLL function parameters are passed around,

CodePudding user response:

refer to 6th floor renwotao2009 response:
Quote: refer to 4th floor qwe135792468 response:

Quote: refer to the third floor renwotao2009 response:

If you want to write a string of STL code, suggest you use a char array, or use c malloc, free function to dynamically allocated string of preservation and char array for operation, I don't know what you are to write a dynamic library, but if use malloc and free, if the dynamic of the rolls, please free Chambers in the dynamic,


I am not familiar with C and C + +, I am using C #, doing the installation package should I choose two paths, I'd like to break this record two paths, after writing a dat file, I make a dynamic link library because that way I can reference it directly, and then give me two paths repository functions (such as writePath (string installPath, string servicePath)), like this,,, that is about file operations, don't know, but
encapsulated into a utility class? Call is also very simple!


I would also like to,, I am used to pass the path of packaging process, own installation Settings in VS not achieve them, with the setup of the factory, it is a kind of PASCAL, editing script have the function of a written document, TextFile, WriteFromString (" to create text. TXT ", "to write the text string", true); It's a pity that in the "to write the text string" cannot pass parameters, only a custom string, so can only reference dynamic link library to extend the functionality,,,

CodePudding user response:

11 references zhao4zhong1 response:
is a string object, not a memory, not suitable for as a DLL function parameters are passed around,

So, I see
  • Related