wolf9228 Posted November 17, 2008 Share Posted November 17, 2008 (edited) ALL FILES ProjectsAutoit_Win32_Dll.dllAutoit_Win32_Dll.AU3http://www.2shared.com/file/4295058/db0d54..._Win32_Dll.htmlAutoit_Win32_Dll.cppexpandcollapse popup// Autoit_Win32_Dll.cpp : Defines the entry point for the DLL application. // #include "stdafx.h" #include "Autoit_Win32_Dll.h" BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: case DLL_PROCESS_DETACH: break; } return TRUE; } // This is an example of an exported variable AUTOIT_WIN32_DLL_API int nAutoit_Win32_Dll=0; // This is an example of an exported function. AUTOIT_WIN32_DLL_API int fnAutoit_Win32_Dll(void) { return 42; } // This is the constructor of a class that has been exported. // see Autoit_Win32_Dll.h for the class definition CAutoit_Win32_Dll::CAutoit_Win32_Dll() { return; } int MyMsgBox() { MessageBox(NULL, "Hello World", "Ok", NULL); return 1; }Autoit_Win32_Dll.h// The following ifdef block is the standard way of creating macros which make exporting // from a DLL simpler. All files within this DLL are compiled with the AUTOIT_WIN32_DLL_EXPORTS // symbol defined on the command line. this symbol should not be defined on any project // that uses this DLL. This way any other project whose source files include this file see // AUTOIT_WIN32_DLL_API functions as being imported from a DLL, wheras this DLL sees symbols // defined with this macro as being exported. #ifdef AUTOIT_WIN32_DLL_EXPORTS #define AUTOIT_WIN32_DLL_API __declspec(dllexport) #else #define AUTOIT_WIN32_DLL_API __declspec(dllimport) #endif // This class is exported from the Autoit_Win32_Dll.dll class AUTOIT_WIN32_DLL_API CAutoit_Win32_Dll { public: CAutoit_Win32_Dll(void); // TODO: add your methods here. }; extern AUTOIT_WIN32_DLL_API int nAutoit_Win32_Dll; AUTOIT_WIN32_DLL_API int fnAutoit_Win32_Dll(void); extern "C" __declspec(dllexport) int MyMsgBox();$dll = DllOpen(@ScriptDir & "\Autoit_Win32_Dll.dll") $result = DllCall($dll, "int", "MyMsgBox") DllClose($dll) Edited November 17, 2008 by wolf9228 صرح السماء كان هنا Link to comment Share on other sites More sharing options...
Skrip Posted November 17, 2008 Share Posted November 17, 2008 Cool, thanks for the post. This could be useful... [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
zaini Posted November 17, 2008 Share Posted November 17, 2008 hoho...script is really nice.. thanks for sharing.. I'm little bit advance now... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now