|
|
|
Rappel
Depiler Long
Attention : Toutes nouvelles instructions créées par vous même ne sont valables que sur votre ordinateur Vous n'avez aucun droit de commercialisation de EndUser4gl même en cas de réplication du pgm EndUser4gl.exe sous un autre nom .
Si vous souhaitez publier vos instructions : Contactez :
|
Level 4gl : Page 1 > Level 4gl : Page 2 PAGE 3 : PARTICIPER A L'EVOLUTION DE ENDUSER4GL
Le chemin du projet : c:\endUser4gl\4gl\bin\OpenSource\Enduser4gl\EndUser4gl.dsw Le programme EndUser4gl.exe est dans le répertoire c:\EndUser4gl\4gl\bin\EndUser4gl.exe. C'est obligatoire A chaque nouvelle compilation de vos codes éxécutions, vous devez transférer le nouveau programme c:\endUser4gl\4gl\bin\User4gl\Enduser4gl\debug\EndUser4gl.exe dans le répertoire c:\EndUser4gl\4gl\bin\EndUser4gl.exe. Les quelques exemples présentés sont inclus dans l'option de téléchargement . Ces exemples vous démontrent les possiblités d'inclure dans ENDUSER4GL tous les composants MFC, WIN32, ATL, COM, DCOM,etc du compilateur de Microsoft Visual 6.0. A VOTRE TOUR , ESSAYEZ ENDUSER4GL .... Exemples de programmes sources C++ de ENDUSER4GL : * Un analyseur syntaxe et interpreteur : exemple simple de programmation: : interpreter.zip(inclus dans la version 3F.09) Instructions EndUser4gl : Calendar() : c'est un Control ActiveX de Microsoft : Calendar 8.0 : ActiveXDialog.cpp ActiveXDialog.h calendar.h calendar.cpp long EndUser4glApp::OPCExecute_Calendar(long OPCcodeExe)
{ switch(OPCcodeExe)
{ case
CodeExeCalendar :
OPC_Depile_All();
Calendar(); break; int Calendar(void) {
CActiveXDialog dlg;
dlg.m_BackColor = RGB(151, 184, 160); // light yellow COleDateTime today = COleDateTime::GetCurrentTime(); dlg.m_varValue = COleDateTime(today.GetYear(), today.GetMonth(), today.GetDay(), 0, 0, 0); if (dlg.DoModal() == IDOK) { COleDateTime date(dlg.m_varValue);
AfxMessageBox(date.Format("%B %d, %Y"));
} return
0;
} Instructions EndUser4gl : Connect_MsExcel,Connect_MsWord etc. : COleDispatchDriver default constructor : excel8.h excel8.cpp msword8.h msword8.cpp LPDISPATCH lpDispWord; _Document testDocAdd=NULL; _Document testDocOpen=NULL; Documents docs; RangeWord objRange=NULL; COleVariant covTrue((short)TRUE), covFalse((short)FALSE), covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
long EndUser4glApp::OPCExecute_Word(long OPCcodeExe) { MSG msg;
char zone1[C_CMP_TAILLE_NOM_DICT] = "\0"; char zone2[C_CMP_TAILLE_NOM_DICT]= "\0"; char valeur1 [MAXBUFLENSTRING] = "\0"; int ReturnOpc ; int Ival=0,a,b, d = 0,i=0 ; long Lval = 0,Lval2 ; int NumberDialog , NumWin ; char far *pvaleur ; switch(OPCcodeExe) {
case CodeExeConnectWord : OPCF_Pile_Depile( P_NAMEVAR, (void *)zone1); /* attn : ***NULL*/ OPCF_Pile_Depile( P_LONG, (void *)&Lval ) ; OPCF_Pile_Depile( P_NAMEVAR, (void *)zone1); /* attn : ***NULL*/ OPCF_Pile_Depile( P_STRING, (void *)valeur1); OPC_Depile_All(); if(_access(valeur1,0) == 0) WordAccess(valeur1,Lval); else{ OkMsgBox(
" EndUser4gl ", \ "File not find/non trouvé : %s",valeur1) ; return EUError; } break; void WordAccess(char *FileWord,long visible) { HRESULT hr = CoInitialize(NULL); _ASSERTE(SUCCEEDED(hr)); try { // Get the IDispatch pointer and attach it to the objWord object. if(!app.CreateDispatch("Word.Application")) { AfxMessageBox("Couldn't CreateDispatch on Word"); return; } // Set visible. app.SetVisible(TRUE); POSITION pos = AfxGetApp()->GetFirstDocTemplatePosition();
Documents docs(app.GetDocuments()); testDocOpen.AttachDispatch(docs.Open( COleVariant(FileWord,VT_BSTR), covFalse, // Confirm Conversion. covFalse, // ReadOnly. covFalse, // AddToRecentFiles. covOptional, // PasswordDocument. covOptional, // PasswordTemplate. covFalse, // Revert. covOptional, // WritePasswordDocument. covOptional, // WritePasswordTemplate. covOptional) // Format. ); etc... Instructions EndUser4gl : MiniCalendar() de Matt Gullett. : CWnd, CDialog de MFC : long EndUser4glApp::OPCExecute_Calendar(long OPCcodeExe) { MSG msg; char zone1[C_CMP_TAILLE_NOM_DICT] = "\0"; char zone2[C_CMP_TAILLE_NOM_DICT]= "\0"; char valeur1 [MAXBUFLENSTRING] = "\0"; int ReturnOpc ; int Ival=0,a,b, d = 0,i=0 ; long Lval = 0,Lval2 ; int NumberDialog , NumWin ;
switch(OPCcodeExe) { case CodeExeMiniCalendar : OPC_Depile_All(); MiniCalendar(); break;
default : return EUError;//return EU_Error_Code_Exe(OPCcodeExe); /* execute.c */ }
return 0; } int MiniCalendar(void) { CMiniCalendarDlg dlg; int nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: Place code here to handle when the dialog is // dismissed with OK } else if (nResponse == IDCANCEL) { // TODO: Place code here to handle when the dialog is // dismissed with Cancel } return 0; } Instructions EndUser4gl : GIf Animés de Oleg Bykov. : COM, ATL de MFC Instructions EndUser4gl : OpendDialog(...), SwapColor ButtonRegion etc.. : Win32 API Windows Instructions EndUser4gl : ExecuteSQLDialog{ACCESS},QueryDialog("...: ODBC
Et bien d'autres exemples MAPI, WEBBROWSER (voir option de téléchargement)...+ Demain votre PARTICIPATION HTML,SECURITE,XML, NET etc. !
Bergougnoux Consulting 14 rue Jean Moulin 37550 St Avertin, Tours FRANCE. Copyright (c) 2001-2005 ENDUSER4GL Tous droits réservés. All rights reserved fax : 00 33 8 71 22 59 46
|