Jump to content
Sign in to follow this  
Borje

[ SOLVED ] How to use api call

Recommended Posts

Borje

Hello all

Is that anybody here can help me with this.

How to use api call to example a file "test.dll" and then have result as a string

If the test.dll have EP_harwareID what must I do then to call this EP_harwareID and have the result back as a string ?

Please can any one give some example..

Thanks

Edited by Borje

Share this post


Link to post
Share on other sites
SimonWebstation

The Dll must have your function an this function you can call witch DllCall


mfg. SimonMany of my answers are translated of google, because I'am from Germany

Share this post


Link to post
Share on other sites
Borje

Yes my dll has this function..

But my question is how to use the dllcall to call this ?

Share this post


Link to post
Share on other sites
boogieoompa

Not sure if this is what you are looking for but here is a sample API call from one of my scripts that saves it to a variable. This is the only way I know how to do it and the paramaters obviously need to change dependign on the DLL being referenced but something like this...

$key = DllStructGetData($tRI_KD, 'VKey')

Share this post


Link to post
Share on other sites
Borje

No I have try DllCall("test.dll", "int", "EP_RegHardwareID")

but that is not working.

Edited by Borje

Share this post


Link to post
Share on other sites
PsaltyDS

DllCall() and the DllStruct* functions can probably do the job, but you have to provide more interface details. There are too many ways it could be done to guess how this DLL was designed. Do you have a link to the interface description? Or contact with the DLL's coder?

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
Borje

The only I know is this from a visual basic code

Public Declare Function EP_RegHardwareID Lib "test.dll" () As String

Share this post


Link to post
Share on other sites
PsaltyDS

The only I know is this from a visual basic code

Public Declare Function EP_RegHardwareID Lib "test.dll" () As String

Try the source forum: Enigma Protector

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
Borje

I have contact with the developer of this dll file and the answer from him is:

You can use Enigma API in your project, for example, to get hardware

id just call EP_RegHardwareID function, it will return current

hardware id. So you will be able to show it.

And my question is what I need to do for call this EP_RegHardwareID I can not

find out what I should do..

Share this post


Link to post
Share on other sites
Inverted

What does the function return ? A string,a value ? What sized value ?

And remember that it returns an array, not just the return value.

Try this :

$return = DllCall("test.dll", "int", "EP_RegHardwareID")

MsgBox (4096, "", $return[0])

Or try other parameter instead of "int" if it doesn't work.

Edited by Inverted

Share this post


Link to post
Share on other sites
Borje

Thank you Inverted.

Your example works exactly as I want it to do..

Thanks again..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.