设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2078|回复: 7
打印 上一主题 下一主题

[原创发布] RM用DLL快速制作

[复制链接]

Lv2.观梦者

傻♂逼

梦石
0
星屑
374
在线时间
1606 小时
注册时间
2007-3-13
帖子
6562

烫烫烫开拓者

跳转到指定楼层
1
发表于 2010-12-18 19:06:54 | 只看该作者 回帖奖励 |正序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 yangff 于 2010-12-18 19:12 编辑

我们知道,要熟悉并能够使用MFC6这种世界上最2,最烂,现在好像只在中国最流行的一种语言,压力有点大。
作为一个学会了C++,Pascal,Basic,PHP,Ruby……还是不会用MGC6的愚者很想写一个DLL,怎么办呢??!
有一个叫做PowerBasic的XXXXXXX可以解决这个问题……
妈的我不写了¥……¥#%%#¥要吐血
  1. #COMPILER PBWIN 9
  2. #COMPILE DLL

  3. FUNCTION AddOne (BYVAL x AS LONG) EXPORT AS LONG

  4.     FUNCTION = x + 1

  5. END FUNCTION
复制代码
就这么简单……
完整时这样的
  1. '===============================================================================
  2. '
  3. '  Generic DLL Template for PowerBASIC for Windows
  4. '  Copyright (c) 1997-2005 PowerBASIC, Inc.
  5. '  All Rights Reserved.
  6. '
  7. '  LIBMAIN function Purpose:
  8. '
  9. '    User-defined function called by Windows each time a DLL is loaded into,
  10. '    and unloaded from, memory. In 32-bit Windows, LibMain is called each
  11. '    time a DLL is loaded by an application or process.  Your code should
  12. '    never call LibMain explicitly.
  13. '
  14. '    hInstance is the DLL instance handle.  This handle is used by the
  15. '    calling application to identify the DLL being called.  To access
  16. '    resources in the DLL, this handle will need to be stored in a global
  17. '    variable.  Use the GetModuleHandle(BYVAL 0&) to get the instance
  18. '    handle of the calling EXE.
  19. '
  20. '    fdwReason specifies a flag indicating why the DLL entry-point
  21. '    (LibMain) is being called by Windows.
  22. '
  23. '    lpvReserved specifies further aspects of the DLL initialization
  24. '    and cleanup.  If fdwReason is %DLL_PROCESS_ATTACH, lpvReserved is
  25. '    NULL (zero) for dynamic loads and non-NULL for static loads.  If
  26. '    fdwReason is %DLL_PROCESS_DETACH, lpvReserved is NULL if LibMain
  27. '    has been called by using the FreeLibrary API call and non-NULL if
  28. '    LibMain has been called during process termination.
  29. '
  30. ' Return
  31. '
  32. '    If LibMain is called with %DLL_PROCESS_ATTACH, your LibMain function
  33. '    should return a zero (0) if any part of your initialization process
  34. '    fails or a one (1) if no errors were encountered.  If a zero is
  35. '    returned, Windows will abort and unload the DLL from memory. When
  36. '    LibMain is called with any other value than %DLL_PROCESS_ATTACH, the
  37. '    return value is ignored.
  38. '
  39. '===============================================================================

  40. #COMPILER PBWIN 9
  41. #COMPILE DLL

  42. %USEMACROS = 1
  43. #INCLUDE "Win32API.inc"

  44. GLOBAL ghInstance AS DWORD


  45. '-------------------------------------------------------------------------------
  46. ' Main DLL entry point called by Windows...
  47. '
  48. FUNCTION LIBMAIN (BYVAL hInstance   AS LONG, _
  49.                   BYVAL fwdReason   AS LONG, _
  50.                   BYVAL lpvReserved AS LONG) AS LONG

  51.     SELECT CASE fwdReason

  52.     CASE %DLL_PROCESS_ATTACH
  53.         'Indicates that the DLL is being loaded by another process (a DLL
  54.         'or EXE is loading the DLL).  DLLs can use this opportunity to
  55.         'initialize any instance or global data, such as arrays.

  56.         ghInstance = hInstance

  57.         FUNCTION = 1   'success!

  58.         'FUNCTION = 0   'failure!  This will prevent the EXE from running.

  59.     CASE %DLL_PROCESS_DETACH
  60.         'Indicates that the DLL is being unloaded or detached from the
  61.         'calling application.  DLLs can take this opportunity to clean
  62.         'up all resources for all threads attached and known to the DLL.

  63.         FUNCTION = 1   'success!

  64.         'FUNCTION = 0   'failure!

  65.     CASE %DLL_THREAD_ATTACH
  66.         'Indicates that the DLL is being loaded by a new thread in the
  67.         'calling application.  DLLs can use this opportunity to
  68.         'initialize any thread local storage (TLS).

  69.         FUNCTION = 1   'success!

  70.         'FUNCTION = 0   'failure!

  71.     CASE %DLL_THREAD_DETACH
  72.         'Indicates that the thread is exiting cleanly.  If the DLL has
  73.         'allocated any thread local storage, it should be released.

  74.         FUNCTION = 1   'success!

  75.         'FUNCTION = 0   'failure!

  76.     END SELECT

  77. END FUNCTION


  78. '-------------------------------------------------------------------------------
  79. ' Examples of exported Subs and functions...
  80. '
  81. FUNCTION MyFunction1 ALIAS "MyFunction1" (BYVAL Param1 AS LONG) EXPORT AS LONG

  82.     ' code goes here
  83.     MSGBOX "MYDLL.DLL has recevied: " + STR$(Param1)
  84.     FUNCTION = 1  ' return 1 to calling program

  85. END FUNCTION


  86. SUB MySub1 ALIAS "MySub1" (BYVAL Param1 AS LONG) EXPORT

  87.     ' code goes here

  88. END SUB
