Solved

Win32 API call in Delphi 3.0 DLL

Posted on 1998-06-29
4
199 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

786 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