473,383 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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, "Directorios", "Ejecutables", "C:\", true);

Routine dll MBCS

bool bDameValorINI (CString &valor, const CString &clave, const
CString &variable,
const CString &nombre_ficheroINI, 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 *) "Directorios", (char *)
"Ejecutables", "C:\", true);
2. char p1[25], p2[45];
strcpy (p1, "Directorios");
strcpy (p2, "Ejecutables");
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 2211
On Jun 25, 4:42 pm, Josemi <josemiant...@gmail.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, "Directorios", "Ejecutables", "C:\", true);

Routine dll MBCS

bool bDameValorINI (CString &valor, const CString &clave, const
CString &variable,
const CString &nombre_ficheroINI, 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 *) "Directorios", (char *)
"Ejecutables", "C:\", true);
2. char p1[25], p2[45];
strcpy (p1, "Directorios");
strcpy (p2, "Ejecutables");
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...@gmail.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, "Directorios", "Ejecutables", "C:\", true);

Routine dll MBCS

bool bDameValorINI (CString &valor, const CString &clave, const
CString &variable,
const CString &nombre_ficheroINI, 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 *) "Directorios", (char *)
"Ejecutables", "C:\", true);
2. char p1[25], p2[45];
strcpy (p1, "Directorios");
strcpy (p2, "Ejecutables");
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...@gmail.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, "Directorios", "Ejecutables", "C:\", true);
Routine dll MBCS
bool bDameValorINI (CString &valor, const CString &clave, const
CString &variable,
const CString &nombre_ficheroINI, 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 *) "Directorios", (char *)
"Ejecutables", "C:\", true);
2. char p1[25], p2[45];
strcpy (p1, "Directorios");
strcpy (p2, "Ejecutables");
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
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...
8
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) ...
14
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
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...
2
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...
9
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. ...
3
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...
9
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...
2
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,...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.