8

I use OutputDebugString in my Delphi Code, but I receive the error:

Error: Undeclared identifier: 'OutputDebugString'

Which package is this OutputDebugString in?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
spspli
  • 3,128
  • 11
  • 48
  • 75
  • 2
    Useful tip in future; In a unit that has it working, Ctrl-Click and it will find the unit containing the symbol. And in Delphi recent versions, F1 on OutputDebugString might get you some help too. – Warren P Aug 11 '11 at 23:18
  • Instead of Ctrl-Cick, I prefer to use "Find definition" from the context menu (or is it "Find declaration"?). I keep forgetting all those key-key and key-mouse combinations. – Rudy Velthuis Aug 11 '11 at 23:37
  • 2
    ...or hover your mouse cursor over the symbol and see the help insight (in a unit that has it working). – Ondrej Kelle Aug 12 '11 at 05:43
  • Personally I prefer Windows Search 4. At the beginning you just need to explain it that pas-files are "plain text" and point it to directories which should be indexed. – Torbins Aug 12 '11 at 07:03
  • @Torbins - I prefer source searching too, because some classes are defined in more than one namespace - for instance TBitmap; it's in [Graphics.pas](http://docwiki.embarcadero.com/VCL/en/Graphics.TBitmap) as well as in [Windows.pas](http://msdn.microsoft.com/en-us/library/dd183371%28v=vs.85%29.aspx) but they mean totally different thing. There I wouldn't rely on the methods mentioned above; even if they are much more faster than this searching. But hey, isn't there some tool, some class explorer for this, something in CnPack or another IDE extension ? –  Aug 12 '11 at 07:31
  • If not it would be fine to create one. As a starting version would be enough to search *.pas (*.inc and whatever) files in predefined directories for `TClassYoureLookingFor =` –  Aug 12 '11 at 07:34
  • Windows Search 4 is extremely fast. I never had a need of something faster. – Torbins Aug 14 '11 at 17:09

2 Answers2

21

It's declared in the Windows unit.

Mason Wheeler
  • 82,511
  • 50
  • 270
  • 477
1

In windows unit in Winapi namespace:

uses
   Winapi.Windows;

How to find the unit of a specific command:

  • Through Find Definition command in the context menu
  • Through Help Insight information invoked by hovering the mouse
  • Or just use Windows Search or a popular search tool
Charlie
  • 22,886
  • 11
  • 59
  • 90