Project1
标题:
RM用DLL快速制作
[打印本页]
作者:
yangff
时间:
2010-12-18 19:06
标题:
RM用DLL快速制作
本帖最后由 yangff 于 2010-12-18 19:12 编辑
我们知道,要熟悉并能够使用MFC6这种世界上最2,最烂,现在好像只在中国最流行的一种语言,压力有点大。
作为一个学会了C++,Pascal,Basic,PHP,Ruby……还是不会用MGC6的愚者很想写一个DLL,怎么办呢??!
有一个叫做PowerBasic的XXXXXXX可以解决这个问题……
妈的我不写了¥……¥#%%#¥要吐血
#COMPILER PBWIN 9
#COMPILE DLL
FUNCTION AddOne (BYVAL x AS LONG) EXPORT AS LONG
FUNCTION = x + 1
END FUNCTION
复制代码
就这么简单……
完整时这样的
'===============================================================================
'
' Generic DLL Template for PowerBASIC for Windows
' Copyright (c) 1997-2005 PowerBASIC, Inc.
' All Rights Reserved.
'
' LIBMAIN function Purpose:
'
' User-defined function called by Windows each time a DLL is loaded into,
' and unloaded from, memory. In 32-bit Windows, LibMain is called each
' time a DLL is loaded by an application or process. Your code should
' never call LibMain explicitly.
'
' hInstance is the DLL instance handle. This handle is used by the
' calling application to identify the DLL being called. To access
' resources in the DLL, this handle will need to be stored in a global
' variable. Use the GetModuleHandle(BYVAL 0&) to get the instance
' handle of the calling EXE.
'
' fdwReason specifies a flag indicating why the DLL entry-point
' (LibMain) is being called by Windows.
'
' lpvReserved specifies further aspects of the DLL initialization
' and cleanup. If fdwReason is %DLL_PROCESS_ATTACH, lpvReserved is
' NULL (zero) for dynamic loads and non-NULL for static loads. If
' fdwReason is %DLL_PROCESS_DETACH, lpvReserved is NULL if LibMain
' has been called by using the FreeLibrary API call and non-NULL if
' LibMain has been called during process termination.
'
' Return
'
' If LibMain is called with %DLL_PROCESS_ATTACH, your LibMain function
' should return a zero (0) if any part of your initialization process
' fails or a one (1) if no errors were encountered. If a zero is
' returned, Windows will abort and unload the DLL from memory. When
' LibMain is called with any other value than %DLL_PROCESS_ATTACH, the
' return value is ignored.
'
'===============================================================================
#COMPILER PBWIN 9
#COMPILE DLL
%USEMACROS = 1
#INCLUDE "Win32API.inc"
GLOBAL ghInstance AS DWORD
'-------------------------------------------------------------------------------
' Main DLL entry point called by Windows...
'
FUNCTION LIBMAIN (BYVAL hInstance AS LONG, _
BYVAL fwdReason AS LONG, _
BYVAL lpvReserved AS LONG) AS LONG
SELECT CASE fwdReason
CASE %DLL_PROCESS_ATTACH
'Indicates that the DLL is being loaded by another process (a DLL
'or EXE is loading the DLL). DLLs can use this opportunity to
'initialize any instance or global data, such as arrays.
ghInstance = hInstance
FUNCTION = 1 'success!
'FUNCTION = 0 'failure! This will prevent the EXE from running.
CASE %DLL_PROCESS_DETACH
'Indicates that the DLL is being unloaded or detached from the
'calling application. DLLs can take this opportunity to clean
'up all resources for all threads attached and known to the DLL.
FUNCTION = 1 'success!
'FUNCTION = 0 'failure!
CASE %DLL_THREAD_ATTACH
'Indicates that the DLL is being loaded by a new thread in the
'calling application. DLLs can use this opportunity to
'initialize any thread local storage (TLS).
FUNCTION = 1 'success!
'FUNCTION = 0 'failure!
CASE %DLL_THREAD_DETACH
'Indicates that the thread is exiting cleanly. If the DLL has
'allocated any thread local storage, it should be released.
FUNCTION = 1 'success!
'FUNCTION = 0 'failure!
END SELECT
END FUNCTION
'-------------------------------------------------------------------------------
' Examples of exported Subs and functions...
'
FUNCTION MyFunction1 ALIAS "MyFunction1" (BYVAL Param1 AS LONG) EXPORT AS LONG
' code goes here
MSGBOX "MYDLL.DLL has recevied: " + STR$(Param1)
FUNCTION = 1 ' return 1 to calling program
END FUNCTION
SUB MySub1 ALIAS "MySub1" (BYVAL Param1 AS LONG) EXPORT
' code goes here
END SUB
复制代码
简单多了啊~
作者:
天朝坦克
时间:
2010-12-18 19:20
坚决的沙发,一年多不见YANG腐腐果然有进化成神的潜力呢
作者:
幻想乡茶农
时间:
2010-12-18 19:23
头像闪亮
作者:
偶尔杀人越货
时间:
2010-12-18 19:29
如果前后都没有那不成没图案的一元硬币了?
PS.我只知道WN没有XJJ
作者:
坂田银时
时间:
2010-12-18 19:51
你好啊
作者:
yangff
时间:
2010-12-19 10:59
好吧我承认我是来展示我的头像的……
作者:
逸豫
时间:
2010-12-19 11:19
MFC三聚氰胺贴面板
三聚氰胺环保板,一种以刨花板为基材,表面经“三聚氰胺”(MELAMINE)专业加工处理,具耐磨,抗刻划,耐高温,易清洁,耐酸碱等优点的复合型饰板,英文简称为MFC(三聚氰胺贴面板)。MFC广泛被采用为板式家具,办公家具及厨房家具的主要用材。
我才不是来吐槽的呢- -
作者:
雪流星
时间:
2010-12-19 12:37
我是來打醬....打招呼的
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1