Nubcake wrote:If you have a procedure that's not going to be used directly (It's not ProcedureDLL) should it be named as ProcedureDLL?
No, ProcedureDLL is only required if you plan to call it externally. Use Procedure for the rest. As for naming, choose a method you like for the 2 types.
ProcedureDLL mydll_Proc1()
Procedure __intProc1() ; <-- Leading '__' s mean internal only.
Nubcake wrote:What is #TESTDLL? Is that a reserved constant or something you just use for justifying whether you compile as DLL or exe.
This is just a made up constant since I sometimes have to test new DLL functions. I enable #DLL_TEST and change the compiler target from DLL to EXE and then step through a particular action.
Nubcake wrote:When freeing memory or allocated resources does it matter if I put it DetachProcess? Because my main function is going to be called a lot and it does a lot of allocating memory and freeing in the same procedure.
I show the FreeArray() in DetachProcess() since these were Globally defined. If your memory allocations are freed in other procedures, then you cannot free them again!
Nubcake wrote:Is there anything I should know about Attach/DetachThead() like if someone uses the dll from another thread other than main something happens?
Ha! Threads are a bit deeper to debug and discuss. But, you see there is an Instance parameter for you to manage. So, any Global DLL variables have to be "Instance aware". I tend to design away more than 1 threaded call to a single dll. Where is Trond? He was the thread guru.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum