|
Hello again guys.
Ok, here's my project situation.
My project launch an application that shows an html page contain japanese letters/characters from the created file. Before the html page launch, there's a hidden process that the html page to be launch is created. I successfully did this process except when the application launch, the html displays unformatted character encoding. I check the html file that has been created and open it in an editor, I see no problem with the html file. In html file, the character set is "euc-jp". But I wonder why, when the application launch, html page displays different from it should be. I wonder if there's any character encoding rule in writing into a file. I only used the fopen and fwrite function for writing html code in a file.
I would like to ask if someone knows about character set encoding in writing to a file. Any help is much appreciated.
Thanks a lot guys out there.
With great power comes a great responsibility.
|
|
|
|
|
|
Thanks for the link. I just convert the string I need to write in an html(from CString to BSTR), and it displays correctly. Though when I open the html file in an editor, it didn't display correctly. Anyway, that's not a big deal. I hope it will display correctly if I open it with Dreamweaver.
Thank you all cp guys. You really help a lot someone like us (beginners in C++/MFC).
More power!
With great power comes a great responsibility.
|
|
|
|
|
Ok. I thought it's ok now, but still not.. I noticed that when the application launch, it display what html file content before an overwriting file process. So this is now my problem, how can I do that the html to be display is the new created one?
Also, when I try to execute the .exe file, it says abnormal program termination. I try to debug, and it detects that a memory leaks happened. I don't know how I will debug this. Another one is several DLL files- no matching symbolic information found. I am really confused with this, I thought it's already ok then suddenly it's not...
With great power comes a great responsibility.
|
|
|
|
|
My project still won't build. I get these two errors:
nafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv
nafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argc
My project statically links to MFC, as otherwise I get a million other errors trying to link to a library we use. It explicitly ignores libcmt.lib, as otherwise it clashes with msvcrt.lib. Any help at all will be greatly appreciated.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Are you compiling with /MD set ? You need to if you want to link with msvcrt.lib. I ask because I seem to remember that you said you used /MT and that causes linking with libcmt.lib.
|
|
|
|
|
OK - I have to compile with /MT because otherwise I can't link to an external library I am using. I am explicitly excluding libcmt from my lib list, but if I exclude msvcrt, I get more errors. Does this mean I am still linking with some libraries that use /MD ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Yes, it does. I am really surprised that a library requires you to use /MT. What ever. I use /MD nearly always. What ever.
All modules need to compile with the same RTL type selected and it looks like it is /MT for you.
Best of luck with it.
|
|
|
|
|
The deal is basically that no matter how often I compiled with /MD, it plain would not link, I suspect the library is linking other stuff that I don't have the source to, and causing this problem there, although the library builds with /MD
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I seem to remember having this error once when building the zlib library. I think it ended up being a single/multithread issue, but I can't be certain.
I found this at Microsoft, don't know if it will help:
Article
He is smart. He will make our Windows go.
|
|
|
|
|
Thanks - this article kind of reiterates what I knew, but I think I have to bite the bullet and find another solution for my problems building with /MD. Obviously, something is not set to /MT and I don't know what it is.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
I have an app. that spends most of its time as a daemon process in the background. I want it to be able to detect when a user logs in or 'switches user' to themselves. Anyone know how to detect a 'switch user' event given that the app. is already running?
Thanks.
|
|
|
|
|
|
|
I coded:
<br />
long i;<br />
HWND *hWnd;<br />
hWnd = (HWND *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 10 * sizeof(HWND));<br />
SetWindowLong(hWnd[0], 0, i);<br />
...<br />
...<br />
hWnd = (HWND *) HeapReAlloc(GetProcessHeap(), hWnd, HEAP_ZERO_MEMORY, 11 * sizeof(HWND));<br />
i = GetWindowLong(hWnd[0], 0);<br />
this code corrupts all hWnd[0], ... , hWnd[9]. but HeapReAlloc only moves data.
i understand that hWnd is not only a data. its memory location is also important. now, can you tell me why its location is important?
-- modified at 18:01 Tuesday 30th August, 2005
|
|
|
|
|
It's not.
Off the top of my head i would suggest changing the HeapReAlloc to:
hWnd = (HWND*) HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, hWnd, 11 * sizeof(HWND));
You have the flags and mem parameters swapped.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Well I'll be BLANKED. I read this earlier and did not see that detail.
Pesonaly I would have just used an MFC container class (like CArray) or an STL class.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
The devil is indeed in the details.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Sorry a lot!!!!!!!!
I was only made a mistake in writing this message. but the problem exist.
|
|
|
|
|
Ok, what about the fact that you alloc hWnd and then call SetWindowLong() on a NULL handle ?
...cmk
Save the whales - collect the whole set
|
|
|
|
|
good afternoon, all
I got all the messege every time I used dev studio debugger.
Loaded 'C:\WINNT\system32\ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINNT\system32\KERNEL32.DLL', no matching symbolic information found.
Loaded 'C:\WINNT\system32\USER32.DLL', no matching symbolic information found.
Loaded 'C:\WINNT\system32\GDI32.DLL', no matching symbolic information found.
Loaded symbols for 'C:\WINNT\system32\COMDLG32.DLL'
Loaded 'C:\WINNT\system32\SHLWAPI.DLL', no matching symbolic information found.
Loaded 'C:\WINNT\system32\ADVAPI32.DLL', no matching symbolic information found.
Loaded 'C:\WINNT\system32\rpcrt4.dll', no matching symbolic information found.
Loaded 'C:\WINNT\system32\msvcrt.dll', no matching symbolic information found.
Loaded 'C:\WINNT\system32\comctl32.dll', no matching symbolic information found.
Loaded 'C:\WINNT\system32\SHELL32.DLL', no matching symbolic information found.
Loaded symbols for 'C:\WINNT\system32\WINSPOOL.DRV'
Loaded 'C:\WINNT\system32\mpr.dll', no matching symbolic information found.
Loaded symbols for 'C:\WINNT\system32\OLEAUT32.DLL'
Loaded 'C:\WINNT\system32\OLE32.DLL', no matching symbolic information found.
The program 'C:\DEV\C++\Billing\ChkCalc\Debug\ChkCalc.exe' has exited with code 0 (0x0).
the MSDN says "This occurs if you have installed a Microsoft application that updates core system files, such as COMCTL32.DLL or OLE32.DLL, to versions that are newer than the operating system version or service pack for which you have installed symbols."
would this effecting my application though? how could I get rid of them without delecting some useful apps? thank you!
|
|
|
|
|
wrote:
how could I get rid of them
I am going to guess that you mean getting rid of the error messages. You can get rid of the error messages by installing the debug symbols.
I might be wrong but I think that you can safely ignore those particular messages.
|
|
|
|
|
This has no effect on your program and can be ignored.
I do not know if there is any way to get rid of them, nor why you would want to.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
If you are using VS7 or later, there's a way to automatically obtain the symbol files for Microsoft DLLs. Once you have it configured (it only requires setting an environment variable) the IDE will automatically download the symbol files from a Microsoft server and store them in your machine.
In this link you can get the details about how to Use the Microsoft Symbol Server to obtain debug symbol files[^]
--
jlr
http://jlamas.blogspot.com/[^]
-- modified at 0:41 Wednesday 31st August, 2005
|
|
|
|
|
is the FilePointer set and got through SetFilePointer and GetFilePointer same for reading and writing?
If yes, Does it mean I cannot read and write from/to different locations of the file at the same time?
Thanks.
|
|
|
|