11-15-2017 02:57 PM
Hello,
I have the same header file shown in the following webpage (except for the KeyGeneration.cpp portion at the end).
https://cboard.cprogramming.com/c-programming/121725-reg-problem-creating-dll.html
I have a DLL file that generates a key array from a seed array input. I tried using the Import Shared Library and I got the following message. It seems I have to put something in the preprocessor definitions.
Any pointer would be appreciated.
Solved! Go to Solution.
11-15-2017 04:53 PM
@Chickentree wrote:
Any pointer would be appreciated.
We dont use pointers in LabVIEW :). All jokes aside, can you post the .h file so I can take a look.
Is the DLL just the single function you mentioned, or is there more?
0xDEAD
11-16-2017 08:44 AM
deceased wrote:We dont use pointers in LabVIEW :). All jokes aside, can you post the .h file so I can take a look.
Is the DLL just the single function you mentioned, or is there more?
Hello, deceased. Here is the h file. It seems the DLL has that one function: GenerateKeyEx().
Thanks.
11-16-2017 01:27 PM
Any knowledge of how big the seed array and output array need to be?
I can make something for you to test but you need to preallocate these buffers in LV.
Best regards,
0xDEAD
11-16-2017 02:18 PM
@deceased wrote:
Any knowledge of how big the seed array and output array need to be?
I can make something for you to test but you need to preallocate these buffers in LV.
Thank you for the help!
11-16-2017 04:34 PM - edited 11-16-2017 04:39 PM
This would be a possible implementation for this function.
While the import library wizard can be helpful it can not cleanly handle the array parameters and the related size parameters for this function as it does not know how the different parameters relate to each other. There is even a small chance that I got it wrong, from the limited information available, but I can guess from the names of the parameters how they relate to each other. Letting a computer guess is always like playing vabanque. It may go right but most likely it doesn't and here that means a crash.
Note that I connected the return value of the function directly to the error generator VI. This is not really correct as the returned error codes do not map one to one to the LabVIEW used error codes except for code 0 indicating no error!
11-16-2017 08:29 PM
Thank you, rolfk. It works! When I tried configuring each parameter for the Call Library Function Node, I put something wrong.