Hey all, I'm trying to make a DLL that can be used in Pascal to enable multi-threading.
I've decided I want to export Threads in C++ to a DLL. Before I make DLL's I usually write the program first to test everything then I convert it to a DLL.
#include<windows.h>
#include<stdio.h>
#include<conio.h>
#include <iostream>
DWORD Thread(LPVOID lpParameter)
{
}
void FunctionToPass()
{
//This function can be any type.. not just void.. and can have any amount of parameters.
}
int main()
{
DWORD ThreadID = 1;
HANDLE hThread = CreateThread(0, 0, Thread(*FunctionToPass()), 0, 0, &ThreadID);
}
The above does not do what I want it to do. I want it to be able to take in functions, and have the thread run them. It's actually my first time learning threads so I have no clue what I'm doing wrong. Codeblocks keeps telling me void not ignored as it ought to be.
Oh and would I actually be able to export this to a DLL? So that in any program, I can just create threads that take in functions?