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

webservice and MFC

I'm trying to use an MFC extension dll in my C++ ASP.NET Web Service
project. I have changed my project settings to specify using MFC as a
shared dll. However, when I try to compile, I get the following error on
one of the extension dll header files:

error C2491: 'CGisPtrArray<TYPE>::__ctor' : definition of dllimport function
not allowed

I get the same error for every method declared in this template class. The
template class is entirely defined and implemented in the header file. I
have been unable to get past this error. Does .NET just make it impossible
to reuse completely functional code from VC++ 6? Help is appreciated.
Thanks
Nov 23 '05 #1
3 3463

This message seems to show that you are using a unmanaged definition where a
managed definition is expected.
Do you have an error on a MFC header file or on your header file ?
Do you specificy "__nogc" on your class to exclude managed extension ?
My guess is you must think to have an unmanaged layer in your project.

Lionel.

"cipher" <re********@yahoo.com> a écrit dans le message de news:
uN**************@TK2MSFTNGP14.phx.gbl...
I'm trying to use an MFC extension dll in my C++ ASP.NET Web Service
project. I have changed my project settings to specify using MFC as a
shared dll. However, when I try to compile, I get the following error on
one of the extension dll header files:

error C2491: 'CGisPtrArray<TYPE>::__ctor' : definition of dllimport
function
not allowed

I get the same error for every method declared in this template class.
The
template class is entirely defined and implemented in the header file. I
have been unable to get past this error. Does .NET just make it
impossible
to reuse completely functional code from VC++ 6? Help is appreciated.
Thanks

Nov 23 '05 #2
The error is occurs on one of the MFC extension dll header files. This is a
fully functional MFC extension dll, I shouldn't have to modify it to reuse
it and in many cases this isn't an option. (e.g. 3rd party dll)
"Lionel LASKE" <ll****@c2s.fr> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...

This message seems to show that you are using a unmanaged definition where a managed definition is expected.
Do you have an error on a MFC header file or on your header file ?
Do you specificy "__nogc" on your class to exclude managed extension ?
My guess is you must think to have an unmanaged layer in your project.

Lionel.

"cipher" <re********@yahoo.com> a écrit dans le message de news:
uN**************@TK2MSFTNGP14.phx.gbl...
I'm trying to use an MFC extension dll in my C++ ASP.NET Web Service
project. I have changed my project settings to specify using MFC as a
shared dll. However, when I try to compile, I get the following error on one of the extension dll header files:

error C2491: 'CGisPtrArray<TYPE>::__ctor' : definition of dllimport
function
not allowed

I get the same error for every method declared in this template class.
The
template class is entirely defined and implemented in the header file. I have been unable to get past this error. Does .NET just make it
impossible
to reuse completely functional code from VC++ 6? Help is appreciated.
Thanks


Nov 23 '05 #3
The error is saying that you are trying to provide an implementation for
a method that was first defined for import from a linked library
(dllimport).

Can you take a look at the header and check why the compiler thinks this
is a dll import class?

Also, you cannot specialize a template with a managed type if I recall
correctly.

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko

-----Original Message-----
From: cipher [mailto:re********@yahoo.com]
Posted At: Tuesday, January 25, 2005 8:38 AM
Posted To: microsoft.public.dotnet.framework.webservices
Conversation: webservice and MFC
Subject: Re: webservice and MFC

The error is occurs on one of the MFC extension dll header files. This is a
fully functional MFC extension dll, I shouldn't have to modify it to reuse it and in many cases this isn't an option. (e.g. 3rd party dll)
"Lionel LASKE" <ll****@c2s.fr> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...

This message seems to show that you are using a unmanaged definition where
a
managed definition is expected.
Do you have an error on a MFC header file or on your header file ?
Do you specificy "__nogc" on your class to exclude managed extension ?
My guess is you must think to have an unmanaged layer in your project.
Lionel.

"cipher" <re********@yahoo.com> a écrit dans le message de news:
uN**************@TK2MSFTNGP14.phx.gbl...
I'm trying to use an MFC extension dll in my C++ ASP.NET Web Service project. I have changed my project settings to specify using MFC as a shared dll. However, when I try to compile, I get the following error on one of the extension dll header files:

error C2491: 'CGisPtrArray<TYPE>::__ctor' : definition of
dllimport function
not allowed

I get the same error for every method declared in this template class. The
template class is entirely defined and implemented in the header file.
I have been unable to get past this error. Does .NET just make it
impossible
to reuse completely functional code from VC++ 6? Help is

appreciated. Thanks


Nov 23 '05 #4

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

Similar topics

8
by: DraguVaso | last post by:
Hi, I'm new to WebServices, and I'm doing some tests (with a small VB.NET-application) to know the performance-difference between a WebService and the 'normal'-way of getting data (just...
6
by: Davie | last post by:
I want to authorise a user of a web service by using the AuthHeaderValue for some reason I keep getting a null reference exception when I try to run the following code: It seems to work fine on a...
1
by: Nalaka | last post by:
Hi, I am testing with Visual studio 2005, web projects. Situation: I have one solution with two web projects, created as file system projects. (I am tesing using the built in server, not IIS)...
2
by: Miguel | last post by:
Hi, I'm developing an application in C# with Windows Forms for my company that is similar to the MSN Messenger. This application uses a webservice for registering users, etc... and as 2...
7
by: Alessandro Benedetti | last post by:
Hi. I'm calling two methods of a .NET Webservice (A) from another Webservice (B). The A Webservice is made like this: public class WSA: System.Web.Services.WebService { private int X = 0;
7
by: Nalaka | last post by:
Hi, I created a sinple web service that returns a dataSet. Then I created a client program that uses this web service (that returns the Dataset). My question is, how did the client figure...
5
by: AliR | last post by:
Hi Everyone, I have a Visual C++ MFC program, and I am trying to use a webservice written in C#. When I add the webservice to my project using Add Web Reference the sproxy compiler complains...
5
by: | last post by:
Hi, How long do webservice objects live for? In particular, if i have static variables filled with data from a static constructor in a webservice, how long will that data persist? thxs
0
by: =?Utf-8?B?TWFuaQ==?= | last post by:
Hi All, Problem in deploying my WebService developed using Asp.net WebServices 2005. I have designed simple WebService using Asp.net Webservices 2.0 , The webservice look this , using System;...
4
by: =?Utf-8?B?QmlsbEF0V29yaw==?= | last post by:
Hi, We recently converted a 1.1 project to 2.0 and this included a webservice which accepted XML for one of the parameters. Since converting to 2.0 I am getting the following message: --- A...
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: 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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.