Hi Notre,
To display your own MFC window within a native VsPackage should be OK.
I found you posted a related problem in vc.mfc newsgroup, and some
community members have already suggest the approach to you. Wish it helps.
:)
Thanks!
Best regards,
Gary Chang
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Notre Poubelle - 16 Aug 2006 00:30 GMT
Hi Gary,
Thank you for taking the time to respond to my question. I have
encapsulated the wanted part of my MFC code in a regular DLL that has MFC
support. I've been able to use a Win32 EXE and LoadLibrary/GetProcAddress
calls to load my code and display my dialog successfully. I've even managed
to get this to work with a WinForm host, using DllImport attribute.
However, when I try this in a VSPackage, my call to LoadLibrary fails. My
VSPackage is just the C++ VSIP wizard generated sample, modified to use
LoadLibrary/GetProcAddress instead of displaying the wizard generated dialog
box (after the user selects the appropriate menu item). I modified my code
to use LoadLibraryEx with the LOAD_LIBRARY_AS_DATAFILE flag. This allowed
the DLL to load, but of course I can't call any exported functions. I
verified that I'm not missing any dependencies that the DLL uses by using
dumpbin /dependents. Is there anything unique to the VSPackage or VS window
architecture that is preventing my DLL with MFC support from properly
initializing...?
Thanks,
Notre
Notre Poubelle - 16 Aug 2006 06:35 GMT
It looks like if I remove one of my static dependencies in my DLL, then it
will load even from VS. So, although it should be in the DLL search path
it's not being found it seems. I'll dig a little deeper and see if I can
figure out what's going on.
(Maybe it needs to be in the same folder as devenve.exe ...)
Notre
Notre Poubelle - 16 Aug 2006 17:14 GMT
Yes, my DLL search path was incorrect. After moving the dependent DLL to the
same folder as devenv.exe, everything worked correctly.
Gary Chang[MSFT] - 17 Aug 2006 04:31 GMT
Thanks for the update, I am glad to know it works well. :)
Have a nice day!
Best regards,
Gary Chang
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.