Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Win32 API call in Delphi 3.0 DLL

Posted on 1998-06-29
4
Medium Priority
?
207 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 80 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

916 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