|
|
|
создать dll фоксе и использовать в delphi
|
|||
|---|---|---|---|
|
#18+
Доброе время суток умнейшие, у меня возникла необходимость программу на VFP 8 подключить в программу написанную на delphi в виде dll. тестирую след. программу: cMyClass = CREATEOBJECT("myClass") cMyClass.run RELEASE cMyClass DEFINE CLASS myClass AS CUSTOM OLEPUBLIC PROCEDURE run WAIT WINDOW "Hi" ENDPROC ENDDEFINE в delphi: type StandardProc = function(AText: String):Integer; TForm1 = class(TForm) procedure FormActivate(Sender: TObject); procedure FormDestroy(Sender: TObject); private { Private declarations } public run : StandardProc; DLLHandle : THandle; { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.FormActivate(Sender: TObject); begin DLLHandle := LoadLibrary(test.dll'); @Run := GetProcAddress(DLLHandle,'run'); end; procedure TForm1.FormDestroy(Sender: TObject); begin FreeLibrary(DLLHandle); end; dll грузится, вызываю метод run, но ни чего не происходит, где подвох? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 26.07.2007, 08:47 |
|
||
|
создать dll фоксе и использовать в delphi
|
|||
|---|---|---|---|
|
#18+
Для начала вместо wait window 'Hi' поставь return с возвратом чего-нибудь и посмотри, получает ли твоя прога это возвращаемое значение. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 26.07.2007, 09:02 |
|
||
|
создать dll фоксе и использовать в delphi
|
|||
|---|---|---|---|
|
#18+
А вот вдогонку кусок хелпа. In-Process and out-of-process servers provide differing services, especially regarding the user interface of your application. User Interfaces Although earlier versions of Visual FoxPro make it possible for you to use forms as output-only elements in an Automation server application, the two run-time libraries in Visual FoxPro handle this situation differently for out-of-process and for in-process servers. In-Process Servers Apartment-model threading support requires that in-process .dll Automation servers not have user interfaces. In Visual FoxPro 5.0, it was possible (though not recommended) to create an in-process .dll Automation server that had a user interface such as a form. You could use the form only for display because the form events were not supported. Since Visual FoxPro 6, if you attempt to create a user interface in an in-process .dll, Automation generates an error. This is referred to as unattended mode. Out-of-Process Servers An out-of-process (.exe) Automation server can have a user interface. The Visual FoxPro function SYS(2335) enables you to disable UI and modal events for an out-of-process .exe Automation server so they can be handled remotely without user intervention. Modal events are created by user-defined modal forms, system dialogs, the MESSAGEBOX( ) function and the WAIT command, and so on and normally require user input. Замечу также, что в .DLL фокс делает In-process Automation server и ничего другого. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 26.07.2007, 09:09 |
|
||
|
создать dll фоксе и использовать в delphi
|
|||
|---|---|---|---|
|
#18+
Win32 DLL на VFP создать нельзя, только OLE Automation. И такое Код: plaintext 1. Так соответвенно вызвать неполучится. Только через: Код: plaintext 1. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 26.07.2007, 11:19 |
|
||
|
|

start [/forum/topic.php?fid=41&fpage=190&tid=1588985]: |
0ms |
get settings: |
9ms |
get forum list: |
20ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
66ms |
get topic data: |
14ms |
get forum data: |
4ms |
get page messages: |
48ms |
get tp. blocked users: |
2ms |
| others: | 241ms |
| total: | 412ms |

| 0 / 0 |
