Delphiman1
Programmer
I need to use some functions that are written in Visual Studio 2008 .net (VB), which was made into a dll. This dll is an 'assembly' but not strong named, and it can not be resistered.
I know the function names and parameters. When I try
loadlibrary and getprocaddress
the loadlibrary returns a value, but the getprocaddress returns a NIL value. I have tried static and dynamic methods to get to the respected functions.
I have also tried to import this dll, but I do not get any list of function names. I get a few declarations and in the implementation section, I get a uses COMobj line with nothing underneath it.
Is this possible to call any of these functions? Is there something that I have missed?
Var FuncPtr: TFarProc;
DLLHandle: THandle;
DLLHandle := LoadLibrary('Licensing_XSDL.dll');
FuncPtr := GetProcAddress(DLLHandle, 'Validate_Key');
if FuncPtr <> NIL then
begin
ShowMessage('Found it');
@Validate_Key := FuncPtr;
// tempStr := Validate_Key(LicenseInfo, True);
FuncPtr:= NIL;
end
else ShowMessage('is NIL - error = ' + IntToStr(GetLastError));
FreeLibrary(DLLHandle);
In the lines above, no matter what I try, the ShowMessage is displayed and the value of the GetLastError is 127.
Is there something that needs to be done on the VB side to expose the functions? (I did not write that part).
I know the function names and parameters. When I try
loadlibrary and getprocaddress
the loadlibrary returns a value, but the getprocaddress returns a NIL value. I have tried static and dynamic methods to get to the respected functions.
I have also tried to import this dll, but I do not get any list of function names. I get a few declarations and in the implementation section, I get a uses COMobj line with nothing underneath it.
Is this possible to call any of these functions? Is there something that I have missed?
Var FuncPtr: TFarProc;
DLLHandle: THandle;
DLLHandle := LoadLibrary('Licensing_XSDL.dll');
FuncPtr := GetProcAddress(DLLHandle, 'Validate_Key');
if FuncPtr <> NIL then
begin
ShowMessage('Found it');
@Validate_Key := FuncPtr;
// tempStr := Validate_Key(LicenseInfo, True);
FuncPtr:= NIL;
end
else ShowMessage('is NIL - error = ' + IntToStr(GetLastError));
FreeLibrary(DLLHandle);
In the lines above, no matter what I try, the ShowMessage is displayed and the value of the GetLastError is 127.
Is there something that needs to be done on the VB side to expose the functions? (I did not write that part).