-
Имеется библиотека NCMInfo.dll. Вот из описания:
NCMInfo.dll представляет собой Active Type Library, обеспечивающую интерфейс для доступа к информации о проекте NCManager.
Установка
В процессе установки NCManager выполняется регистрация этого компонента и никаких дополнительных действий не требуется.
Для установки NCMInfo на компьютер, на котором NCManager не установлен, необходимо скопировать NCMInfo.dll и NCMb.dll и выполнить RegSvr32 для первой из них.
Прога у меня установлена, далее в delphi делаю следующее Project->Import Tipe Library->Add->Create Unit. Далее компилирую созданный юнит, выдает ошибку:[Error] SERVERLib_TLB.pas(258): Undeclared identifier: 'ClassID'
[Error] SERVERLib_TLB.pas(259): '..' expected but ';' found
[Error] SERVERLib_TLB.pas(260): '..' expected but ';' found
[Error] SERVERLib_TLB.pas(261): Type expected but 'NIL' found
[Error] SERVERLib_TLB.pas(262): '..' expected but ')' found
[Fatal Error] Project2.dpr(6): Could not compile used unit 'C:\Program Files\Inteks\NCM30\SERVERLib_TLB.pas'
Вот часть кода на которую ссылается при нажатии на строку с ошибкойprocedure TServerData.InitServerData;
const
CServerData: TServerData = (
ClassID: '{8820E928-C1F1-11D5-B0AB-0050BF4A8273}';
IntfIID: '{8820E927-C1F1-11D5-B0AB-0050BF4A8273}';
EventIID: '';
LicenseKey: nil;
Version: 500);
begin
ServerData := @CServerData;
end;
Подскажите, пожалуйста, в чем может быть дело? -
Григорьев Антон © (21.05.09 09:45) [1]Тип TServerData где и как описан?
-
Вот начало кода созданного юнитаunit SERVERLib_TLB;
// ************************************************************************ //
// Type Lib: C:\WINDOWS\system32\NCMInfo.dll (1)
// LIBID: {8820E918-C1F1-11D5-B0AB-0050BF4A8273}
// LCID: 0
// Helpfile:
// HelpString: NCMInfo Type Library
// DepndLst:
// (1) v2.0 stdole, (C:\WINDOWS\system32\stdole2.tlb)
// Errors:
// Error creating palette bitmap of (TServerData) : Server C:\WINDOWS\system32\NCMInfo.dll contains no icons
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
{$WARN SYMBOL_PLATFORM OFF}
{$WRITEABLECONST ON}
{$VARPROPSETTER ON}
interface
uses Windows, ActiveX, Classes, Graphics, OleServer, StdVCL, Variants;
const
// TypeLibrary Major and minor versions
SERVERLibMajorVersion = 2;
SERVERLibMinorVersion = 0;
LIBID_SERVERLib: TGUID = '{8820E918-C1F1-11D5-B0AB-0050BF4A8273}';
IID_IServerData: TGUID = '{8820E927-C1F1-11D5-B0AB-0050BF4A8273}';
CLASS_ServerData: TGUID = '{8820E928-C1F1-11D5-B0AB-0050BF4A8273}';
type
// *********************************************************************//
// Forward declaration of types defined in TypeLibrary
// *********************************************************************//
IServerData = interface;
// *********************************************************************//
// Declaration of CoClasses defined in Type Library
// (NOTE: Here we map each CoClass to its Default Interface)
// *********************************************************************//
ServerData = IServerData;
// *********************************************************************//
// Declaration of structures, unions and aliases.
// *********************************************************************//
PDouble1 = ^Double; {*}
PWideString1 = ^WideString; {*}
PInteger1 = ^Integer; {*}
// *********************************************************************//
// Interface: IServerData
// Flags: (0)
// GUID: {8820E927-C1F1-11D5-B0AB-0050BF4A8273}
// *********************************************************************//
IServerData = interface(IUnknown)
['{8820E927-C1F1-11D5-B0AB-0050BF4A8273}']
function GetProgramsNum(out pNum: Integer): HResult; stdcall;
........................................................................
function GetToolPos(ToolNum: Integer; var pNum: Integer): HResult; stdcall;
end;
// *********************************************************************//
// The Class CoServerData provides a Create and CreateRemote method to
// create instances of the default interface IServerData exposed by
// the CoClass ServerData. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoServerData = class
class function Create: IServerData;
class function CreateRemote(const MachineName: string): IServerData;
end;
// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object : TServerData
// Help String : ServerData Class
// Default Interface: IServerData
// Def. Intf. DISP? : No
// Event Interface:
// TypeFlags : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
TServerDataProperties= class;
{$ENDIF}
TServerData = class(TOleServer)
private
FIntf: IServerData;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps: TServerDataProperties;
function GetServerProperties: TServerDataProperties;
{$ENDIF}
function GetDefaultInterface: IServerData;
protected
procedure InitServerData; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Connect; override;
procedure ConnectTo(svrIntf: IServerData);
procedure Disconnect; override;
function GetProgramsNum(out pNum: Integer): HResult;
.....................................................................
function GetToolPos(ToolNum: Integer; var pNum: Integer): HResult;
property DefaultInterface: IServerData read GetDefaultInterface;
published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
property Server: TServerDataProperties read GetServerProperties;
{$ENDIF}
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
// *********************************************************************//
// OLE Server Properties Proxy Class
// Server Object : TServerData
// (This object is used by the IDE's Property Inspector to allow editing
// of the properties of this server)
// *********************************************************************//
TServerDataProperties = class(TPersistent)
private
FServer: TServerData;
function GetDefaultInterface: IServerData;
constructor Create(AServer: TServerData);
protected
public
property DefaultInterface: IServerData read GetDefaultInterface;
published
end;
{$ENDIF}
procedure Register;
resourcestring
dtlServerPage = 'ActiveX';
dtlOcxPage = 'ActiveX';
implementation
uses ComObj;
class function CoServerData.Create: IServerData;
begin
Result := CreateComObject(CLASS_ServerData) as IServerData;
end;
class function CoServerData.CreateRemote(const MachineName: string): IServerData;
begin
Result := CreateRemoteComObject(MachineName, CLASS_ServerData) as IServerData;
end;
procedure TServerData.InitServerData;
const
CServerData: TServerData = (
ClassID: '{8820E928-C1F1-11D5-B0AB-0050BF4A8273}';
IntfIID: '{8820E927-C1F1-11D5-B0AB-0050BF4A8273}';
EventIID: '';
LicenseKey: nil;
Version: 500);
begin
ServerData := @CServerData;
end; -
clickmaker © (22.05.09 13:53) [3]тут какая-то путаница...
свойство ServerData типа TServerData есть у TOleServer, от которого наследуется твой TServerData -) -
Сергей М. © (22.05.09 17:35) [4]
> Pavlov © (19.05.09 08:46)
Путаница налицо.
Искать виновных не будем, просто попробуй заменить все вхождения подстроки "ServerData" в тексте упомянутого юнита на, к примеру, "NCMInfoServerData", кроме вхождение в строкеCServerData: TServerData = ( -
А не может быть ошибки в том, что я как-то не правильно импортирую библиотеку? В нете трудно что-либо найти по вопросу использования dll библиотек в своем приложении.
-
SPeller © (27.05.09 05:21) [6]Может просто библиотека типов скомпилена так, что дельфийским импортер на ней спотыкается...