|
-- modified at 4:47 Wednesday 31st August, 2005u create the the application usingDialog based using AppWizard then chooose Windows Socket option it will automatically add #include afxsock.h .u can check it in stdafx.h
|
|
|
|
|
u create the the Dialog based application using AppWizard then chooose Windows Socket option it will automatically add #include <afxsock.h>.u can check it in stdafx.h
|
|
|
|
|
1983ttj wrote:
error C2227: left of '.sin_family' must point to class/struct/union
Do u forget to include afxsock.h/winsock2.h header file in your project....+ also link your project with ws2_32.lib to save project from linker error too.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
We know that you can add a new tab view when you want to add a new source file in visual.net
I also want to do like that.
Could you give me some free example.
Thanks a lot! I do hope you could give me a hand
|
|
|
|
|
The tab control is a basic control, available to any MFC app.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks for you reply,but I mean that I want a tabbed view not tab control
And i want a example programme because i am a green hand
Jack
|
|
|
|
|
Searching[^] this very site gave me a number of hits.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
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
|
|
|
|