复制代码
简单多了啊~

评分

参与人数 2星屑 +100 收起 理由
禾西 + 10 說明美——我說的是頭像
偶尔杀人越货 + 90 我勒个去,不当BZ才能给这么点分.

查看全部评分

Lv2.观梦者

天仙

梦石
0
星屑
645
在线时间
184 小时
注册时间
2008-4-15
帖子
5023

贵宾

8
发表于 2010-12-19 12:37:36 | 只看该作者
我是來打醬....打招呼的
VA脚本开工中...
偷窃脚本1.0 - 已完成
回复 支持 反对

使用道具 举报

Lv3.寻梦者

宛若

梦石
0
星屑
1663
在线时间
528 小时
注册时间
2007-8-19
帖子
1493

极短24参与开拓者

7
发表于 2010-12-19 11:19:28 | 只看该作者
MFC三聚氰胺贴面板
  三聚氰胺环保板,一种以刨花板为基材,表面经“三聚氰胺”(MELAMINE)专业加工处理,具耐磨,抗刻划,耐高温,易清洁,耐酸碱等优点的复合型饰板,英文简称为MFC(三聚氰胺贴面板)。MFC广泛被采用为板式家具,办公家具及厨房家具的主要用材。
我才不是来吐槽的呢- -
[url=http://rpg.blue/thread-219730-1-1.html]http://unhero.sinaapp.com/wi.php[/url]
[color=Red]如你所见这是个死坑,没错这就是打我的脸用的[/color]
回复 支持 反对

使用道具 举报

Lv2.观梦者

傻♂逼

梦石
0
星屑
374
在线时间
1606 小时
注册时间
2007-3-13
帖子
6562

烫烫烫开拓者

6
 楼主| 发表于 2010-12-19 10:59:09 | 只看该作者
好吧我承认我是来展示我的头像的……
哎呀,蛋疼什么的最有爱了
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
190
在线时间
1 小时
注册时间
2010-8-19
帖子
2
5
发表于 2010-12-18 19:51:29 | 只看该作者
你好啊   
回复 支持 反对

使用道具 举报

Lv1.梦旅人

敌敌畏

梦石
0
星屑
80
在线时间
52 小时
注册时间
2008-5-12
帖子
1748
4
发表于 2010-12-18 19:29:09 | 只看该作者
如果前后都没有那不成没图案的一元硬币了?
PS.我只知道WN没有XJJ
回复 支持 反对

使用道具 举报

Lv1.梦旅人

青山绿水长留生

梦石
0
星屑
50
在线时间
369 小时
注册时间
2010-12-17
帖子
442
3
发表于 2010-12-18 19:23:03 | 只看该作者
头像闪亮

点评

我本来就不想设置头像的……  发表于 2010-12-18 19:58
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
45
在线时间
79 小时
注册时间
2010-8-18
帖子
174
2
发表于 2010-12-18 19:20:37 | 只看该作者
坚决的沙发,一年多不见YANG腐腐果然有进化成神的潜力呢
最近开始忙,暂时不会更新什么了
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2025-7-28 23:44

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表