Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calling Dialogs contained in DLLs
Message
De
18/06/1997 18:44:38
 
Information générale
Forum:
Visual C++
Catégorie:
Problèmes
Divers
Thread ID:
00036262
Message ID:
00036878
Vues:
32
>>>I'm trying to call a function in a dll that displays a CDialog derived dialog box. I am calling this DLL from another development environment (Visual FoxPro 5). I keep getting an "Assertion Failed" message when I try to call the function. It is in file AFXWIN1.INL, Line 22. Is there a certain something I need to do to get this to work?
>>>
>>>function code follows:
>>>
>>>char* fTest()
>>>{
>>> char* cTest;
>>
>>// You must allocate memory to cTest before initialize it. Ie:
>>
>>// Where n must be the maximum string length + 1 (for the null terminator)
>>cTest = new( char[n]);
>>
>>> cTest="test";
>>>
>>> TestDialog dlg;
>>> dlg.DoModal();
>>>
>>> return cTest;
>>>};
>>>
>>>Without the dialog stuff the function works fine. And I know the dialog box doesn't have any errors in it. Any ideas would be much appreciated.
>>
>>Can you tell me where exactly (which line inside the function) the error is generated?
>>
>>Vlad
>
>
>Thank you for your reply. The problem was that unless the app calling the DLL was written in Visual C, the function that is called in the DLL must not use any MFC-derived classes. You can avoid this by statically linking the MFC library with the DLL.
>
>Thanks again,
>
>Garritt

Thank you. It's good to know.

Vlad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform