Solved

Win32 API call in Delphi 3.0 DLL

Posted on 1998-06-29
4
203 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

751 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