Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
916 connectés 

  FORUM HardWare.fr
  Programmation
  C++

  [Visual C++ 6] Problème avec IApplicationPtr

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

[Visual C++ 6] Problème avec IApplicationPtr

n°521112
Cherrytree
cn=?
Posté le 23-09-2003 à 11:33:21  profilanswer
 

Bon, je n'y connais rien en Microsoft C++, MFC tout ça. Mais j'ai un truc à faire avec.
 
En gros, je me déroule un tutorial sur le produit Crystal Reports 9 et l'intégration de l'ActivX Crystal Viewer dans un programme C++. C'est hard.
 
Donc, ayant je l'espère bien compris le tutorial, je me retrouve avec une déclaration dans un .h qui échoue :
 
IApplicationPtr m_Application;
 

Citation :

syntax error: missing ';' before identifier 'm_Application'


 
Voilà ; à l'aide.

mood
Publicité
Posté le 23-09-2003 à 11:33:21  profilanswer
 

n°521117
gatorette
Posté le 23-09-2003 à 11:38:03  profilanswer
 

Le type IApplicationPtr n'étant pas un type standard, spécifique à Windows, au MFCs ou à tout autre bibliothèque que je connaisse, je suppose que soit c'est un type défini par toi (peu probable) ou un type défini par CrystalReports.
Si c'est un type défini par toi, il suffit juste d'inclure le header définissant ce type avant la déclairation.
Si c'est un type défini par CrystalReports, la solution est la même, mais il va falloir que tu trouves le header définissant ce type.


---------------
each day I don't die is cheating
n°521124
Cherrytree
cn=?
Posté le 23-09-2003 à 11:45:56  profilanswer
 

J'ai parsé les headers fournis avec Crytal Reports, mais rien.
 
Cependant, les ressources sur Internet à propos de IApplicationPtr sont vraiment très nombreuses (peut-être un hasard), et j'ai vu une histoire de smart pointers. Peut-être cela a t'il quand même un rapport ?
 
Je cherche, je cherche.

n°521126
Cherrytree
cn=?
Posté le 23-09-2003 à 11:47:10  profilanswer
 

Il y a aussi cette ressource de chez MS :
http://support.microsoft.com/defau [...] bContent=1
 
ça parle de IApplicationPtr.

n°521127
chrisbk
-
Posté le 23-09-2003 à 11:48:29  profilanswer
 

dur a dire, comme ca, si ce IApplicationPtr est bien celui que tu souhaites.... le mieux est d'essayer (balance les includes de l'exemple) et regarde s'il te fait des erreurs sur ton IApplicationPtr (methode pas definies ou ce genre de truc)

n°521134
Cherrytree
cn=?
Posté le 23-09-2003 à 11:52:39  profilanswer
 

J'vais suivre ce tutorial, et voir ce que ça donne. Putain, comme c'est chaud.

n°521426
LetoII
Le dormeur doit se réveiller
Posté le 23-09-2003 à 15:22:34  profilanswer
 

D'après le nom ça semble être une interface COM. Elle doit être définie dans un header, t'as juste à trouver lequel :/


---------------
Le Tyran
n°521433
gatorette
Posté le 23-09-2003 à 15:35:13  profilanswer
 

J'ai trouvé ce document qui semble expliquer tout:

Citation :

