2017-08-23 25 views
3

Microsoft開發人員網絡MSDN包含有用的文檔化功能,這些功能對於瞭解Windows應用程序開發人員以及保持更新狀態是必需的。如何在msdn中找到等效的C++函數的delphi函數?

例如,here中的shellexecute函數已有詳細記錄(由Embarcadero Technologies翻譯)。

function ShellExecute; external shell32 name 'ShellExecuteW'; 

然而,用於解釋這些功能的語言是c/C++(不抱怨或任何事情)。

要找到這些函數的等價位置(如果它存在與否是另一個問題)可能很難。

比如我在尋找這個function相當於:

DWORD CreateIpNetEntry(
    _In_ PMIB_IPNETROW pArpEntry 
); 

現在,這將是毫無意義的總是來問這裏,我可以每次我遇到問題找到等價的。所以我的問題是:

有沒有辦法知道是否有相當於/翻譯到MSDN的C++函數在delphi和在哪裏可以找到它們(單位)?

+1

嘗試[JEDI頭文件](https://sourceforge.net/projects/jedi-apilib/)(在本例中爲[JwaIpHlpApi.pas]中的函數(https://sourceforge.net/p/jedi-apilib /code/HEAD/tree/jwapi/trunk/Win32API/JwaIpHlpApi.pas#l254)和[JwaIpRtrMib.pas]中使用的結構(https://sourceforge.net/p/jedi-apilib/code/HEAD/tree/ jwapi /主幹/ Win32API的/ JwaIpRtrMib.pas#L785))。在那裏翻譯的許多原型比用Delphi發佈的原型更精確。 – Victoria

+0

@維多利亞感謝這是我第一次聽說它 –

+0

不客氣,不好意思。我誤解了你的問題。 – Victoria

回答

4

您可以通過簡單地搜索Delphi源文件夾找到是否翻譯了某個特定的API函數。

任何文件搜索工具都將提供必要的用途,包括內置的Find in Files

+0

「在文件中查找」對我來說真的很適合多年。 – kobik

+0

@kobik,在文件中查找用於包含的文件(或包含的子目錄中的文件)。當然,這需要Delphi源文件。 – Victoria

+1

這是真的,沒有源,然後你卡住了。但是如果你有來源,那麼這肯定是最可靠的方法。 –

4

這在Finding Units主題描述:

Editing Delphi code in the Code Editor, you can use the Find Unit refactoring dialog box to locate and add units to your code. The Find Unit dialog appears when you select an identifier in the Code Editor and select the Refactor > Find Unit menu command. The operation attempts to find the appropriate unit containing the definition of the selected identifier, and then adds the selected unit to the uses clause. You can select multiple units to add to the uses clause. To find and add a unit to the uses clause:

  1. In the Code Editor, click an identifier whose unit you want to add to the uses clause.
  2. Choose the Refactor > Find Unit menu command. The Find Unit dialog box displays a selection list of applicable Delphi units.
  3. Select the unit that you want to add to the uses clause in the current scope. You can select as many units as you want.
  4. Choose where to insert the reference, either in the interface section or in the implementation section.
  5. Click OK. The uses clause is updated with the selected units.

或者,如果你有德爾福的源代碼,你可以grep Delphi源文件夾中。

+1

在步驟3的搜索框中寫入函數的名稱似乎工作正常。 –

+0

我第一次嘗試使用這個重構工具導致了這個錯誤:* System.OutOfMemoryException:類型'System.OutOfMemoryException'的異常被拋出。*通過重啓來修復。之後,重構工具正常工作,但即使存在翻譯,也未能找到函數「CreateIpNetEntry」。結論,不要使用這個工具。改用搜索。 –

+0

@David,哇,它失敗了,你是結論?如果你有Starter怎麼辦? – Victoria