471,357 Members | 1,118 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,357 software developers and data experts.

Calling an mfc dll from .NET

What steps need to be taken when calling an mfc dll from .NET application? I
am getting an ASSERT error from the dll on afxCurrentResourceHandle. Do I
need to define anything specific in my .NET application to get this to work
Jul 28 '05 #1
2 3360
FYI, I am using VB .NET with Visual Studio 2003 and the DLL that I am trying
to use is written in C++.

"Moto47" wrote:
What steps need to be taken when calling an mfc dll from .NET application? I
am getting an ASSERT error from the dll on afxCurrentResourceHandle. Do I
need to define anything specific in my .NET application to get this to work

Jul 28 '05 #2
Try using AFX_MANAGE_STATE(AfxGetStaticModuleState( )); at the very start of
each function of your MFC dll that is called from .Net

- Atul
Sky Software http://www.ssware.com/
Drop-In Windows Explorer-Like Shell Browsing UI for your apps.

"Moto47" <Mo****@discussions.microsoft.com> wrote in message
news:4C**********************************@microsof t.com...
What steps need to be taken when calling an mfc dll from .NET application?
I
am getting an ASSERT error from the dll on afxCurrentResourceHandle. Do I
need to define anything specific in my .NET application to get this to
work

Jul 30 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Asapi | last post: by
8 posts views Thread by Muthu | last post: by
7 posts views Thread by Klaus Friese | last post: by
5 posts views Thread by Nick Flandry | last post: by
3 posts views Thread by Mike | last post: by
2 posts views Thread by Geler | last post: by
47 posts views Thread by teju | last post: by
7 posts views Thread by =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post: by
10 posts views Thread by sulekhasweety | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.