Preamble: I've been programming in PowerBuilder for 25 years and took one class in C before that so I have no idea what I'm doing and am in serious need of help.
I need to write a VERY simple C program (no user interface) that will load a 32-bit DLL, call 2 functions then release the DLL. I first used VS Code 2019 and I got a 193 when I tried to load the DLL. From what I've found it appears it's due to 64-bit system calling 32-bit DLL? I tried using VS Premium 2010 and got a 126 on the loadlibrary. The DLL in question is pborc050. Any thoughts or suggestions? Everything I found for what I'm trying to do suggested that I need to use a C program (call the function in the dll to create the powerbuilder library list then call another function to export all of the source code). This is being done for an app that is still coded in PB7 which is extremely ancient and I'm assuming is why a C program is required vs. any other newer languages.
int main(void)
{
HINSTANCE hinstLib;
MYPROC ProcAdd;
BOOL fFreeResult, fRunTimeLinkSuccess = FALSE;
// Get a handle to the pborc050.dll
hinstLib = LoadLibrary("pborc050.dll");
// If the handle is valid, try to get the function address.
if (hinstLib != NULL)
....
else
printf("The LoadLibrary(pborc050) dll handle is not valid, error: %d.\n", GetLastError());
return 0;
}