|
|
you could insert something like:
#if defined (UNICODE) || defined (_UNICODE)<br />
#define _tcstombs wcstombs<br />
#else<br />
#define _tcstombs strncpy<br />
#endif<br />
then to convert CString in UNICODE or non Unicode environment to char* you can use the function
_tcstombs
It has 3 params, 1st param is the target char* 2nd param is the TCHAR string, and 3rd param the size of string to copy....
_tcstombs(pszFile, m_strDBFilePath, m_strDBFilePath.GetLength()); <br />
Hope this helps you along
Davy
|
|
|
|
|
_tcstombs() seems not to be regognized by MSDN
are you sure it's the right name ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
well it`s not an MSDN statement.
you need to insert that
#if defined (UNICODE)... stuff that I mentioned in the above mail,
it will translate the _tcstombs statement into strncpy if not compiling in a UNICODE environment, and it will translate it into a wcstombs statement when compiling in a UNICODE environment.
|
|
|
|
|
oh sorry, i didn't look well at the begining of your previous post.
thanks
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hi all,
We are generating MultiLanguage reports with wide char encoding for printing from our application. We need to achieve Multilanguage printing of these reports, please help us how to achieve the same.
We are getting junk printed when we try to print the Multilanguage characters using WritePrinter() API. Is there any API which does the job of printing Multilanguage.
As of now we are using WritePrinter( ) function and able to print English Data where we also send some control characters to the printer to print the data in the desired format.
Please do the needful.
Regards
Hari
R Hari
|
|
|
|
|
hello..im currently working on my project. but i can't move on to the next step because i cant load the image. I have a dialog box containing a command button and frame controls. if the button is clicked, it will open the file open box and load the raw image in the frame (IDC_DISPLAY). im using a SDI environment... can u please help me with this one...
|
|
|
|
|
If you use GDI+, you can use the Bitmap constructor that takes a path. You can draw the image yourself, or you can use a PictureBox control. If you're in VC6 and don't want GDI+, then ::LoadImage will load a bitmap file, which you can then do the same with. There is no support for other image formats in VC6 without GDI+, or some other library such as Paintlib.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I convert code from VC++6 to VC++.NET. When build solution, it has a lot
of error
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\typeinfo(38): error C2039: '__non_rtti_object' : is not a member of 'operator``global namespace'''
Can you help me?
Thank you very mach!
|
|
|
|
|
VC6 is a very bad C++ compiler. VC7 is a very good one. There's a good chance if you get a lot of errors, your old code was not really valid C++. I had one error, in all the projects I migrated, but then, I've always been very aware of what the standard says
Here's[^] as link to someone who had the same issue.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
This is still do not run. It have a lot of errors. For example:
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\XUTILITY(871): error C2059: syntax error : ')'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\TYPEINFO(37): error C2039: 'bad_typeid' : is not a member of 'operator``global namespace'''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\XSTRING(1433): error C2059: syntax error : '>'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\stdexcept(10): error C2143: syntax error : missing ';' before '{'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\TYPEINFO.H(53): error C2143: syntax error : missing ';' before '{'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xdebug(22): error C2143: syntax error : missing ';' before '{'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\XMEMORY(29): error C2447: '{' : missing function header (old-style formal list?)
When I change all library XUTILITY, TYPEINFO, XMEMORY, XSTRING of VC7 by library of VC6, It's other error.
|
|
|
|
|
Looks like your old code was not standards conformant.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Dear Sir,
I want to know how can i insert page breaks in the client area of the SDI like there are page breaks in MS Word and other documents.Also how can i create the client area of my own size in SDI.
|
|
|
|
|
You can't do this magically, you need to create the control that does it yourself.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
If you were starting a new project what database would you use?
1. The app may be used in small shops where the price of SQL Server would bankrupt the business or large shops where they could afford it but probably wouldn't want to!
2. May only be deployed to one desktop.
3. May need to be server based.
4. Should need very little to no administration.
5. All installations would be on windows machines.
Thanks!
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
-Frank Outlaw.
|
|
|
|
|
Based on all of your requirements, I would use Access.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Personally, I'd look into MSDE, mostly because Access is crap if you're used to using a real database. MSDE is free to distribute if you own SQL Server Developer Edition.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
The app may be used in small shops where the price of SQL Server would bankrupt the business
I downloaded SQL Server Express not long ago, and I'm sure I read that it will be free when it goes live. I can't remember it's exact limitations.
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
Painted on the side of a dog trainer's van: SIT HAPPENS
|
|
|
|
|
Jack Squirrel wrote:
I can't remember it's exact limitations.
I think it had to do with no support for business intelligence and lack of support for very large databases. Not anything a small shop would need in the near future.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
i am trying to do something like this
if(abc=numeric)
cout << "abc is numeric";
obviyesly this does not work can anyone giv me the code for the is numeric function thx^^
|
|
|
|
|
Well are you trying to test if its equal, because if you are then you meant to do
if(abc==numeric)
cout << "abc is numeric";
edit:
sorry i dont think i read that right, maybe you might try googling the "isnum" function.
|
|
|
|
|
isalphanum && !isalpha. You need to do it char by char, if you have a std:string you can use a function object to do this.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote:
isalphanum && !isalpha
isdigit looks a little bit more nice.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Yeah, someone else answered that. I'd never seen that - I am self taught, and when I looked for isnumeric, I obviously didn't spot isdigit, and I kept using that method ever since. Live and learn, I guess....
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I'm also self taught. I came across that function a few weeks ago when I also needed to chech if a string was numeric or not. It's not the ideal solution since it will return false on hexa decimal numbers, but it's a start..
Christian Graus wrote:
Live and learn, I guess....
We developers only stop learning when we die.. If you stop learning, you'll soon be obsolete.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|