|
hi all,
i am making my unicode supporting one. i have to read content from the notepad file..
i am using Read(cstring x,uint ncount) function..(MFC function..)
i have chinese content in my file now.. if i try to read the file, the max. number of bytesread is 1268 only.. y is it so??
i tested with various files too.. but it reading upto 1268 characters... can anyone shed some light on this one??
whereas , i have a text file which contains only english characters but saved in unicode format was read successfully.. the file size was 142,266 bytes and it read completely..
its surprising me that its reading only 1268 bytes when i have chinese characters in my file..
pls tell me the approach how to solve this issue..
Thanks,
Rakesh.
|
|
|
|
|
Rakesh5 wrote: i am using Read(cstring x,uint ncount) function..(MFC function..)
Post the exact code, please.
Rakesh5 wrote: if i try to read the file, the max. number of bytesread is 1268 only
Out of how many?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I have this strange problem.. I made a program in VC++ which makes LAN(Language) file from database.. I had this "Simplified Chinese" database and i made some 10-12 LAN files from it.. Now when i try to read and write LAN files entries in my project, it shows mixture of "???? and some right data"... So i again did the read/write operation using Unicode, and all went well...
Now the project is real big and i was only making LAN file from database, Other application which are uncountable uses my LAN file to read and write data into the project window and they aren't using Unicode to read or write, so obviously the output comes as mixture of "???? and some right data"...
So it's vivid that if i change all the application to read/write using Unicode only then it will show right data, But problem is that i can't change anything as it was written a long time back and a lot depend on that coding... So is there any way i can still do this thing.
P.S
No problem is coming when i use "Chinese(Traditional), Portuguese, Italian, German etc" databases... I guess some of simplified Chinese character are not detected if we don't use Unicode method..
Thanks all
|
|
|
|
|
No one
|
|
|
|
|
i am usging msdn in visual studio 2008.
but help section font is very small.
so how can i change font size?
http://msdn.microsoft.com/en-us/library/aa911376.aspx
but i can't find HKEY_CURRENT_USER\SOFTWARE\Microsoft\HELP\ZoomSetting .
so is there other way to change font size?
hi
My english is a little.
anyway, nice to meet you~~
and give me your advice anytime~
|
|
|
|
|
No need to change any registry setting.
You can find it in the menu.
View -> Text Size -> Largest
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
have a nice day^^
hi
My english is a little.
anyway, nice to meet you~~
and give me your advice anytime~
modified on Monday, August 3, 2009 11:20 AM
|
|
|
|
|
Hi,
I want add the performance counter with instance like phisical component(Processor,Memory etc) and want monitor those counter. How can it be done?
Thanks
vijay
|
|
|
|
|
Are you wanting something like this?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Guys,I know this question has been asked ad-nausem, but I have the exact opposite problem. My release build works fine, my debug build does not !
I have an application that starts a whole lot of threads for processing multiple feeds of video and audio. In my release build all threads start successfully, but in my debug build some threads fail to start, AfxBeginThread returns NULL and GetLastError return 0.
I am assuming that some or other resource has to be increased for my debug build to work. I've increased my stack sizes (in project properties) to 10x what it was without making a difference. What other properties/resources can I try to set for my debug build to work ? Any other reason why some of my threads won't start in debug build ?
modified on Monday, August 3, 2009 8:27 AM
|
|
|
|
|
Hm, I had that problem two weeks ago.
Solution was simple in my case (well, after almost despairing), in project properties the debug and release version had provided different arguments to the main function.
Souldrift
|
|
|
|
|
Hi Souldrift,
Where in the project properties would I see that ? I looked through all the settings, but could not quite see where you can pass arguments to main.
|
|
|
|
|
Well, the problem here is, I got the german version. But I try to translate.
When I open the project properties there´s on the left side a box where I can find
* General properties
* Framework etc ...
* Configuration properties
* General
* Debugging <--
* C/C++
* etc.
You can find it under Configuration properties->Debugging. In the right window you can now see the arguments in the second line.
But then again, if you don´t know this property, then you most like didn´t enter anything in into it, anyway. You can use this to 'simulate' (argc, argv) arguments of a main function .. if your project has one. And as for everything else, you can do this seperately for Release and Debug version.
Souldrift
|
|
|
|
|
Thanks, but as you expected I have no arguments specified there !
|
|
|
|
|
First of all, sorry for my bad english.. I need help with my c code..
void Calculate()
{
for (int i=0;i<1;i++)
{
for(int j=0;j<3;j++)
{
c[i][j] = x[i][j] * w[i][j];
sum1 += c[i][j];
printf("Output[%d]: %.1f ",i+1,c[i][j]);
}
printf("\n");
printf("Sum: %.1f\n",sum1);
}
printf("\n");
for (int i=1;i<2;i++)
{
for(int j=0;j<3;j++)
{
c[i][j] = x[i][j] * w[i][j];
sum2 += c[i][j];
printf("Output[%d]: %.1f ",i+1,c[i][j]);
}
printf("\n");
printf("Sum: %.1f\n",sum2);
}
printf("\n");
for (int i=2;i<3;i++)
{
for(int j=0;j<3;j++)
{
c[i][j] = x[i][j] * w[i][j];
sum3 += c[i][j];
printf("Output[%d]: %.1f ",i+1,c[i][j]);
}
printf("\n");
printf("Sum: %.1f\n",sum3);
}
printf("\n");
for (int i=3;i<4;i++)
{
for(int j=0;j<3;j++)
{
c[i][j] = x[i][j] * w[i][j];
sum4 += c[i][j];
printf("Output[%d]: %.1f ",i+1,c[i][j]);
}
printf("\n");
printf("Sum: %.1f\n",sum4);
}
printf("\n");
}
how can i make this code become simple? its a sum of each row.. it has 4 row, sum1 is the sum for the first row only.. and sum2 is the sum for the second row only and so on.. please help me on how to make this code simpler cause i think its redundant.. thanx..
|
|
|
|
|
Hi,
not sure since you didn't show all declarations, but this should come close:
int sums[4];
for (int i=0; i<4; i++) {
sums[i]=0;
for(int j=0; j<3; j++) {
c[i][j] = x[i][j] * w[i][j];
sums[i] += c[i][j];
printf("Output[%d]: %.1f ",i+1,c[i][j]);
}
printf("\n");
printf("Sum: %.1f\n",sums[i]);
}
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
thanx Luc Pattyn for ur help..
|
|
|
|
|
Hi all,
i am using this smart pointer to send http request to server:-
IServerXMLHTTPRequest2Ptr pIXMLHTTPRequest = NULL;
Then through this I called the method setproxy where second parameter is having some ip address:-
pIXMLHTTPRequest->setProxy(SXH_PROXY_SET_DIRECT,varProxyName,L"");
but this is causing exception and getlasterror() is returning "3".Please rovide some suggestions.
Thanks A Ton
Ash_VCPP
walking over water is just knowing where the stones are.....
|
|
|
|
|
When you call setProxy() have you already acquired a pointer to an object implementing the IServerXMLHTTPRequest2 interface? Have you properly set up varProxyName?
1300 calories of pure beef goodness can't be wrong!
|
|
|
|
|
Hi Bacon,
First of all thanks for the reply....i have posted it three times but i get first reply so thanks.
i have used pointer of the interface like this:
IServerXMLHTTPRequest2Ptr pIXMLHTTPRequest = NULL;
and called the method setproxy on the same:-
pIXMLHTTPRequest->setProxy(SXH_PROXY_SET_PROXY,varProxyName);
where varProxyName = SysAllocString(L"114.127.246.36:8080");
when you sya...."have you already acquired a pointer to an object implementing the IServerXMLHTTPRequest2 interface"
so can you explain it in detail.or if you can provide some example for set proxy then it would be really helpful, because i didnt get anything useful in google....
Thanks A Ton
Ash_VCPP
walking over water is just knowing where the stones are.....
|
|
|
|
|
Ash_VCPP wrote:
IServerXMLHTTPRequest2Ptr pIXMLHTTPRequest = NULL;
When you assign NULL to pIXMLHTTPRequest this tells it to point to nothing. You have to get an object of type IServerXMLHTTPRequest2 and assign it to pIXMLHTTPRequest before you can use it.
Ash_VCPP wrote: so can you explain it in detail.or if you can provide some example for set proxy then it would be really helpful, because i didnt get anything useful in google....
I haven't used IServerXMLHTTPRequest but it's a COM based object so you'll need to call CoCreateInstance() at some point. If you're not familiar with COM I suggest reading one of the introductions here on CP.
1300 calories of pure beef goodness can't be wrong!
|
|
|
|
|
hi Bacon,
Please see the code:
HRESULT hresult = CoInitialize(NULL);
IServerXMLHTTPRequest2Ptr pIXMLHTTPRequest = NULL;
hr=pIXMLHTTPRequest.CreateInstance("Msxml2.ServerXMLHTTP.4.0");
that i have done.....please suggest if i am missing something.
Thanks A Ton
Ash_VCPP
walking over water is just knowing where the stones are.....
|
|
|
|
|
Hello,
i tried it the way you said, but it did not work , maybe i did something wrong, hier is the code:
void CTestView::ThreadStart(CTestDoc* pDoc, CString strSel)
{
m_Thread_Sel_Start.SetEvent ();
HWND hWnd = GetSafeHwnd();
m_strSelect = strSel;
m_pDoc = pDoc;// i need to access the CTestDoc.cpp, i passed pDoc from the CTestDoc.cpp to the CTestView.cpp
// and then assigend pDoc to m_pDoc which defined in the top of the CTestView.cpp
AfxBeginThread(ThreadProc, this/*hWnd*/, THREAD_PRIORITY_NORMAL);// Hier i passed this to the ThreadProc function
}
UINT ThreadProc
(
LPVOID param
)
{
(CTestView*)param-> // casting to CTestView did not work?
return 0;
}
|
|
|
|
|
I encourage you to read this [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
okoay but i have an application crash hier:
#ifdef _DEBUG
void CTestView::AssertValid() const
{
CView::AssertValid(); // application crash
}
#ifndef _WIN32_WCE
void CTestView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
#endif
#endif
|
|
|
|