LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What to put in preprocessor definitions in Import Shared Library Wizard

Solved!
Go to solution

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.

 

1.png

 

Any pointer would be appreciated.

0 Kudos
Message 1 of 7
(3,098 Views)

@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

0 Kudos
Message 2 of 7
(3,076 Views)

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.

0 Kudos
Message 3 of 7
(3,055 Views)

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

0 Kudos
Message 4 of 7
(3,040 Views)

@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.


2.png

 

Thank you for the help!

0 Kudos
Message 5 of 7
(3,030 Views)
Solution
Accepted by topic author Chickentree

This would be a possible implementation for this function.

Generate Key.png

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!

Rolf Kalbermatter
My Blog
Message 6 of 7
(3,014 Views)

Thank you, rolfk. It works! When I tried configuring each parameter for the Call Library Function Node, I put something wrong.

0 Kudos
Message 7 of 7
(3,003 Views)