473,320 Members | 1,856 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,320 software developers and data experts.

including MFC classes to .NET application

Hi,

I'm migrating my MFC application to .NET and therefore i need to create
it again...

However, there are some *.cpp and *.h file which i would like to keep as
such (in MFC coding).

How can i makethem usuable for VC.NET ?

I tried a simple include and here is the result :

MyAPP\wrapper\CARDLLWrapper.h(10) : error C2065: 'FUNCT_LocGetString' :
undeclared identifier

Where in my CARDLLWrapper.h :
typedef LPTSTR (*FUNCT_LocGetString)(HMODULE, long);

and in my CARDLLWrapper.cpp :
(FUNCT_LocGetString)MyGetStr =
(FUNCT_LocGetString)GetProcAddress(m_hlibLoc, (LPCSTR)("DLL_GetString"));

I tried to play with C++/compiler options but without success.

Could you help me please ?
thanks a lot,

Alain
Oct 14 '06 #1
2 999
www.codeproject.com/managedcpp/HostMFC.asp

--
Regards
Sheng Jiang

Microsoft Most Valuable Professional in Visual C++
http://www.jiangsheng.net
http://blog.joycode.com/jiangsheng/
"--== Alain ==--" <no****@noemail.com????
news:u7**************@TK2MSFTNGP03.phx.gbl...
Hi,

I'm migrating my MFC application to .NET and therefore i need to create
it again...

However, there are some *.cpp and *.h file which i would like to keep as
such (in MFC coding).

How can i makethem usuable for VC.NET ?

I tried a simple include and here is the result :

MyAPP\wrapper\CARDLLWrapper.h(10) : error C2065: 'FUNCT_LocGetString' :
undeclared identifier

Where in my CARDLLWrapper.h :
typedef LPTSTR (*FUNCT_LocGetString)(HMODULE, long);

and in my CARDLLWrapper.cpp :
(FUNCT_LocGetString)MyGetStr =
(FUNCT_LocGetString)GetProcAddress(m_hlibLoc, (LPCSTR)("DLL_GetString"));

I tried to play with C++/compiler options but without success.

Could you help me please ?
thanks a lot,

Alain

Oct 15 '06 #2

"--== Alain ==--" <no****@noemail.comwrote in message
news:u7**************@TK2MSFTNGP03.phx.gbl...
Hi,

I'm migrating my MFC application to .NET and therefore i need to create it
again...

However, there are some *.cpp and *.h file which i would like to keep as
such (in MFC coding).

How can i makethem usuable for VC.NET ?
make sure you explicitly #include <windows.h>, since that is no longer
pulled in by the stdafx.h created by AppWizard.
>
I tried a simple include and here is the result :

MyAPP\wrapper\CARDLLWrapper.h(10) : error C2065: 'FUNCT_LocGetString' :
undeclared identifier

Where in my CARDLLWrapper.h :
typedef LPTSTR (*FUNCT_LocGetString)(HMODULE, long);

and in my CARDLLWrapper.cpp :
(FUNCT_LocGetString)MyGetStr =
(FUNCT_LocGetString)GetProcAddress(m_hlibLoc, (LPCSTR)("DLL_GetString"));

I tried to play with C++/compiler options but without success.

Could you help me please ?
thanks a lot,

Alain

Oct 26 '06 #3

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

Similar topics

1
by: Roland Raschke | last post by:
Hi, I'm a novice in using templates and want to write a static library with some communication classes. One of these classes uses two instances of a ringbuffer template as class members: ...
3
by: Daves | last post by:
now let's say I have a class that I want to include in all my aspx pages. It's just a simple class containing some properties and constants. Since it's not a user control (aka @Register ...) - how...
7
by: Big E | last post by:
I'm using ASP.Net and SQL Server 2000. There are many things in my ASP.Net application that I use over and over. For instance my Connection to the database. I've stored that in the webconfig. But...
4
by: Husam | last post by:
Hi Every Body: How can I add the .Net Framework to my setup project? any help will be appreciated. Regard's Husam
5
by: Craig Kenisston | last post by:
Hi, I'm creating a VB Windows Application project that needs to call some classes already written in C#. I can create a class library (dll) and include them as reference in my project, that...
6
by: Al-Burak | last post by:
I have a class which only purpose is to provide services to a variety of classes in other files. The 'manipulator' class is aware of the other classes only because the header files have been...
4
by: Chris F Clark | last post by:
Please excuse the length of this post, I am unfortunately long-winded, and don't know how to make my postings more brief. I have a C++ class library (and application generator, called Yacc++(r)...
5
by: =?Utf-8?B?SmltbWVy?= | last post by:
Hello, I've been trying to create a WCF SOAP Router Service that can forward not just the message body but also any security headers set by the originator of the message. The destination service...
45
by: =?Utf-8?B?QmV0aA==?= | last post by:
Hello. I'm trying to find another way to share an instance of an object with other classes. I started by passing the instance to the other class's constructor, like this: Friend Class...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.