Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling Dialogs contained in DLLs
Message
 
To
13/06/1997 20:18:45
General information
Forum:
Visual C++
Category:
Troubleshooting
Miscellaneous
Thread ID:
00036262
Message ID:
00036838
Views:
40
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform