|
Hi,
I want to read unicode file its content is hindi/english/japanese lang. and file is read into japanese Operating systems.can you please tell me something about this topic?
can you please help me on this asap?.
thanks in advance!
Thanks & Regards
Rakesh
|
|
|
|
|
|
thanks you man i suppose it will help.
i will look into it and get back to you soon.
Thanks & Regards
Rakesh
|
|
|
|
|
if the file is unicode, Only thing you have to do is to pass a wchar_t pointer to the read function.
nave
|
|
|
|
|
yeah you are right
read like that is ok.
so it support unicode format.
Thanks & Regards
Rakesh
|
|
|
|
|
yes. If u do so, you will get the unciode string in the buffer. And What you want is to display it in the edit or some other controls, you neeed to define _UNICODE in your project settings
( Project->settings->Preprocessor definitions )
nave
|
|
|
|
|
Hi,
I have a class which needs to link with the .lib file. The .lib is added in the project settings (Library option). It is compiling perfectly. BUt while building the exe, linker error is thrown and also the following warnign is displayed during compilation for all the member functions of the dll.
warning C4251: '<csample::m_var' :="" class="" 'std::basic_string<_elem,_traits,_ax="">' needs to have dll-interface to be used by clients of class 'csample'
with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Ax=std::allocator<char>
]
Please validate.
Thanks
Raji
|
|
|
|
|
You should also make sure that the where this lib file is located (which directory. Fill up the library direcctory
|
|
|
|
|
Main window is a dialog, and two modeless dialog with popup property are created.
now, I want to get the top one when one overlaps another.
|
|
|
|
|
eat_union wrote: I want to get the top one when one overlaps another.
overide the PreTranslateMessage function of the main dialog and handle the WM_WINDOWPOSCHANGED messages of the child windows.
nave
|
|
|
|
|
thanks!
I'll try it out.
best regards!
|
|
|
|
|
what is "defeat image processing"? Do you know code of it?
|
|
|
|
|
What is google ?
Never heard of it, BTW ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hello.
Im trying to open a file to read some data using VC6 MFC. The problem is that I dont know how to go about after getting the pathname.
<br />
void CMyExtractDataDlg::OnFileOpen() <br />
{<br />
<br />
<br />
CFileDialog m_ldFile(TRUE); <br />
<br />
if (m_ldFile.DoModal() == IDOK)<br />
{<br />
m_filePath = m_ldFile.GetPathName();<br />
<br />
UpdateData(FALSE);<br />
}<br />
<br />
}<br />
Should I get the filename as well or is pathname alone sufficient? How do i go from here?
Thanks in advance.
|
|
|
|
|
It's good programming practice to always use fully qualified filespecs, i.e. use GetPathName() .
/ravi
|
|
|
|
|
Use can use CStdioFile for file operations
Known is a drop, unknown is an ocean
|
|
|
|
|
ReturnRain wrote: The problem is that I dont know how to go about after getting the pathname.
Once you have a file name then call yout Application class's
OpenDocumentFile(m_filePath);
i.e. theApp.OpenDocumentFile(m_filePath);
I think this will serve the purpose.
Sameer Thakur
|
|
|
|
|
Hello,
I'm having a problem when I try to save a file in a different directory (let's say that I simply want to duplicate the file). I have a "default.wav" in my directory and I use a dialog to save it (duplicate it) in another directory with a different name. This is my code:
============
CString strFile;
(...)
strFile = dlg.GetPathName();
(...)
CFile file_orig,file_dest;
char *pBuffer;
(...) <- part that creates "default.wav" in the same directory
file_orig.Open("default.wav", CFile::modeRead);
int length = file_orig.GetLength(); // <<<<< here is the problem !!
pBuffer = (char*)malloc(length);
file_orig.Read(pBuffer, length);
file_orig.Close();
file_dest.Open( strFile, CFile::modeCreate|CFile:: modeReadWrite);
file_dest.Write(pBuffer, file_orig.GetLength());
file_dest.Close();
free(pBuffer);
==============
Any solution that works can be valid (without including aditional libraries if possible). I just want to keep it as simple as possible.
Thanks in advance!
|
|
|
|
|
|
Without knowing the problem you are having, I do believe you should have an access mode AND a
sharing mode when using CFile::Open()
file_orig.Open("default.wav", CFile::modeRead | CFile::shareDenyWrite);
int length = file_orig.GetLength();pBuffer = (char*)malloc(length);
file_orig.Read(pBuffer, length);
file_orig.Close();
file_dest.Open( strFile, CFile::modeCreate|CFile:: modeReadWrite | CFile::shareExclusive);
file_dest.Write(pBuffer, file_orig.GetLength());
file_dest.Close();
If that doesn't help, maybe try checking the return code
|
|
|
|
|
The error consists on an error box saying that it didn't find a file without a name (not exactly in those words because my OS is in spanish language, but that's basically what it says).
I've also tried the CopyFile option without success. I have to include "Windows.h" with the headers, include Kernel32.lib in my project settings, and then i would have to put something like this: CopyFile('default.wav',PChar(strFile),TRUE); (am i right?)
but it gives "error C2015: too many characters in constant" and error "C2065: 'PChar' : undeclared identifier"
Well, i think it it is a little bit too late for me . Tomorrow I will keep trying to find a solution.
|
|
|
|
|
I'd say check your pathnames - the source pathname may require the full path with the name unless
you set the current directory or it's in the system path.
Also, when using CFile::Open, use the 3rd param and you can examine the exception if it fails
(returns 0).
And you need to do all this before you sleep
|
|
|
|
|
I've always used the shell for this:
SHFILEOPSTRUCT sf;
sf.hwnd = m_pMainWnd->m_hWnd;
sf.wFunc = FO_COPY;
sf.pFrom = pSrc;
sf.pTo = pDest;
sf.fFlags = FOF_NOERRORUI | FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOCOPYSECURITYATTRIBS;
BOOL bSuccess = (SHFileOperation(&sf) == 0);
|
|
|
|
|
Use can use CopyFile for this purpose
Known is a drop, unknown is an ocean
|
|
|
|
|
Ravi Bhavnani said
|
|
|
|