Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Delphiµ÷ÓÃVC++6.0±àдµÄDll

ÓÃVC++6.0±àдÁËÒ»¸ö¼òµ¥µÄdll£¬ÀïÃæ°üº¬Ò»¸ö¼õ·¨º¯Êýsubtract(int a,int b)£¬DllÃüÃûΪff.Dll
´úÂëÈçÏ£º
1.ff.cpp:
// ff.cpp : Defines the entry point for the DLL application.
//
#include "StdAfx.h"
#include "ff.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
FF_API int nFf=0;
// This is an example of an exported function.
FF_API int fnFf(void)
{
 return 42;
}
// This is the constructor of a class that has been exported.
// see ff.h for the class definition
CFf::CFf()
{
 return;
}
FF_API int subtract(int a,int b)
{
 return (a-b);
}
2.StdAfx.cpp:
// stdafx.cpp : source file that includes just the standard includes
// ff.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
#ifdef FF_EXPORTS
#define FF_API __declspec(dllexport)
#else
#define FF_API __declspec(dllimport)
#endif
// This class is exported from the ff.dll
class FF_API CFf {
public:
 CFf(void);
 // TODO: add your methods here.
};
extern FF_API int nFf;
FF_API int fnFf(void);
extern "C" FF_API int subtract(int a,int b);
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
3.ff.h:
// The following ifdef block is the standard way of creating macros which make ex


Ïà¹ØÎĵµ£º

delphi ½Å±¾ÒýÇæ±È½Ï

TMS Scripter£ºÖ§³ÖPascalºÍVBScriptÁ½ÖÖÓï·¨¡£ÓŵãÊÇÎĵµÆëÈ«¡¢Àý×ÓÆëÈ«£¬½Å±¾¿ÉÖ±½ÓÖ§³ÖDLL£¬¹Ù·½»¹ÌṩÁ˷ḻµÄIDE Debug¹¤¾ß¡¢µ¥Ôªµ¼³öº¯Êý¹¤¾ßµÈ£¬È±µãÊDZàÒëÔËÐнÏÂý¡£for ¿ÕÑ­»·1000Íò´Î£¬ÐèÒª10ÃëÖÓÒÔÉÏ¡£TMS ScripterÊÇÉÌÒµ¹²ÏíÈí¼þ¡£
       FastScript£ºÓùýFastReport±¨±íµÄÍ¬Ñ ......

ÓÃDELPHI´´½¨DLLÎļþ£¬·â×°´°ÌåµÄʵÏÖ·½·¨ÊµÀý

ËäÊÇÔ­´´£¬µ«ÊÇÊDzο¼¹ý±ðÈ˵Ä×÷Æ·£¬È»ºó×Ô¼ºÖØÐÂдµÄ£¬Ä¿µÄÊÇÒª¸ø³õѧÕßÒ»¸ö¸üÈÝÒ×Ã÷°×¡£
ÓÃDELPHI´´½¨DLLÎļþ£¬·â×°´°ÌåµÄʵÏÖ·½·¨ÊµÀý£º
¼´Ò»¸ö³ÌÐò²»ÔÙÊǵ¥Ò»µÄÒ»¸öEXEÎļþÁË£¬¶øÊÇÓÉÒ»¸öEXEÎļþ¼ÓN¸öDLLÎļþ×é³É£¬ÕâÑù×öµÄÔ­ÒòÊÇ·½±ãÒÔºóµÄά»¤Óë¸üУ¬Ò²ÊÇ¿çƽ̨¿ª·¢µÄÖØÒªÒ»²½¡£
1£¬ ´ò¿ªDELPHI£¬Ð½¨Ò»¸öDl ......

C/C++ÄÚ´æ¹ÜÀíÖ®ÄÚ´æй©¼ì²é

Ò»£®   ¸ÅÊö
    ÄÚ´æй©һֱÊÇÈí¼þ¿ª·¢ÈËÔ±×îÍ·´óµÄÎÊÌâÖ®Ò»£¬ÓÈÆäÏñC/C++ÕâÑù×ÔÓɶȷdz£´óµÄ±à³ÌÓïÑÔ£¬¼¸ºõÊÇÿһ¸öÓÃÆ俪·¢³öÀ´µÄÈí¼þ¶¼»á³öÏÖÄÚ´æй©µÄÇé¿ö¡£
    Èç¹ûûÓÐÄÚ´æй©£¬ÊÀ½ç»òÐí»á±äµÄÃÀºÃ¡£È»¶ø£¬ÍêÈ«ÃÀºÃµÄÊÀ½çÊDz»´æÔڵģ¬ÎÒÃÇÄÜ×öµÄ¾ÍÊǾ¡Á¿ÈÃËü±äµÄ¸üÃÀ ......

C/C++ÄÚ´æ·ÖÅä


#include <iostream>
using namespace std;
void main()
{
 char *p,*q;
 p = "abcde";
 q = p + 3;
 *q = 't';
 cout<<p<<endl;
 cout<<q<<endl;
}
Á½ÖÖÓïÑÔ±àÒ붼¿ÉÒÔͨ¹ý
µ±Ö´Ðе½
 *q = 't';
ʱ£¬C++³ÌÐò³öÏÖÄÚ´æ·ÃÎÊ´íÎó£¬C³ÌÐò¿ÉÒ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