Jump to content
Sign in to follow this  
2haerim

Calling a dll function

Recommended Posts

2haerim

Can some one help me to convert C code below to AutoIt script using DllOpen/DllCall/DllClose ?

Thanks

HaeRim

==== sample C code to be converted to AutoIt script =======

#include typedef void (__declspec(dllimport) *STARTSERVER)(char *, char *,char *,int,char *);

//void Start_server(char *ID, char *repeater,char *direct,int port,char *passwd,bool proxy);

//BETA7 typedef void (__declspec(dllimport) *STARTSERVER)(char *, char *,char *,int,char *,bool);

int main(int argc, char* argv[])

{

HMODULE hDLL = LoadLibrary ("1SCDLL.dll");

STARTSERVER pStart_server; if (hDLL != NULL)

{

pStart_server = (STARTSERVER) GetProcAddress(hDLL,"Start_server");

if (!pStart_server)

{

// handle the error

FreeLibrary(hDLL);

return 0;

}

else

{

// call the function

pStart_server("","","localhost",5500,"");

// Beta 7 pStart_server("","","localhost",5500,"",0);

}

}

return 0;

}

Edited by 2haerim

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  

×