Adding the RDC runtime library in Visual C++
1. Start a new project in Visual C++. Click the File menu and then click New.
Select MFC AppWiz and name the project. Click OK. Choose "Dialog
Based" in the first screen of the wizard and select "Finish"
2. In the application?s header file add the runtime library using the #import
keyword, for example:
#import ?craxdrt.dll? no_namespace;
3. In the application?s header file, use the IApplicationPtr class to declare an
Application object, for example:
IApplicationPtr pApplication;
4. In the class where you want use the Application object, create the
Application object, for example:
extern CMyApplicationApp theApp;
theApp.pApplication.CreateInstance("CrystalRuntime.Applicat
ion" );
Whereas the steps for Visual Basic are fairly intuitive, the same perhaps cannot
be said for the Visual C++ example given above. A few points bear explanation.
? The #import keyword exposes the various interfaces of Craxdrt.dll. You
should add the c:\program files\seagate software\report designer
component\ directory to the list of directories in Visual C++. To add the
directory, go the Tools menu, select Options and click the Directories tab.
? The no_namespace keyword indicates that you are not concerned with
creating a namespace for the set of interfaces you are importing.
? Craxdrt.dll exposes an interface called IApplication, however, the #import
keyword adds "Ptr" to the end of each interface to indicate that it has
wrapped the interfaces into smart pointers. Smart pointers do a bit of the
work for you, such as managing the life-cycle of the object created from the
interface and wrapping arguments into safe-arrays.
? Microsoft Foundation Classes (MFC) applications automatically create a
global application variable called theApp. Since you?ve declared RDC
interfaces in the application's header, they too are global and can be
accessed from the theApp variable. To do so, you need to declare theApp
in any class where we are using it using the extern keyword.
Although you have an Application object declared, you need to create the object
using the runtime. To do so, use the CreateInstance method of the object. The
method takes the programmatic identifier (ProgID) of the interface (for example,
CrystalRuntime.Application).


---------------
each day I don't die is cheating
n°521454
Cherrytree
cn=?
Posté le 23-09-2003 à 15:59:54  profilanswer
 

LetoII a écrit :

D'après le nom ça semble être une interface COM. Elle doit être définie dans un header, t'as juste à trouver lequel :/


Je crois que je tiens une piste :

----------------------------------------
Trouvé 'IApplication' dans 'C:\Program Files\Microsoft Visual Studio\VC98\Include\ObjModel\APPAUTO.H' :
C:\...\VC98\Include\ObjModel\APPAUTO.H(23): interface IApplication;
C:\...\VC98\Include\ObjModel\APPAUTO.H(24): interface IApplicationEvents;
C:\...\VC98\Include\ObjModel\APPAUTO.H(39): // IApplication interface
C:\...\VC98\Include\ObjModel\APPAUTO.H(42): #define INTERFACE IApplication
C:\...\VC98\Include\ObjModel\APPAUTO.H(44): DECLARE_INTERFACE_(IApplication, IDispatch)
C:\...\VC98\Include\ObjModel\APPAUTO.H(83):     /* IApplication methods */
C:\...\VC98\Include\ObjModel\APPAUTO.H(135): // IApplicationEvents interface
C:\...\VC98\Include\ObjModel\APPAUTO.H(138): #define INTERFACE IApplicationEvents
C:\...\VC98\Include\ObjModel\APPAUTO.H(140): DECLARE_INTERFACE_(IApplicationEvents, IDispatch)
C:\...\VC98\Include\ObjModel\APPAUTO.H(179):     /* IApplicationEvents methods */
Trouvé 'IApplication' 10 fois.
----------------------------------------
Trouvé 'IApplication' dans 'C:\...\VC98\Include\ObjModel\APPGUID.H' :
C:\...\VC98\Include\ObjModel\APPGUID.H(27): struct __declspec(uuid("{EC1D73A1-8CC4-11cf-9BE9-00A0C90A632C}" )) IApplication;
C:\...\VC98\Include\ObjModel\APPGUID.H(28): DEFINE_GUID(IID_IApplication,
C:\...\VC98\Include\ObjModel\APPGUID.H(32): struct __declspec(uuid("{8EA3F900-4A9F-11cf-8E4E-00AA004254C4}" )) IApplicationEvents;
C:\...\VC98\Include\ObjModel\APPGUID.H(33): DEFINE_GUID(IID_IApplicationEvents,  
Trouvé 'IApplication' 4 fois.
Recherche effectuée, trouvé 'IApplication' 14 fois.


 
Edit : présentation imbitable, j'essaie d'améliorer


Message édité par Cherrytree le 23-09-2003 à 16:01:52

---------------
Le site de ma maman
n°521458
Cherrytree
cn=?
Posté le 23-09-2003 à 16:03:12  profilanswer
 

gatorette a écrit :

J'ai trouvé ce document qui semble expliquer tout:


Merci du tuyau. Je regarde ça illico.


---------------
Le site de ma maman

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  C++

  [Visual C++ 6] Problème avec IApplicationPtr

 

Sujets relatifs
Problème avec le truc javascript qui imite target="_blank"Problème de formule en VBA Excel
problème de sécurité avec le Include[openGL] Probleme de systeme de coordonnées fenetre
[résolu] Problème de reconnaissance des nouveaux messages ...[Newbie]Bloqué sur un problème de variable
[visual c++ 6] pkoi j'ai pas le menu contextuel ???probleme avec un echo dans un textarea
Probleme listes deroulantesSondage et le problème du SPAM !
Plus de sujets relatifs à : [Visual C++ 6] Problème avec IApplicationPtr


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR