Sign in to follow this  
Followers 0
dok_do

dllcall parameter

1 post in this topic

#1 ·  Posted (edited)

----------------------------->dll.h<---------------------

#ifndef _DLL_H_

#define _DLL_H_

#if BUILDING_DLL

# define DLLIMPORT __declspec (dllexport)

#else /* Not BUILDING_DLL */

# define DLLIMPORT __declspec (dllimport)

#endif /* Not BUILDING_DLL */

extern "C" __declspec(dllexport) int vectors(int *arr);

class DLLIMPORT DllClass

{

public:

DllClass();

virtual ~DllClass(void);

private:

};

#endif /* _DLL_H_ */

--------------------------------->dll.cpp<-----------

#include "dll.h"

#include <windows.h>

#include <algorithm>

using namespace std;

DllClass::DllClass()

{

}

DllClass::~DllClass ()

{

}

BOOL APIENTRY DllMain (HINSTANCE hInst /* Library instance handle. */ ,

DWORD reason /* Reason this function is being called. */ ,

LPVOID reserved /* Not used. */ )

{

switch (reason)

{

case DLL_PROCESS_ATTACH:

break;

case DLL_PROCESS_DETACH:

break;

case DLL_THREAD_ATTACH:

break;

case DLL_THREAD_DETACH:

break;

}

/* Returns TRUE on success, FALSE on failure */

return TRUE;

}

extern "C" __declspec(dllexport) int vectors(int *arr)

{

int *ptr;

ptr = find (arr, arr+8, 33);

return (ptr-arr);

}

------------------------------------------>autoit3 source

Dim $var[8]

$var[0]=11

$var[1]=22

$var[2]=33

$var[3]=44

$var[4]=55

$var[5]=66

$var[6]=77

$var[7]=88

$result = DllCall("vectordll.dll", "int", "vectors","int_ptr",$var)

;$var ??????????

msgbox(0, "", $result[0])

----------------------------------------------------------------------

hi

Im Korean so, Im not good at English.

I make dll,using stl(Standard Template Library)

but,it does not work

how can I make the script move array to the vectordlls parameter?

http://www.sgi.com/tech/stl/find.html

vectordll.dll

Edited by dok_do

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  
Followers 0