Solved

Win32 API call in Delphi 3.0 DLL

Posted on 1998-06-29
4
193 Views
Last Modified: 2010-04-04
I'm very new to Delphi, so forgive me if I ask a very stupid question.  
I'm trying to write a function that returns the volume ID of a floppy. When I try to compile the DLL I get the error message: 'undeclared identifier:GetVolumeInformation'. What am I doing wrong?


library MyLib;

uses
  SysUtils,
  Classes;

function GetInfo1 : LongInt ;export;
  var
     dwTemp1, dwTemp2 : LongInt;
  begin
     GetVolumeInformation (
        PChar('A:\'),
        Nil,
        0,
        @Result,
        dwTemp1,
        dwTemp2,
        Nil,
        0
        );
  end;

  exports
    GetInfo1;
end.
0
Comment
Question by:Diver
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
ronit051397 earned 20 total points
Comment Utility
Add Windows to the uses:

uses
      SysUtils,
      Classes,
      Windows;
0
 
LVL 5

Expert Comment

by:mayhew
Comment Utility
The problem you are having is that Delphi can't find any function (or anything else) under the name GetVolumeInfo.  If the function is in another .pas file you have to include the name of that file in your uses section.

I checked in sysutils and classes and there is no GetVolumeInfo function.  I also checked through the Delphi help and saw no reference to that function.

May I ask where you found any info on a GetVolumeInfo function?

0
 
LVL 5

Expert Comment

by:ronit051397
Comment Utility
You need to call GetVolumeInformation.
0
 
LVL 1

Author Comment

by:Diver
Comment Utility
Never knew that life could be so simple :-) Thanks

0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video discusses moving either the default database or any database to a new volume.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now