473,799 Members | 3,077 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

App Unicode call NonUnicode dll

Hi!,

I've got a great problem, and I don't have any idea how can I to
solve it. I hope that there is a solution to solve it :-). Well. I've
got an App UNICODE that call a routine in a dll MBCS:

App UNICODE
CString dir;
bDameValorINI (dir, "Directorio s", "Ejecutable s", "C:\", true);

Routine dll MBCS

bool bDameValorINI (CString &valor, const CString &clave, const
CString &variable,
const CString &nombre_fichero INI, bool
obligatorio);

When I try to call to that function, I can see with Debug that clave
is only "D" and variable = "E" into bDameValorINI. I tried to pass
with several ways:

1. bDameValorINI (dir, (char *) "Directorio s", (char *)
"Ejecutable s", "C:\", true);
2. char p1[25], p2[45];
strcpy (p1, "Directorio s");
strcpy (p2, "Ejecutable s");
bDameValorINI (dir, p1, p2, "C:\", true);

And all results are the same, :-(. clave = "D" and variable = "E"

My God, How can I do to solve it?

Many thanks in advance
Josemi
P.D.: I use VC++ v6.0. I can't to built the dll in MBCS mode

Jun 25 '07 #1
3 2229
On Jun 25, 4:42 pm, Josemi <josemiant...@g mail.comwrote:
Hi!,

I've got a great problem, and I don't have any idea how can I to
solve it. I hope that there is a solution to solve it :-). Well. I've
got an App UNICODE that call a routine in a dll MBCS:

App UNICODE
CString dir;
bDameValorINI (dir, "Directorio s", "Ejecutable s", "C:\", true);

Routine dll MBCS

bool bDameValorINI (CString &valor, const CString &clave, const
CString &variable,
const CString &nombre_fichero INI, bool
obligatorio);

When I try to call to that function, I can see with Debug that clave
is only "D" and variable = "E" into bDameValorINI. I tried to pass
with several ways:

1. bDameValorINI (dir, (char *) "Directorio s", (char *)
"Ejecutable s", "C:\", true);
2. char p1[25], p2[45];
strcpy (p1, "Directorio s");
strcpy (p2, "Ejecutable s");
bDameValorINI (dir, p1, p2, "C:\", true);

And all results are the same, :-(. clave = "D" and variable = "E"

My God, How can I do to solve it?

Many thanks in advance
Josemi

P.D.: I use VC++ v6.0. I can't to built the dll in MBCS mode
Hi,

I think you have to post it in VC++ group for a fast response.

Thanks and regards,
Amal P

Jun 25 '07 #2
Amal P a écrit :
On Jun 25, 4:42 pm, Josemi <josemiant...@g mail.comwrote:
>Hi!,

I've got a great problem, and I don't have any idea how can I to
solve it. I hope that there is a solution to solve it :-). Well. I've
got an App UNICODE that call a routine in a dll MBCS:

App UNICODE
CString dir;
bDameValorINI (dir, "Directorio s", "Ejecutable s", "C:\", true);

Routine dll MBCS

bool bDameValorINI (CString &valor, const CString &clave, const
CString &variable,
const CString &nombre_fichero INI, bool
obligatorio) ;

When I try to call to that function, I can see with Debug that clave
is only "D" and variable = "E" into bDameValorINI. I tried to pass
with several ways:

1. bDameValorINI (dir, (char *) "Directorio s", (char *)
"Ejecutables ", "C:\", true);
2. char p1[25], p2[45];
strcpy (p1, "Directorio s");
strcpy (p2, "Ejecutable s");
bDameValorINI (dir, p1, p2, "C:\", true);

And all results are the same, :-(. clave = "D" and variable = "E"

My God, How can I do to solve it?

P.D.: I use VC++ v6.0. I can't to built the dll in MBCS mode

Hi,

I think you have to post it in VC++ group for a fast response.
I guess not. This is a UNICODE question.

I don't known the answer because I am not familiar enough with UNICODE
but it is no wonder p1 id D and P2 is E if inputs are unicode.
Replacing strcpy() with wcscpy() and/or using L"" string should improove
the matter.
Michael
Jun 25 '07 #3
On Jun 25, 10:10 am, Michael DOUBEZ <michael.dou... @free.frwrote:
Amal P a écrit :
On Jun 25, 4:42 pm, Josemi <josemiant...@g mail.comwrote:
Hi!,
I've got a great problem, and I don't have any idea how can I to
solve it. I hope that there is a solution to solve it :-). Well. I've
got an App UNICODE that call a routine in a dll MBCS:
App UNICODE
CString dir;
bDameValorINI (dir, "Directorio s", "Ejecutable s", "C:\", true);
Routine dll MBCS
bool bDameValorINI (CString &valor, const CString &clave, const
CString &variable,
const CString &nombre_fichero INI, bool
obligatorio);
When I try to call to that function, I can see with Debug that clave
is only "D" and variable = "E" into bDameValorINI. I tried to pass
with several ways:
1. bDameValorINI (dir, (char *) "Directorio s", (char *)
"Ejecutable s", "C:\", true);
2. char p1[25], p2[45];
strcpy (p1, "Directorio s");
strcpy (p2, "Ejecutable s");
bDameValorINI (dir, p1, p2, "C:\", true);
And all results are the same, :-(. clave = "D" and variable = "E"
My God, How can I do to solve it?
P.D.: I use VC++ v6.0. I can't to built the dll in MBCS mode
Hi,
I think you have to post it in VC++ group for a fast response.

I guess not. This is a UNICODE question.
I do guess so, when I start reading a message and stuff like CString,
dll and VC++ v6.0 is in the message I stop reading and go to the next
message, might be there is e real C++ question hidding between all the
MS stuff, but most off the time, it is some MS-related question.

Greets,
Bas

Jun 25 '07 #4

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

Similar topics

19
11891
by: Gerson Kurz | last post by:
AAAAAAAARG I hate the way python handles unicode. Here is a nice problem for y'all to enjoy: say you have a variable thats unicode directory = u"c:\temp" Its unicode not because you want it to, but because its for example read from _winreg which returns unicode. You do an os.listdir(directory). Note that all filenames returned are now unicode. (Change introduced I believe in 2.3).
8
2559
by: Ivan Voras | last post by:
When concatenating strings (actually, a constant and a string...) i get the following error: UnicodeDecodeError: 'ascii' codec can't decode byte 0xfc in position 1: ordinal not in range(128) Now I don't think either string is unicode, but I'm working with win32api so it might be... :) The point is: I know all values will fit in a particular code page (iso-8859-2), so how do I change the 'ascii' codec in the above error into something...
14
2851
by: wolfgang haefelinger | last post by:
Hi, I wonder whether someone could explain me a bit what's going on here: import sys # I'm running Mandrake 1o and Windows XP. print sys.version ## 2.3.3 (#2, Feb 17 2004, 11:45:40)
9
2327
by: François Pinard | last post by:
Hi, people. I hope someone would like to enlighten me. For any application handling Unicode internally, I'm usually careful at properly converting those Unicode strings into 8-bit strings before writing them out. However, this morning, I mistakenly forgot to do so before using one Unicode string (containing a non-ASCII character) as an argument to the `print' statement, and I did _not_ get an error. This is rather surprising to me. ...
2
2635
by: Neil Schemenauer | last post by:
python-dev@python.org.] The PEP has been rewritten based on a suggestion by Guido to change str() rather than adding a new built-in function. Based on my testing, I believe the idea is feasible. It would be helpful if people could test the patched Python with their own applications and report any incompatibilities. PEP: 349
9
13430
by: Charles F McDevitt | last post by:
I'm trying to upgrade some old code that used old iostreams. At one place in the code, I have a path/filename in a wchar_t string (unicode utf-16). I need to open an ifstream to that file. But the open() on ifstream only takes char * strings (mbcs?). In old iostreams, I could _wopen() the file, get the filedesc, and call attach() on the ifstream.
3
2301
by: roland.saad | last post by:
Hi Everyone, I have been trying to build a website that has multilingual support using the LAMP setup. I have created tables that store language information and correlate different strings ids with languages. The strings are all VARCHAR with unicode (utf8) encoding. I have tried all the ways that I could think of and I have checked every website to no avail. What I am trying to do is simply open a connection to the database (using...
9
2944
by: Jim | last post by:
Hello, I'm trying to write exception-handling code that is OK in the presence of unicode error messages. I seem to have gotten all mixed up and I'd appreciate any un-mixing that anyone can give me. I'm used to writing code like this.
2
4043
by: John Nagle | last post by:
Here's a strange little bug. "socket.getaddrinfo" blows up if given a bad domain name containing ".." in Unicode. The same string in ASCII produces the correct "gaierror" exception. Actually, this deserves a documentation mention. The "socket" module, given a Unicode string, calls the International Domain Name parser, "idna.py", which has a a whole error system of its own. The IDNA documentation says that "Furthermore, the socket...
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
10249
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
10219
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
10025
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
6804
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
5584
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4138
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 we have to send another system
2
3755
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2937
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.