Solved

Win32 API call in Delphi 3.0 DLL

Posted on 1998-06-29
4
195 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
ID: 1356325
Add Windows to the uses:

uses
      SysUtils,
      Classes,
      Windows;
0
 
LVL 5

Expert Comment

by:mayhew
ID: 1356326
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
ID: 1356327
You need to call GetVolumeInformation.
0
 
LVL 1

Author Comment

by:Diver
ID: 1356328
Never knew that life could be so simple :-) Thanks

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

867 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

20 Experts available now in Live!

Get 1:1 Help Now