|
hi,
ya you were correct..its showing the ascii value rather FEFF as the first character of the file..
but the file encoding is in unicode.. (i have made it to write it in unicode encoding thru code..)
Thanks,
Rakesh.
|
|
|
|
|
That means you didn't save it as Unicode ....
What code are you using to write to the file ?
|
|
|
|
|
Hi there,
The GetKeyNameText function returns the name of the key pressed in the keyboard.
My question is, is there a way to tell whether the key is upper case or lower case?
Jr.
|
|
|
|
|
I think ctype.h is the class that holds the functions isupper and islower which accepts a char and returns whether it is capitalized or lowercase.
|
|
|
|
|
Can you tell me please how can call or access a global variable or a function defined in th Doc.cpp or anyaother class from inside UINT ThreadProc (LPVOID param)?
UINT ThreadProc(LPVOID param)
{
CTestDoc* pDoc = GetDocument(); // error: GetDocument() is not defined???
ASSERT_VALID(pDoc);
::WaitForSingleObject(m_Thread_Sel_Start.m_hObject , INFINITE);
::MessageBox((HWND)param, strThread_Start, strThread_Caption, MB_OK);
CSQLCommand::FindSQLCmd(pDoc,m_strSelect);// error :m_strSelect is defined in the CTestView.h but he can not find it , pDoc is already unkown
bool bKeepRunning = true;
while(bKeepRunning)
{
int nResult = ::WaitForSingleObject (m_Thread_Sel_End.m_hObject ,0);
if(nResult == WAIT_OBJECT_0)
bKeepRunning = false;
}
::PostMessage((HWND)param, WM_THREADENDED, 0, 0);
return 0;
}
Can i define the UINT ThreadProc(LPVOID param) in the CTestDoc.cpp?
And why when i declare UINT ThreadProc(LPVOID param) in the CTestView.h i get this error:
error C3867: "CTestView::ThreadProc": use "&CTestView::ThreadProc".
and when i use &CTestView::ThreadProc i get a csting problem that can not be solved through an explict cast.
|
|
|
|
|
Your problem stems mainly from the fact that the ThreadProc function is static, and therefore cannot access any instance members of your application class.
The easiest fix is the following:
When you call AfxBeginThread, pass the "this" pointer as your Param.
Then, inside the ThreadProc, cast the Param back to whatever object it was when you passed it originally, such as your app class or your document class.
That way, you now have access to all the instance members of your class by using the -> operator.
|
|
|
|
|
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;
}
|
|
|
|
|
You're almost there.
The correct cast is:
((CTestView*)param)->function();
|
|
|
|
|
okay but i got an application crash hier:
#ifdef _DEBUG
void CTestView::AssertValid() const
{
CView::AssertValid();
}
#ifndef _WIN32_WCE
void CTestView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
#endif
#endif
|
|
|
|
|
Do you have a valid CTestView object before starting your thread?
If not, that will cause this crash.
|
|
|
|
|
Hi all,
I am writing contents from an application into a notepad file.. i have used fwrite function... but the file is not saving in unicode format as default...
i want the file to be saved in unicode format...can anyone guide me how to make it through?
Thanks,
Rakesh.
|
|
|
|
|
|
can you please update me the latest version of Dr. Watson, the dump must be suitable to open ind VS 2005 Team edition.
I had older version of Dr. Watson installed, and the dump created with the version is not supported in VS 2005. I get below error msg, Please advice
---------------------------
Microsoft Visual Studio
---------------------------
Unable to start program 'C:\.........\DebugMDd\user8.dmp'.
Debugging older format crashdumps is not supported.
---------------------------
OK
---------------------------
|
|
|
|
|
|
Hi,
i when exactly ExcludeCliprect is usefull.. i had a look in msdn it was as follows but i do not know what is a clipping region..
Creates a new clipping region that consists of the existing clipping region minus the specified rectangle.
|
|
|
|
|
kumar sanghvi wrote: but i do not know what is a clipping region..
See here and here.
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]
|
|
|
|
|
Hi all,
i am making my application unicode supporting one. i have to read content from a file..(say a notepad file)..
i have the contents in this format: "rakesh","male"
"shekar","male" etc.,
When i read the content, it is reading as "rakesh","male"(one squarebox)". when i debugged, i found the hexadecimal value of the box as FEFF which is UNICODE_BOM value..(if i am correct)..
So,after some operations(trim operations),it will come as "rakesh","male"" which leads my final output as rakesh" , male;
how to get rid of that square box? why is it coming actually? if i remove that square box, i can overcome this double quote prob. i think...
Please let me know if am unclear in my question..
Thanks,
Rakesh.
|
|
|
|
|
Someone might be able to offer you help if you show your code.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
It sounds like you are make a call to fgetws() or a similar function which doesn't remove the new line character at the end of the string.
|
|
|
|
|
Hello all,
I would like to ask for an example or documentation how to add the VBA editor to my MFC application (like Excel and Word and other apps (not just MS) do).
Thanks a lot for your support
ulretsam
|
|
|
|
|
|
plzzzzzzzzz help me i read 256 bitmap image in the form of array & i display it but while displaying it not shows its actuall colors .It means it shows blue color at the place of red & white color at the place of yellow & so on I set the VGA graphics mode & use putpixel() & setcolor() graphics functions i want to use this functions onli cause it gives other information coractlly so plzzz tell me how can i display it?
|
|
|
|
|
|
hiiiiiiiiii thanx for sending me code but actualy i use the same methode only initialising graphics mode
EGA which supports 16 colors but i want to put 256 colors plz help for this code i want to display image which I read from hard disk right now my sample image is of tiger which gives correct shape & size it puts colors also but with wrong colors like white insted of yellow etc........
|
|
|
|
|