I am trying to import dll in my delphi-prism program and never done it before. So, after finding some answer online, I put something together as follows but doesn't work.
MyUtils = public static class
private
[DllImport("winmm.dll", CharSet := CharSet.Auto)]
method timeBeginPeriod(period:Integer):Integer; external;
protected
public
constructor;
end;
Here is how I use it:
var tt := new MyUtils;
tt.timeBeginPeriod(1);
When I run my program, I keep getting the following errors.
- "MyUtils" does not provide an accessible constructor.
- "System.Object" does not contain a definition for "timeBeginPeriod" in expression "tt.timeBeginPeriod."
What am I doing wrong? How do you import dll in delphi-prism?
I followed this stackoverflow question - Delphi Prism getting Unknown Identifier "DllImport" error