In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

OT: Ahora que tenemos los ocx....

Foro de Xailer profesional en español
Responder
jose.luis
Mensajes: 1633
Registrado: Vie Oct 14, 2005 10:56 pm

OT: Ahora que tenemos los ocx....

Mensaje por jose.luis »

Hola,
Ahora que tenemos los OCX y funciando estupendamente (buen trabajo
José!!)... ¿Conoceis algún componente _nativo_ de windows que permita enviar
correos electrónicos sin levantar ninguna ventana o diálogo?
Saludos y gracias,
José Luis Capel
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

OT: Ahora que tenemos los ocx....

Mensaje por jfgimenez »

José Luis,
> Ahora que tenemos los OCX y funciando estupendamente (buen trabajo
> José!!)... ¿Conoceis algún componente _nativo_ de windows que permita
> enviar correos electrónicos sin levantar ninguna ventana o diálogo?
Si no usa ninguna ventana o diálogo, entonces es un componente ActiveX, no
un control OCX, y por lo tanto se puede usar con TOleAuto.
Otra cosa sería que manejara eventos, y TOleAuto() no soporta eventos. En
Xailer vamos a tener nuestra propia implementación de TOleAuto (seguramente
se llamará TActiveX), que sí soportará eventos.
--
Un saludo,
José F. Giménez
http://www.xailer.com
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
jose.luis
Mensajes: 1633
Registrado: Vie Oct 14, 2005 10:56 pm

OT: Ahora que tenemos los ocx....

Mensaje por jose.luis »

Hola José,
>
> Si no usa ninguna ventana o diálogo, entonces es un componente ActiveX, no
> un control OCX, y por lo tanto se puede usar con TOleAuto.
>
> Otra cosa sería que manejara eventos, y TOleAuto() no soporta eventos. En
> Xailer vamos a tener nuestra propia implementación de TOleAuto
> (seguramente se llamará TActiveX), que sí soportará eventos.
>
A ver si un día nos iluminas con los conceptos de OCX y OLE y ServidorOle y
OleContainer y ActiveX y esas cosas....
Saludos y gracias,
Jose Luis Capel
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

OT: Ahora que tenemos los ocx....

Mensaje por jfgimenez »

José Luis,
> A ver si un día nos iluminas con los conceptos de OCX y OLE y ServidorOle
> y OleContainer y ActiveX y esas cosas....
La verdad es que el principal culpable de la confusión es la propia M$, que
ha cambiado la terminología varias veces a lo largo del tiempo.En fin, lo
tendré en cuenta y publicaré algún post en nuestro futuro blog aclarando
estos conceptos.
--
Un saludo,
José F. Giménez
http://www.xailer.com
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
swrite
Mensajes: 37
Registrado: Dom Mar 12, 2006 8:33 am

OT: Ahora que tenemos los ocx....

Mensaje por swrite »

