Click here to Skip to main content
15,888,802 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I get error as "expression must have integral or enum type" in str1 variable. Please help me.

C++
extern "C" __declspec(dllexport) LPCTSTR PassValue(LPTSTR str1)
{
   return str1;
}
Posted
Updated 25-Sep-12 23:10pm
v2
Comments
CPallini 26-Sep-12 5:19am    
Your code compiles fine on my system (skeleton DLL created by Visual C++ 2010 express). How did you create your project?
Richard MacCutchan 26-Sep-12 6:09am    
I think there is something more that OP is not telling us.

1 solution

You are returning a different type of string that is defined in your function definition.

Look at this article about the different types of strings (see the table at the end for an overview):
The Complete Guide to C++ Strings, Part I - Win32 Character Encodings[^]
 
Share this answer
 
Comments
CPallini 26-Sep-12 6:30am    
What has it to do with the error message?
Legor 26-Sep-12 7:03am    
Oh you're right, somethings missing in OPs question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900