Salut,
Je ne sais plus quoi faire du tout...
Je fais une dll en vc++ en vue d'une utilisation comme XPcom dans une extension Firefox. Au d�but je m'�tais lanc� dans une dll MFC mais il semblerait que c'est pas trop conseill� pour ce que je veux faire et puis m�me si ma dll et ses fonctions �taient appel�es, �a planter quand m�me.
Du coup, j'ai refait une dll win32 toute simple. Mais maintenant, je me heurte � une autre probl�me et pas des moindre, ma dll en vc++ ne veut pas charger mon autre dll. pourtant j'ai pas chang� mon code de ce c�t� l�.
Voici mon cpp en son entier :
elle renvoit toujours 36. c'est � rien y comprendre. Je suis perdu.
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50 #include "stdafx.h" #include "comp-impl.h" #include <stdlib.h> NS_IMPL_ISUPPORTS1(CSpecialThing, ISpecialThing) CSpecialThing::CSpecialThing() { /* member initializers and constructor code */ mName.Assign(L"Default Name"); } CSpecialThing::~CSpecialThing() { /* destructor code */ } /* long add (in long a, in long b); */ NS_IMETHODIMP CSpecialThing::Add(PRInt32 a, PRInt32 b, PRInt32 *_retval) { PRInt32 test; typedef char* (_stdcall *ProcDllPtr)(char* monString); char* reponseDLL; HMODULE hinstDLL=LoadLibrary((LPCWSTR)"C\\DLMDLL.dll");//ma dll est bien là pourtant test=32; if (hinstDLL) { ProcDllPtr ProcExportDll = (ProcDllPtr) GetProcAddress(hinstDLL, "Ajouter_article"); reponseDLL=ProcExportDll("sanctification personnel"); test=35; } else { test=36; } FreeLibrary((HINSTANCE)hinstDLL); *_retval = test; return NS_OK; } /* attribute AString name; */ NS_IMETHODIMP CSpecialThing::GetName(nsAString & aName) { aName.Assign(mName); return NS_OK; } NS_IMETHODIMP CSpecialThing::SetName(const nsAString & aName) { mName.Assign(aName); return NS_OK; }
Personne n'aurait sous la main un truc tout simple comme ce que je souhaite faire : une dll en vc++ qui appelle une autre dll. un truc tout b�te?
Merci
Simo'
Partager