José Luis
esto esta tomado del foro de minigui, funciona solo con xharbour puro
te aeguro que funciona super bien en mi windows Xp Sp2
no he probado con nada mas
Saludos y ojala sea lo que buscas
#define CRLF Chr(13) + Chr(10)
Function Main
Local cTitulo := 'Respaldo diario '
Local cTexto := 'Estimado Sr usuario' + CRLF + ;
'Descomprime el attach en directorio' + CRLF + ;
'sistemasjosenetEmpre001Ventas'
Local cOrigName := "Wilson 'W' Gamboa A"
Local cOrigAddress := 'swrite@uio.satnet.net'
Local cDestName := 'Distribuidora Xyz'
LOcal cDestAddress := 'swrite@uio.satnet.net'
Local cAttachFile := 'c:jose_pok.zip'
// MAPI with Confirm
//rta:=US_MAPISendMail(0, cTitulo, cTexto, cOrigName, cOrigAddress,
cDestName, cDestAddress, cAttachFile, 8)
// MAPI withOUT Confirm
//rta:=US_MAPISendMail(0, cTitulo, cTexto, cOrigName, cOrigAddress,
cDestName, cDestAddress, cAttachFile, 0)
Cls
?'Espere enviando email ..'
?rta:=US_MAPISendMail(0, cTitulo, cTexto, cOrigName, cOrigAddress,
cDestName, cDestAddress, cAttachFile, 0)
Return Nil
#pragma BEGINDUMP
#include <windows.h>
#include <stdio.h>
#include <mapi.h>
#include <mapix.h>
HINSTANCE hMAPILib = 0;
LHANDLE hSession = 0;
LPMAPILOGON pMAPILogon = NULL;
LPMAPILOGOFF pMAPILogoff = NULL;
LPMAPISENDMAIL pMAPISendMail = NULL;
MapiRecipDesc orig ;
MapiRecipDesc rcpt ;
MapiFileDesc file ;
MapiMessage mssg ;
HB_FUNC ( US_MAPISENDMAIL )
{
int nModoDialog = hb_parni( 9 ) ;
orig.ulReserved = 0 ; // Reserved
orig.ulRecipClass = MAPI_ORIG ; // Reciepient Class
MAPI_TO MAPI_CC MAPI_BCC
orig.lpszName = hb_parc( 4 ) ; // Originator's Name
orig.lpszAddress = hb_parc( 5 ) ; // Originators Address
orig.ulEIDSize = 0 ; // Count in bytes of size
of pEntryID
orig.lpEntryID = 0 ; // System-specific
Originator reference
rcpt.ulReserved = 0 ; // Reserved
rcpt.ulRecipClass = MAPI_TO ; // Reciepient Class
MAPI_TO MAPI_CC MAPI_BCC
rcpt.lpszName = hb_parc( 6 ) ; // Reciepient's Name,
e.g., pepe@hotmail.com
rcpt.lpszAddress = hb_parc( 7 ) ; // Reciepient's Address
rcpt.ulEIDSize = 0 ; // Count in bytes of size
of pEntryID
rcpt.lpEntryID = 0 ; // System-specific
Recipient reference
file.ulReserved = 0 ; // Reserved for future usage
file.flFlags = 0 ; // Flags ?
file.nPosition = -1 ; // Character of text to
be replaced by attachment
file.lpszPathName = hb_parc( 8 ) ; // Full Path Name with
Extension of the attached file
file.lpszFileName = 0 ; // Original File Name (
optional )
file.lpFileType = 0 ; // Attachment file type (
can be lpMapiFileTagExt )
mssg.ulReserved = 0 ; // Reserved
mssg.lpszSubject = hb_parc( 2 ) ; // Message Subject
mssg.lpszNoteText = hb_parc( 3 ) ; // Message Text
mssg.lpszMessageType = 0 ; // Message Class
mssg.lpszDateReceived = 0 ; // in yyyy/mm/dd hh:mm format
mssg.lpszConversationID = 0 ; // Conversation thread ID
mssg.flFlags = MAPI_LOGON_UI | MAPI_NEW_SESSION; //
unread, return receipt
mssg.lpOriginator = &orig ; // Originator's descriptor
mssg.nRecipCount = 1 ; // Number of receipients
mssg.lpRecips = &rcpt ; // Recipient descriptors
mssg.nFileCount = 1 ; // Number of file attachments
mssg.lpFiles = &file ; // Attachment descriptors
// Load the DLL at runtime
hMAPILib = ::LoadLibrary("MAPI32.DLL");
if (!hMAPILib)
{
hb_retnl( 101 ); // failed
return;
}
if (!(pMAPILogon = (LPMAPILOGON) GetProcAddress (hMAPILib,
"MAPILogon")))
{
hb_retnl( 102 ); // failed
return;
}
if (!(pMAPISendMail = (LPMAPISENDMAIL) GetProcAddress (hMAPILib,
"MAPISendMail")))
{
hb_retnl( 103 ); // failed
return;
}
if (!(pMAPILogoff = (LPMAPILOGOFF) GetProcAddress (hMAPILib,
"MAPILogoff")))
{
hb_retnl( 104 ); // failed
return;
}
// logon
if (pMAPILogon(0, NULL, NULL, MAPI_LOGON_UI | MAPI_NEW_SESSION, 0,
&hSession) != SUCCESS_SUCCESS)
{
hb_retnl( 105 ); // Logon failed
return;
}
// Send email using the MAPISendMail API function
if (nModoDialog == 0)
{
hb_retnl (pMAPISendMail(hSession, 0, &mssg, 0, 0)) ;
}
else
{
if (nModoDialog == 8)
{
hb_retnl (pMAPISendMail(hSession, 0, &mssg, MAPI_DIALOG, 0)) ;
}
else
{
hb_retnl( 108 ); // invalid parameter
}
}
// Logoff session
pMAPILogoff(hSession, 0, 0, 0);
// Free DLL
::FreeLibrary(hMAPILib);
return;
}
#pragma ENDDUMP
jose.luis
Mensajes: 1633
Registrado: Vie Oct 14, 2005 10:56 pm

OT: Ahora que tenemos los ocx....

Mensaje por jose.luis »

Wilson,
Gracias!! Lo voy a probar y te cuento.
Saludos y gracias,
José Luis Capel
"Wilson 'W' Gamboa A" <swrite@uio.satnet.net> escribió en el mensaje
news:[email=455DE781.5080600@uio.satnet.net...]455DE781.5080600@uio.satnet.net...[/email]
> José Luis
>
> esto esta tomado del foro de minigui, funciona solo con xharbour puro
> te aeguro que funciona super bien en mi windows Xp Sp2
> no he probado con nada mas
>
> Saludos y ojala sea lo que buscas
>
> #define CRLF Chr(13) + Chr(10)
>
> Function Main
>
> Local cTitulo := 'Respaldo diario '
> Local cTexto := 'Estimado Sr usuario' + CRLF + ;
> 'Descomprime el attach en directorio' + CRLF + ;
> 'sistemasjosenetEmpre001Ventas'
>
> Local cOrigName := "Wilson 'W' Gamboa A"
> Local cOrigAddress := 'swrite@uio.satnet.net'
> Local cDestName := 'Distribuidora Xyz'
> LOcal cDestAddress := 'swrite@uio.satnet.net'
> Local cAttachFile := 'c:jose_pok.zip'
>
>
> // MAPI with Confirm
>
> //rta:=US_MAPISendMail(0, cTitulo, cTexto, cOrigName, cOrigAddress,
> cDestName, cDestAddress, cAttachFile, 8)
>
> // MAPI withOUT Confirm
>
> //rta:=US_MAPISendMail(0, cTitulo, cTexto, cOrigName, cOrigAddress,
> cDestName, cDestAddress, cAttachFile, 0)
> Cls
> ?'Espere enviando email ..'
>
>
> ?rta:=US_MAPISendMail(0, cTitulo, cTexto, cOrigName, cOrigAddress,
> cDestName, cDestAddress, cAttachFile, 0)
>
> Return Nil
>
> #pragma BEGINDUMP
>
> #include <windows.h>
>
> #include <stdio.h>
>
> #include <mapi.h>
>
> #include <mapix.h>
>
> HINSTANCE hMAPILib = 0;
>
> LHANDLE hSession = 0;
>
> LPMAPILOGON pMAPILogon = NULL;
>
> LPMAPILOGOFF pMAPILogoff = NULL;
>
> LPMAPISENDMAIL pMAPISendMail = NULL;
>
> MapiRecipDesc orig ;
>
> MapiRecipDesc rcpt ;
>
> MapiFileDesc file ;
>
> MapiMessage mssg ;
>
> HB_FUNC ( US_MAPISENDMAIL )
>
> {
>
> int nModoDialog = hb_parni( 9 ) ;
>
> orig.ulReserved = 0 ; // Reserved
>
> orig.ulRecipClass = MAPI_ORIG ; // Reciepient Class MAPI_TO
> MAPI_CC MAPI_BCC
>
> orig.lpszName = hb_parc( 4 ) ; // Originator's Name
>
> orig.lpszAddress = hb_parc( 5 ) ; // Originators Address
>
> orig.ulEIDSize = 0 ; // Count in bytes of size of
> pEntryID
>
> orig.lpEntryID = 0 ; // System-specific
> Originator reference
>
> rcpt.ulReserved = 0 ; // Reserved
>
> rcpt.ulRecipClass = MAPI_TO ; // Reciepient Class MAPI_TO
> MAPI_CC MAPI_BCC
>
> rcpt.lpszName = hb_parc( 6 ) ; // Reciepient's Name, e.g.,
> pepe@hotmail.com
>
> rcpt.lpszAddress = hb_parc( 7 ) ; // Reciepient's Address
>
> rcpt.ulEIDSize = 0 ; // Count in bytes of size of
> pEntryID
>
> rcpt.lpEntryID = 0 ; // System-specific Recipient
> reference
>
> file.ulReserved = 0 ; // Reserved for future usage
>
> file.flFlags = 0 ; // Flags ?
>
> file.nPosition = -1 ; // Character of text to be
> replaced by attachment
>
> file.lpszPathName = hb_parc( 8 ) ; // Full Path Name with
> Extension of the attached file
>
> file.lpszFileName = 0 ; // Original File Name (
> optional )
>
> file.lpFileType = 0 ; // Attachment file type (
> can be lpMapiFileTagExt )
>
> mssg.ulReserved = 0 ; // Reserved
>
> mssg.lpszSubject = hb_parc( 2 ) ; // Message Subject
>
> mssg.lpszNoteText = hb_parc( 3 ) ; // Message Text
>
> mssg.lpszMessageType = 0 ; // Message Class
>
> mssg.lpszDateReceived = 0 ; // in yyyy/mm/dd hh:mm
> format
>
> mssg.lpszConversationID = 0 ; // Conversation thread ID
>
> mssg.flFlags = MAPI_LOGON_UI | MAPI_NEW_SESSION; //
> unread, return receipt
>
> mssg.lpOriginator = &orig ; // Originator's descriptor
>
> mssg.nRecipCount = 1 ; // Number of receipients
>
> mssg.lpRecips = &rcpt ; // Recipient descriptors
>
> mssg.nFileCount = 1 ; // Number of file
> attachments
>
> mssg.lpFiles = &file ; // Attachment descriptors
>
> // Load the DLL at runtime
>
> hMAPILib = ::LoadLibrary("MAPI32.DLL");
>
> if (!hMAPILib)
>
> {
>
> hb_retnl( 101 ); // failed
>
> return;
>
> }
>
> if (!(pMAPILogon = (LPMAPILOGON) GetProcAddress (hMAPILib,
> "MAPILogon")))
>
> {
>
> hb_retnl( 102 ); // failed
>
> return;
>
> }
>
> if (!(pMAPISendMail = (LPMAPISENDMAIL) GetProcAddress (hMAPILib,
> "MAPISendMail")))
>
> {
>
> hb_retnl( 103 ); // failed
>
> return;
>
> }
>
> if (!(pMAPILogoff = (LPMAPILOGOFF) GetProcAddress (hMAPILib,
> "MAPILogoff")))
>
> {
>
> hb_retnl( 104 ); // failed
>
> return;
>
> }
>
> // logon
>
> if (pMAPILogon(0, NULL, NULL, MAPI_LOGON_UI | MAPI_NEW_SESSION, 0,
> &hSession) != SUCCESS_SUCCESS)
>
> {
>
> hb_retnl( 105 ); // Logon failed
>
> return;
>
> }
>
> // Send email using the MAPISendMail API function
>
> if (nModoDialog == 0)
>
> {
>
> hb_retnl (pMAPISendMail(hSession, 0, &mssg, 0, 0)) ;
>
> }
>
> else
>
> {
>
> if (nModoDialog == 8)
>
> {
>
> hb_retnl (pMAPISendMail(hSession, 0, &mssg, MAPI_DIALOG, 0)) ;
>
> }
>
> else
>
> {
>
> hb_retnl( 108 ); // invalid parameter
>
> }
>
> }
>
> // Logoff session
>
> pMAPILogoff(hSession, 0, 0, 0);
>
> // Free DLL
>
> ::FreeLibrary(hMAPILib);
>
> return;
>
> }
>
> #pragma ENDDUMP
Responder