VC#开发的DLL中的函数式在一个类中的
请问在InstallScript中应该怎么调用DLL类中的一个函数呢

解决方案 »

  1.   

    prototype [CallingConvention] [ReturnType] DLLName.FunctionName( ParamType1, ParamType2, ... );
      

  2.   

    For example:1.   prototype BOOL MyDLL.MyFunction( INT, INT, INT );
    2.   UseDLL( SUPPORTDIR ^ "MyDLL.dll" );
    3.   bResult = MyDLL.MyFunction( nInt1, nInt2, nInt3 );
      

  3.   

    #define DLL_FILE  "MyDLL.dll;"   // Prototype MydllReturn in Mydll.dll.   prototype  Mydll.MydllReturn (INT, BYREF STRING);   STRING  svString;   INT     nValue;   NUMBER  nResult;   BOOL    bDone;#include "ifx.h"program   // Load the dll into memory.   nResult = UseDLL (DLL_FILE);   if (nResult = 0) then      MessageBox ("UseDLL successful \n\n.DLL file loaded.", INFORMATION);   else      MessageBox ("UseDLL failed.\n\nCouldn't load .DLL file.", INFORMATION);      abort;   endif;   // bDone controls the following while loop.   bDone = FALSE;   // Loop while bDone is FALSE.   while (bDone = FALSE)      // Disable the Back button in setup dialogs.      Disable (BACKBUTTON);      // Get a string from the euser.      AskText ("Enter an example string.", "Example string.", svString);      // Get the string length to pass to MydllReturn.      nValue = StrLength (svString);      // Call MydllReturn.       MydllReturn (nValue, svString);      // Display the string to observe how it was altered by MydllReturn.      SprintfBox (INFORMATION, "UseDLL", "MydllReturn() changed the string " +                 "to: %s", svString);       // Give the user a chance to do another example.      if (AskYesNo ("Do another example?", YES) = NO) then         bDone = TRUE;      endif;   endwhile;   // Remove the dll from memory.   if (UnUseDLL (DLL_FILE) < 0) then      MessageBox ("UnUseDLL failed.\n\nDLL still in memory.", SEVERE);   else      MessageBox ("UnUseDLL successful.\n\n.DLL file removed from memory.",                 INFORMATION);   endif;endprogram
      

  4.   

    www.installsite.org上有各种例子!
      

  5.   

    我还是不明白,一个C#的DLL文件中首先有一个命名空间,命名空间中包含一个类,类中才包含一个函数,我总不会直接用DLL文件名就调用其中的函数吧。
    谁能不能提供一个VC# 开发DLL的简单例子然后给出在InstallScript中的调用方法呢?送满分