473,797 Members | 2,893 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Linker Error in Managed Wrapper when calling Method with CString Parameter

Hello Newsgroup,

I'm struggeling with wrapping a dll using MFC CStrings.

Code:

class CLASSEXPORTDLL_ API CClassExportDll {

public:

long InitMcs5 (HWND hWnd, CString path);

}


When I try to call that member method linker fails with:

Error 3 error LNK2019: unresolved external symbol "public: long __thiscall
CClassExportDll ::InitMcs5(stru ct HWND__ *,class ATL::CStringT<w char_t,class
StrTraitMFC_DLL <wchar_t,clas s ATL::ChTraitsCR T<wchar_t >)"
(?InitMcs5@CCla ssExportDll@@$$ FQAEJPAUHWND__@ @V?$CStringT@_W V?$StrTraitMFC_ DLL@_WV?$ChTrai tsCRT@_W@ATL@@@ @@ATL@@@Z)
referenced in function "public: __clrcall
CarlZeissWrappe r::Test::Test(v oid)" (??0Test@CarlZe issWrapper@@$$F Q$AAM@XZ)
CarlZeiss.Wrapp er.obj

Does anybody know how to successfully call an umanaged member function
consuming a MFC CString from
a C++/CLI mixed code project?

Thanks, Sebastian Dau
Jul 14 '06 #1
0 1256

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

Similar topics

7
8233
by: Klaus Bonadt | last post by:
I have an existing VC6 application using the MFC. I am able to pass CString and other parameters from such a VC6 dll to an unmanaged MFC dll (compiled in Visual Studio .NET). Now I want to use .Net functionality, i.e. calling methods in managed code. How do I pass CString variables for input and output usage, i.e. providing and retrieving char arrays? Regards, Klaus
1
3045
by: sklett | last post by:
STILL trying to wrap an unmanaged C++ class that is itself a wrapper to some COM stuff, not sure, it is littered with LPDISPATCH and InvokeHelper, etc. Problem is, when something goes wrong, I'm having a hard time debugging. In my managed C++ class(the one wrapping the unmanaged C++) I have a method that looks like this: bool FindFileItem(String* filename, IVSSItem& founditem); that method calls the unmanaged method:
3
1816
by: WithPit | last post by:
I am trying to create an managed wrapper but have some problems with it by using abstract classes. In my unmanaged library code i had the following three classes with the following hierarchy Referenced (class) Object (abstract class, inheriting from referenced) Node (class, inheriting from object)
11
1719
by: James Crouch | last post by:
I am trying to create a managed c++ wrapper and have run into a problem is when SetNewNetworkCallBack is run. It doesn't like that NetworkID isn't an UInt16. I get the error: CCommManager::SetNewNetworkCallBack' : cannot convert parameter 1 from 'void (unsigned short,void *)' to 'void (__cdecl *)(UInt16,void *)' Any help would be appreicated. Offending code is below. James
3
8090
by: Chucker | last post by:
Hi Folks, I got a Wrapper Dll around a native C++ static library. In .NET 1.1 this worked fine. When moving to .NET 2.0 I get a couple of unresolved externals / linker errors: Error 16 error LNK2028: unresolved token (0A000007) "extern "C" void __clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)" (?___CxxCallUnwindDtor@@$$J0YMXP6MXPAX@Z0@Z) referenced in function "public: virtual __thiscall...
19
9592
by: ashmangat | last post by:
Hi! now on the chapter "string-class" My assignment is below Word Counter: Write a function that accepts a pointer to a C-String as an argument and returns the number of words contained in the string. For instance, if the string argument is "Four score and seven years ago" the function should return the number 6. Demonstrate the function in a program that asks the user to input a string and then passes it to the function. The number of...
0
1161
by: Kurt | last post by:
I have an MFC static lib which exports som classes, it still needs to be available to MFC apps and now C# apps as well. For C# I am creating a wrapper dll that will link in the library. My question is for the function ProcessStructs which takes a CTypedPtrArray pointer as a parameter. Are my steps below correct or is there an easy way to do this? Redefine my struct to .Net compatible version in my wrapper class Would I have to make my...
5
2404
by: Andy | last post by:
I'm having trouble accessing an unmanaged long from a managed class in VC++.NET When I do, the contents of the variable seem to be mangled. If I access the same variable byte-by-byte, I get the correct value. Regardless what I set the variable to, the value that is returned for a long is always the same value. What's going on...can anyone help me? A short version of the code follows:
4
3653
by: Olivier Matrot | last post by:
Hello, I'm in the process of writing a managed wrapper on legacy C++ code. I have to deal with methods that are using the ellipsis. For instance,the legacy method is : void CLog::Print (LPCSTR szMask, ...) { CHAR szText;
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10468
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10245
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10205
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10021
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7559
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6802
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.