WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: KeithW on July 08, 2024, 08:26:26 PM

Title: Building a DLL with WinBatch?
Post by: KeithW on July 08, 2024, 08:26:26 PM
Greetings,

Is it possible to build a DLL with WinBatch/Compiler?
I want to make some scripts available but there are Functions/Routines/UDFs that I want to protect the source on.  I need to be able to pass parameters in and get return data.  Last I messed around with C was around 2005 if I recall right. I no longer have  C/C++ Compiler setup on my systems and was hoping for a somewhat simpler situation.  I DO NOT need screaming performance here, but need to protect some security/configuration stuff which is why I am asking?

Thanx,
Keith
Title: Re: Building a DLL with WinBatch?
Post by: spl on July 09, 2024, 02:55:14 AM
Would compiling your functions as a .wbc file be an option?
Title: Re: Building a DLL with WinBatch?
Post by: JTaylor on July 09, 2024, 05:57:02 AM
I have used the WBC format, that Stan mentioned, for that purpose.   If you want to go all the way and create an Extender there is the SDK but sounds like you would prefer the WBC format.  Just treat it like an include file, except you use Call() to load it.

Jim
Title: Re: Building a DLL with WinBatch?
Post by: td on July 09, 2024, 07:43:37 AM
Here is a brief explanation of the compiler option:

Encode for Call's from EXE files (https://docs.winbatch.com/mergedProjects/WinBatch/WINBATCH_EFC001.htm)

Title: Re: Building a DLL with WinBatch?
Post by: spl on July 09, 2024, 09:15:35 AM
You can also search for "Calling UDFs from Main Script" in the tech database. Depending on whether you would encode functions in a wbc with multiple parameters, you might want to use UDS rather than UDF.
Title: Re: Building a DLL with WinBatch?
Post by: KeithW on July 09, 2024, 06:10:25 PM
A quick read looks like a WBC may be exactly what I need, as long as I can pass/return values... even a simple array with a 1/2 dozen elements would do the trick.

There would be several functions within that module that I want to protect.

Keith