473,386 Members | 1,943 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

It Just Works??

Here's my dilemma:
We are going to split our monolithic MFC app into a front-end GUI and an
Engine. We will re-write the front-end GUI as a WinForms exe and call from
there into the Engine. The Engine is in C++ distributed across about 60
DLLs - say 2 million lines of code.
We want to leave the Engine code pretty much as is but callable from the GUI
front-end, so we figured on recompiling it with the /clr option and I think
that can be accomplished. From the GUI front-end, I can get to simple
classes in the Engine thru "It Just Works". The GUI front-end is compiled
with /clr:pure and can #include a header file for the simple class.

The problem is trying to talk to more complicated classes in the Engine.
We've got some header files that #include other header files and ultimately
dozens of ATL headers get included. This is OK in the Engine compilation
because we are compiling with /clr only. But when I include the same class
header in the GUI code the ATL fails to compile because the GUI is compiling
with /clr:pure. I would like to get past this if anyone has a suggestion.
Secondly, I thought one way to get around this might be to skip #including
header files in the GUI front-end (like C# does) and try to access the
Engine type metadata with:
#using <Engine.dll>
and by adding Engine.dll to the list of References. Apparently, the type
information is not accessible from the Engine unless I compile the Engine
with /clr:pure or better (but this is not an option right now). Is there a
way to force the metadata into Engine.dll in such a way that I can use the
#using statement as above?
We really want this to work in such a way that we can re-write the Engine at
a more comfortable pace. It will take a major effort to re-write the
front-end and we are committed to that, but the engine needs to stay stable
while we do the re-writing.

[Note that most of my efforts are within Visual Studio 2005 Beta because I
thought the IJW and C++ syntax would be better.]

Thanks,

Denny Huber
Nov 17 '05 #1
3 1481
Hi Denny,
But when I include the same class
header in the GUI code the ATL fails to compile because the GUI is compiling with /clr:pure. I would like to get past this if anyone has a suggestion.
no, /clr:pure could not be comatible with the unmanaged ATL code,
Is there a
way to force the metadata into Engine.dll in such a way that I can use the
#using statement as above?


It appears no such method to generate the metadata of the unmaged code, do
you have checked the following MSDN doc, it suggests to create a managed
wrapper class for your native MFC class:
Walkthrough: Porting an Existing Native C++ Application to Interoperate
with .NET Framework Components
http://msdn.microsoft.com/library/de...us/vcsample/ht
ml/vcwlkportingnativetointeroperatewithnet.asp
And the VS.NET 2005 has a big change from VS.NET 2003, for the it is still
under testing scenario(Beta 2), we suggest you post this problem in our
Whidbey Technology Preview newsgroup
http://communities.microsoft.com/new...idbey&slcid=us
Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

Nov 17 '05 #2
Hi Denny,

Is my reply useful to your problem?
If you have any more concerns on it, please feel free to post here.
Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

Nov 17 '05 #3
I have found a workaround for my above problem.

I wrap the iterator from my native project into a "__nogc class".

For any unknown reason this resolved the problem.

Even though I can live with that, I would like to know whats wrong, to
avoid these kind of things in the future.

thanks

Ingo

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: seberino | last post by:
I'm trying to learn pylibpcap and would //really// love to see a **simple** example that just works. Can someone *please* send me any little app that just captures packets with next() command...
99
by: Jim Hubbard | last post by:
It seems that Microsoft not only does not need the classic Visual Basic developer army (the largest army of developers the world has ever seen), but now they don't need ANY Windows developer at a...
1
by: bissatch | last post by:
Hi, I am currently working on a content management system where a user can fill in a form (title, keywords, link text etc. - all the initial attibutes), which when submitted, will go onto create...
11
by: Brett | last post by:
I have an assembly on a shared LAN drive. On my developer machine, I give that assembly full trust from the .NET wizard. It works fine. I go to a user machine on the LAN, map to the shared...
5
by: cj | last post by:
I'm testing some code I typed in from an example program I was given. It works with F5. When I try to run the exe from an icon on the desktop I'm given a form that says: Just-In-Time Debugging...
1
by: Tim Cowan | last post by:
Hi, I am trying to download a 3MB file from an MS FTP server. Below is the code. Everything works fine, it starts the download and gets to with a couple of thousand bytes and then just hangs and...
3
by: MilanB | last post by:
Hello I have C# code that normaly throw exception and error message is shown. It's works fine. Separatlely I have ATL Component. When ATL Componenet fires event, and later C# code is called,...
4
by: siggi | last post by:
Hi all, newbie question: I'd like to try speech synthesis with PythonWin 2.5. Problem ****** according to several instructions, such as found on...
20
by: kwikius | last post by:
As I understand it posts to comp.std.c++ shouldnt contain personal attacks. Since several of my posts on this to comp.std.c++ on this subject have now been simply ignored with out any reply by...
1
by: mbruyns | last post by:
i have been trying (and sometimes succeeding) to use the modalpopupextender to show various panels of controls on my asp pages. the strange problem that i keep on running into is that sometimes it...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.