473,473 Members | 1,800 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

trouble with .lib file export - class exported, but not as expected.

I have written a .dll that exports a class MyClass, which has a member
function MyFunction(LPCWSTR szMyString).

If I build (I'm using VC7) with the /showIncludes option, I can see
that LPCWSTR is defined in file ...\platformsdk\include\winnt.h as:

typedef __nullterminated CONST WCHAR *LPCWSTR, *PCWSTR;

and WCHAR is in turn defined as:

#ifndef _MAC
typedef wchar_t WCHAR; // wc, 16-bit UNICODE character
#else
// some Macintosh compilers don't define wchar_t in a convenient
location, or define it as a char
typedef unsigned short WCHAR; // wc, 16-bit UNICODE character
#endif

I have (obviously) not defined _MAC (I even verified that no rogue
include did so by testing "#ifdef _MAC\n#error _MAC defined!\n#endif),
so I expect the .lib file to export the function

long __thiscall MyClass::MyFunction(wchar_t const *)

Instead the output from dumpbin shows that my lib file exports the
function,

long __thiscall MyClass::MyFunction(unsigned short const *)

and my test dll client program builds with a LNK2019 unresolved
external symbol.
What's the deal?
Thanks in advance for any help on the matter...

Jul 31 '06 #1
2 1599
acc13 wrote:
I have written a .dll that exports a class MyClass, which has a member
function MyFunction(LPCWSTR szMyString).

If I build (I'm using VC7) with the /showIncludes option, I can see
that LPCWSTR is defined in file ...\platformsdk\include\winnt.h as:

typedef __nullterminated CONST WCHAR *LPCWSTR, *PCWSTR;

and WCHAR is in turn defined as:

#ifndef _MAC
typedef wchar_t WCHAR; // wc, 16-bit UNICODE character
#else
// some Macintosh compilers don't define wchar_t in a convenient
location, or define it as a char
typedef unsigned short WCHAR; // wc, 16-bit UNICODE character
#endif

I have (obviously) not defined _MAC (I even verified that no rogue
include did so by testing "#ifdef _MAC\n#error _MAC defined!\n#endif),
so I expect the .lib file to export the function

long __thiscall MyClass::MyFunction(wchar_t const *)

Instead the output from dumpbin shows that my lib file exports the
function,

long __thiscall MyClass::MyFunction(unsigned short const *)

and my test dll client program builds with a LNK2019 unresolved
external symbol.
What's the deal?
This question should be asked on a Microsoft-specific newsgroup. See
this FAQ for what is on-topic here and for a list of other places you
could try:

http://www.parashift.com/c++-faq-lit...t.html#faq-5.9

Cheers! --M

Jul 31 '06 #2
Thanks, I appreciate the heads up.

New to newsgroups...

Jul 31 '06 #3

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

Similar topics

10
by: New_user | last post by:
Hello. Excerpt from ISO/IEC 14882 : 14/6 A namespace-scope declaration or definition of ........skipped...... a non- inline member function of a class template or a static data member of a...
10
by: New_user | last post by:
Hello. Excerpt from ISO/IEC 14882 : 14/6 A namespace-scope declaration or definition of ........skipped...... a non- inline member function of a class template or a static data member of a...
9
by: NEWSGROUPS | last post by:
I have data in a table in an Access 2000 database that needs to be exported to a formatted text file. For instance, the first field is an account number that is formatted in the table as text and...
1
by: SysProg | last post by:
I need some help with a problem I've encountered. I am a zLinux, WAS, and DB2 noob so please bear with me. I am helping to support two WebSphere applications which utilize DB2 under zLinux. One...
0
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,...
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
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...
1
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...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
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...

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.