|
First, UNICODE has been defined in my program.
Second, my CString involves Chinese characters as well as English letters.
the following piece of code runs correctly and the format of the resulted file "myTxt.txt" is Unicode
CFile file(_T("myTxt.txt"), CFile::modeCreate|CFile::modeWrite);
CArchive ar(&file, CArchive::store, 512);
CString str;
str = _T("Welcome 张三");
TRACE(str);
ar.WriteString(str);
however, the following piece of code dose not run correctly and the format of the resulted file "myTxt.txt" is ANSI
CFile file(_T("myTxt.txt"), CFile::modeCreate|CFile::modeWrite);
CArchive ar(&file, CArchive::store, 512);
CString str;
str = m_ListCtrl.getItemText(0,0);
TRACE(str);
ar.WriteString(str);
isn't it weird? anybody has any idea?
Thank you very much!!!
-------------------
I am learning C++ and English
|
|
|
|
|
|
thank you
-------------------
I am learning C++ and English
|
|
|
|
|
|
Hi
Can any one help me in storing integer values(3-4 values) which i get from a grid control in a Safearray....nd i need to use them again after storing....
This is the code which i wrote is this OK..
SAFEARRAY *intPixels;
SAFEARRAYBOUND rgsabound[1];
rgsabound[0].lLbound = 0;
rgsabound[0].cElements = 3;
intPixels = SafeArrayCreate(VT_I4,1,rgsabound);
int tempint_j = 0,tempint_p = 0;
for(int i = 0;i < 3;i = i+1)
{
CString tempStr; //Getting Values from Grid
tempStr = m_Grid.GetTextArray(i);
//convert values from String to int
//as they are from grid
int tempint_a = atoi(tempStr);
SafeArrayPutElement(intPixels,(long *)&tempint_j,(void *)&tempint_a);
tempint_j= tempint_j + 1;
}
Will the above code stores the values obtained from the Grid control(m_Grid) in the Safe Array.... if this stores the integer values in SafeArray pls tell me how to get them back to Use them.....?
Thanks
|
|
|
|
|
Do you need to SafeArrayGetElement
|
|
|
|
|
I need to get the Values which i stored in the SafeArray Back.....by the by is the above code correct in storing the values in the safearray..
|
|
|
|
|
See here[^]maybe it is some helpful to you
|
|
|
|
|
Hi All's
i trying to making a project in VC++ as front end and mysql as backend
but whenever i build it generate an fatel error " libmysql.lib error"
i check in my system( computer at VC++ ) library there is in ..\\lib\opt
only libMySQL .There is not libmysql.lib ,
how i solve this problem.
What is its exact path from downloding internet.
please help me.
-- modified at 7:14 Saturday 9th September, 2006
mailing me
Yogi
|
|
|
|
|
See here[^] maybe it is some helpful to you
|
|
|
|
|
you mean you have libMySQL.lib? case sensitivity should not matter here. Make sure that path to library is known to VC++. If you not have libMySQL.lib at all, you can download MySQL server from http://dev.mysql.com/downloads/mysql/5.0.html
|
|
|
|
|
hello everybody, i'm living in VietNam, i don't known how to write vietnamese in VC++ example in font time news roman,please help me. thanks a lot.
hall
|
|
|
|
|
|
thanks u for reply my question, Vietnamese in VC++,I mean that in the List Box, on the command botton...the language is Vietnamese, in VC++,I can do it in
some fonts, but in my country we usually use font TIME NEWS ROMAN and this font i can't write in Vietnamese. you can try write simple example to understand my ideal. if have any trouble to see, i will send to u an example.Thank u very much.
hall
|
|
|
|
|
Do you need to write your language in your program?
|
|
|
|
|
hi,
How to add tooltips to richedit control,Anyone help me,
thanks
maheshkanth
|
|
|
|
|
Is your purpose
<br />
m_tooltip.Create(this);<br />
TOOLINFO ti;<br />
ti.cbSize = sizeof(TOOLINFO);<br />
ti.lpszText = "ppp";<br />
ti.hinst = AfxGetInstanceHandle();<br />
ti.hwnd = m_Rich.m_hWnd;<br />
<br />
ti.uFlags = TTF_SUBCLASS | TTF_IDISHWND;<br />
ti.uId = (UINT) m_Rich.m_hWnd;<br />
m_tooltip.SendMessage(TTM_ADDTOOL, 0, (LPARAM) &ti);<br />
|
|
|
|
|
hi,
Thanks for ur reply,
Actually i am doing chatwindow project in vc++,I took two richeditcontrols one is for write the text and send the text messages and emotions also,Another richeditcontrol is to receive that textmessages and emotions,
I have the emotions dialog, in that emotions dialog tooltips are running on that emotions dialog only, i sent that emotions from first richeditcontrol to second richeditcontrol,then the second richeditcontrol received that emotions but it did not display any tooltip on that emotions ,my task is i should get that tooltips on second richeditcontrol(same as skype chatwindow in skype) also i tried so much but i didnt get,
thanks in advance.
-- modified at 7:45 Saturday 9th September, 2006
maheshkanth
|
|
|
|
|
You said that a richedit has tooltip and another richedit doesnt tooltip,right?
|
|
|
|
|
Hi,
Anyone knows how to detect mouseclicks in the child window by CHTMLEDITVIEW ( base class ) MFC VC++ .NET 2003 ?
When i open a powerpoint.ppt from the Main frame's menu, the powerpoint slides are open in the child window. However, i am unable to detect any mouse clicks using WM_LBUTTONUP on the CChildFrame.
Anyone can guide me? Need help urgently.
thanks.
terr
|
|
|
|
|
You need to handle OnParenNotify .
|
|
|
|
|
tks but do u mind to elaborate more? im rather new to C++ .Net using MFC. so i got problem on how to use the function u mention.
terr
|
|
|
|
|
Hi ,
thanks so much for telling me to use onParentNotify. I managed to detect the mouseclick .
thanks so much.
really appreciate.
but would like to check if it is possible to detect mouseclick when i make the powerpoint slide FULL SCREEN? it seems like i cannot detect it. Only within the Child frame.
Any solutions?
|
|
|
|
|
Hi
Please look at this my VS 2005 screenshot.
I am trying to learn resource in VC++.
http://img109.imageshack.us/img109/8540/resourcevh8.jpg
Resources are in VC++ differnet than C#.I see that it includes GUI tools.So i want to see that resources are loaded by
<br />
wcex.lpszMenuName = MAKEINTRESOURCE(IDR_MENU1);<br />
or<br />
wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));<br />
So i think that if i include my new resorces files to my project i can select what i want.I added header files.
<br />
#include "resource.h"<br />
#include "resource1.h" <br />
#include "resource2.h"<br />
I hope i don't make mistake yet.
But VC++ gives same names to resources.For example(in screenshot)
i added as.rc and Name.rc
It gives same name to my resources. for example IDR_MENU1 are same same both as and name.
So how can i add resource to my solution that i can select whatever i want and hasn't got same name.What is wrong here?How can VC++ understand which one i include
for example i write
wcex.lpszMenuName = MAKEINTRESOURCE(IDR_MENU1);
Is IDR_MENU1 belongs to Name.rc or as.rc?SOmething wrong here but ı don't understand and confused about adding new resources and using it.
Compiler's error is :
CVTRES : fatal error CVT1100: duplicate resource. type:ICON, name:1, language:0x041F
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
I am looking for your answers.
Thanks
|
|
|
|
|
You are asking for trouble if you want to add more than one resource file to your project. It's a bad idea to create a pool of resources, they will all be compiled into your exe bloating the size. Only include the resources you want to use.
If you are using the same resources in several projects, I advise you to create a resource only dll, and load that dll into each of your projects.
As for your name conflicts, you have assigned the same id to two icons. If you look in your #define files for the resources, find the #defines for the icons, and make sure they do not have the same number. Icons in particular are used outside your code, for example the icon show in 'explorer' is the icon with the lowest id, so it's not possible to have two icons with the same id.
|
|
|
|