473,657 Members | 2,496 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

changed string.find() arg value

Hello,
A call to std::basic_stri ng<wchar_t>::fi nd(...) from within a class library
is not working as expected. The value passed to find is 0x61, but the value
it receives is 0xE961. What's happening? How do I fix this?
Thanks

// stack trace
msvcp71d.dll!st d::basic_string <wchar_t,std::c har_traits<wcha r_t>,std::alloc ator<wchar_t>
::find(_Ch=' ?' (0xE961), _Off=0x00000000 )

mscorwks.dll!79 1befaf()
MyClassLibrary. dll!MyNamespace .MyClass.bar()
MyConsoleApp.ex e!main()
MyConsoleApp.ex e!mainCRTStartu p()

// MyConsoleApp.cp p
#include "stdafx.h"
#include <string>
#using <mscorlib.dll >
#using "C:\MyClassLibr ary.dll"
int _tmain()
{
MyNamespace::My Class::Init();
MyNamespace::My Class* foo = new MyNamespace::My Class();
foo->bar();

return 0;
}

// MyClassLibrary. cpp
#include <windows.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include "_vcclrit.h "
#include <string>
using namespace System;
namespace MyNamespace
{
public __gc class MyClass
{
public:

static void Init()
{
__crt_dll_initi alize();
}

void bar()
{
std::wstring string = L"hello world";
size_t n = string.find(L'a ');
}
};
}

// MyClassLibrary compile options
/Od /AI "C:\MyClassLibr ary" /D "WIN32" /D "_DEBUG" /D "_WINDLL" /D "_MBCS"
/FD /EHsc /MDd /GS /Zc:wchar_t /GR /Fo"Debug/" /Fd"Debug/vc70.pdb" /W3
/nologo /c /Zi /clr /TP /FU
"C:\WINDOWS\Mic rosoft.NET\Fram ework\v1.1.4322 \mscorlib.dll" /FU
"C:\WINDOWS\Mic rosoft.NET\Fram ework\v1.1.4322 \System.dll" /FU
"C:\WINDOWS\Mic rosoft.NET\Fram ework\v1.1.4322 \System.Data.dl l"

// MyClassLibrary link options
/OUT:"C:\MyClass Library.dll" /INCREMENTAL /NOLOGO /DLL
/INCLUDE:"__DllM ainCRTStartup@1 2" /DEBUG /ASSEMBLYDEBUG
/PDB:"C:\MyClass Library.pdb" /NOENTRY /FIXED:No mscoree.lib msvcrt.lib
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
"\Program Files\Microsoft Visual Studio .NET 2003\Sdk\v1.1\L ib\mscoree.lib"
Nov 17 '05 #1
0 1062

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

Similar topics

9
1812
by: MR | last post by:
Why does the string value assigned to the RequestElementName in the SoapDocumentMethodAttribute get changed? The value below with a colon is changed to the hex value surrounded by underscores. this doesn't happen to the RequestNameSpace. How can i prevent it from being changed? thanks
3
6071
by: awebguynow | last post by:
in other words, Can I make client side mod's before I submit a form and Post ? I guess its just a matter of cycling through the form elements and setting value to null (or empty string) for those that did not Change ( using onChange ).
3
2314
by: sherifffruitfly | last post by:
Hi, Here's a skeleton-handler of what I'm trying to do: private void editBbListView_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e) { string qEnabled = ""; string indexid = ITEM_IN_ROW_WHOSE_CHECK_JUST_CHANGED.Text;
8
3246
by: Martin Jørgensen | last post by:
Hi, I have a program that reads in a couple of numbers from files and then stores them with some latex-code but I'm not satisfied with the exponential output, as it takes up too many character spaces. Example: 4.9e+009 - takes 8 characters space (it's a double value). It should just become 4.9e9 (takes 5 character spaces) since all my numbers are e-positive (no such thing as e-) and all my numbers are within 0 <= x <= 9e9. I have no...
0
8425
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...
1
8522
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
8622
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...
0
7355
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6177
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
5647
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();...
0
4333
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1973
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1736
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.