![]() |
dll con forms
saludos
Disculpen la insistencia pero no logro hacer qe me funcione el llamar un dll qe contiene forms. Segui este Hilo que me paso cadetill, pero me arroja este error CoInitialize has not been called y de ahi no paso Ojala me puedan hechar la mano |
Estaría bien que enviaras el código de llamada a la dll y la función/procedimiento de la dll para ver por donde puede ir el error.
|
Cita:
Saludos! |
codigo
Aqui va el codigo de como llamo a mi dll
Cita:
Cita:
|
Pues no sabría decirte, acabo de probar el código que mandas y no me ha dado ningún error :confused:
Mira lo que te comenta el amigo delphi.com.ar (aunque también lo he probado y ma ha funcionado bien :( ) |
Si trabajas con ADO, te recomiendo probar lo que te he sugerido anteriormente.
Saludos! |
Me dices qe ponga application.initialize ,donde??
antes del application.run, pero si cuando haces una aplicacion delphi lo pone solo en el archivo del proyecto program Pruebadll; uses Forms, Unit1 in 'Unit1.pas' {Form1}; {$R *.RES} begin Application.Initialize; Application.CreateForm(TForm1, Form1); Application.Run; end O a la mejor no te estoy entendiendo, es ahi no? |
Encontré este texto por inet, en una de esas te aclara algo:
Cita:
Código:
try |
Cita:
|
Pues no, no lo he quitado de mi proyecto,esta exactamente como lo ves en mi mensaje anterior, por eso se me hizo raro qe sugirieras el Application.initialize, pense qe habia qe ponerlo en otro lado.
Y lo del CoInitialize tmb lo lei en la ayuda de delphi, lo quise usar pero no compila, me marca como identificador no declarado. Tal vez hay qe poner el uses correcto pero no se cual es, en la ayuda no le encontre cual era :( |
el mismo mens. de error
Saludos... yo tengo un problema similar, utilizo DLLs para crear paneles que luego incrusto en un ejecutable que hace de base; me daba un problema por el estilo y encontré por ahí un documento que dice así:
OLE Error: CoInitialize has not been called In a project that needed to display HTML documents, I decided to use the TWebBrowser control. I had used this handy ActiveX control successfully in other projects before. This application was an MDI application, written in Delphi 5. As a 'specialty' I had installed a beta version of Internet Explorer on my system. I am not sure which of this is responsible for it, but when I would call the function in my application to display the HTML document, the TWebBrowser element could not be instantiated. Instead I would receive an error message: 'CoInitialize has not been called' The surprising thing is that the webbrowser control shows fine in design mode! I checked and TWebBrowser was properly installed. The underlieing DLL was also registered properly. A call of regsvr32 shdocvw.dll did not help. Finally I manually called the CoInitialize() function. I had to add OLE2 to the list of used units. A good place to do this is the initialization part as the sample snippet below shows. Thanks to Martin Vreeken for pointing out the necessary CoUninitialize() call. Note: In a multithreaded application, you have to put a call to CoInitialize at the beginning of your thread's Execute method and a matching CoUnInitialize at its end. uses ActiveX, // <-- make sure to include this unit // older Delphi versions use: OLE2 instead Windows; // and others initialization CoInitialize(nil); // <-- manually call CoInitialize() finalization CoUnInitialize; // <-- free memory end. El tema es que las dos secciones finales (initialization y finalization) no se pueden incluir en una DLL, espero les ayude y me puedan ayudar a mi también, desde ya muchas gracias.:D |
La franja horaria es GMT +2. Ahora son las 05:28:43. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi