Je developpe une application en MFC SDI en relation avec le soft "Emule".
Je voudrai recupere les liens ed2k (en liens hypertext sous IE ou FireFox ) sous la forme d'une chaine de caractere ( a stocker dans un CString ) pour un traitement par mon programme.
En fait, lorsque je clique sur un lien ed2k, cela lance mon programme pour apres l'ajouter dans une liste ( CListView ) .

Mon programme se lance bien lorque je clique sur le lien ed2k, je le stocke bien dans une variable CString mais apres le programme bugue
Le programme me fait une 'Debug Assertion Failed' dans le fichier 'DocMgr.cpp' Line 926.

Je pense savoir d'ou vient le problem : en fait le programme pense que ce liens est en fait un fichier a charge et ca fout la zone dans les classes CDocument ou CDocTemplate et CCommandLineInfo.
Dans un programme en 'Dialog Base' ca marche tres bien

Par contre je sais pas comment eviter ce plantage - Avez vous une idee ?

Voila une partie de mon code :
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
BOOL CEmuleLinkInjectApp::InitInstance()
{
// InitCommonControls() is required on Windows XP if an application
// manifest specifies use of ComCtl32.dll version 6 or later to enable
// visual styles. Otherwise, any window creation will fail.
InitCommonControls();
CWinApp::InitInstance();
 
if (!AfxSocketInit())
{
AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
return FALSE;
}
// Initialize OLE libraries
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
return FALSE;
}
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need
// Change the registry key under which our settings are stored
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization
SetRegistryKey(_T(""));
LoadStdProfileSettings(4); // Load standard INI file options (including MRU)
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views

CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CEmuleLinkInjectDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CEmuleLinkInjectView));
if (!pDocTemplate)
return FALSE;
AddDocTemplate(pDocTemplate);
pendinglink = 0;
if ( GetEmuleLinkInjectRunning() )
return FALSE;
// Enable DDE Execute open
EnableShellOpen();
RegisterShellFileTypes(TRUE);
// Load Icons for Tray 
// m_pMainWnd->SetIcon( ::LoadIcon( m_hInstance, MAKEINTRESOURCE(IDR_MAINFRAME)), TRUE );

Function->LoadOptions();
Function->HideUnHideApplication( m_pMainWnd, (EmuleLinkInjectOptions->bAppWindowsStart || EmuleLinkInjectOptions->bHideAppOnStartup) );
 
COpenInternet OpenInternet;
if ( OpenInternet.GetSession() == NULL )
{
EmuleLinkInjectVariableApp->bConnectToEmuleState = false;
}
// create a new (empty) document
// OnFileNew();
// The one and only window has been initialized, so show and update it
m_pMainWnd->UpdateWindow();
// call DragAcceptFiles only if there's a suffix
// In an SDI app, this should occur after ProcessShellCommand
// Enable drag/drop open
m_pMainWnd->DragAcceptFiles();
return TRUE;
}
ET le les cles a rajouter dans la base de registre :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
 
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\ed2k]
@="URL: ed2k Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\ed2k\DefaultIcon]
@="c:\\Documents and Settings\\Administrateur\\Mes documents\\Visual Studio Projects\\EmuleLinkInject\\Debug\\EmuleLinkInject.exe"
[HKEY_CLASSES_ROOT\ed2k\shell]
[HKEY_CLASSES_ROOT\ed2k\shell\open]
[HKEY_CLASSES_ROOT\ed2k\shell\open\command]
@="\"c:\\Documents and Settings\\Administrateur\\Mes documents\\Visual Studio Projects\\EmuleLinkInject\\Debug\\EmuleLinkInject.exe\" \"%1\""
Si vous avez besion de toutes les sources de mon projet, je peut vous les fournir...

Please Help Me, je pete un plomb
J'espere vous avoir pas trop prit la tete - Merci de vos reponses...