|
|
Hello, the codegurus around the world.;)
Tracert command works on Windows OS, and traceroute works on Linux and Unix OS.
I think that tracert shows your side IP address if you use this from your comp.
On the other hand, if we use this from ISP side, we get the different IP address
to the same machine.
However, the true router has the two NIC cards like the incoming packet side and
the outgoing packet side? So, your LinkSys router may work just like Swith?
If your LinkSys includs the agent of SNMP, you can get IP address from Agent.
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
You are talking about the IP of the external interface on your router, right?
AFAIK you are running Linux, which actually might solve your problem
At a work I had a couple of years ago we found out a funny thing, you can use two different protocols to traceroute. ICMP and UDP, one of the protocols shows the internal IP, the other shows the external IP of routers. I can't remember which one shows what.
Linux uses UDP, as default, for traceroutes, and Windows uses ICMP, but on Linux you can vrite traceroute -i and it uses ICMP.
Try with both ICMP and UDP and check if your router shows different IP's...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hi folks.
I'm displaying a bitmap on my toolbar. It works fine on 95/98/NT but on 2000 the toolbar buttons are all blank. Does anyone have any ideas as to the cause/solution?
Flit
|
|
|
|
|
I tried to use GetDC in CMainFrame to get the device context to draw some lines in my client area. These lines are supposed to overwrite the same lines drawn using CView::OnDraw
However, the lines are out of position respective to the original lines even though the start and end pts are the same CPoints. Any idea what's wrong? Something must be wrong with the device context obtained from GetDC I reckon. But I don't want to use OnDraw again to draw these overlapping lines.
|
|
|
|
|
Try CWnd::ScreenToClient
Might work.
Not sure.
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
Just because you're getting the DC doesn't mean your drawing parameters are setup. I would write a view function that sets any drawing parameters you need (startpoints, endpoints, color, etc) and that then calls Invalidate() (calling Invalidate() causes OnDraw() to be called). Of course, you'll have to change your OnDraw() function, possibly add some code to populate some structs or something, and make other minor changes to facilitate what you want to do.
The key is to do all of the drawing in (or from) your OnDraw() function.
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
When you reply to a post here, do it here so that everyone can see your followup comments/questions.
The answer to your question (why do all the drawing in the view::OnDraw() function) is Maintainability. OnDraw() is where all experienced MFC programmers will look for drawing code first.
Like I suggested before, there's more work involved, but the code is a lot easier to follow for someone new to the code. In fact, a related change might (should?) include the associated document class as well. Change the document, and then have the document call UpdateAllViews() to have each associated view redraw itself. The view(s) should get any data necessary for redrawing from the document.
Nobody said it was easy for you, but it will be a lot easier on the next guy, and it will be easier for you to add functionality later on. You might respond by saying this code will only be seen/modified by you, but it doesn't hurt one bit to get into the practice of using MFC the way it was intended and following a few standards as far as putting code in specific places.
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
okie... got the point. It's all part of good practice in coding. Guess i'll try to incorporate everything into OnDraw.
|
|
|
|
|
I've written a few apps that had a *LOT* of code in OnDraw. I abstracted out parts of the code into their own functions, placed this functions into their own file, and placed comments in the OnDraw function pointing to the new file. This allowed me to keep the OnDraw function to a sane size, but still allowed compartmentalizing
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Is there substitute for this funtion.
I need to output a string centered vertically,and I also want the string to be breaked if it is too long.
How can I solve this problem in a simple way?
Thanks in advance.
Wayne Wang
|
|
|
|
|
Add DT_SINGLELINE to the format specifier.
cheers,
Chris Maunder (CodeProject)
|
|
|
|
|
If I add DT_SINGLELINE to the format specifier the string will not break.It seems that DT_VCENTER takes effect only when it is used with DT_SINGLELINE. How can I center breaked string vertically in rectangle just like MicroSoft Excel does?If you find a method to this problem,please share it with me.
Thanks again.
Wayne Wang
|
|
|
|
|
If your text string has newline characters ("\n") in it, it will work fine with DT_VCENTER.
|
|
|
|
|
Hi,
I am currently trying to create a windows-based application in order to compile different projects !
To do so, the user need to select the project he wants to use, and I should then get the latest code from the SourceSafe database and compile it by using nmake in a Createprocess command.
But, unfortunately, when doing so, nkmake only create vc60.idb and vc60.pdd and nothing else.
I know nmake is working because when using it from a DOS windows, I could build my project by typing :
namke /f hfplayer.mak
Here is how I do use the createprocess :
PROCESS_INFORMATION ProcessInformation;
STARTUPINFO StartupInfo;
DWORD dwError;
BOOL bfProcess;
memset(&StartupInfo,0,sizeof(StartupInfo));
StartupInfo.cb = sizeof( StartupInfo );
StartupInfo.lpReserved = NULL;
StartupInfo.lpDesktop = NULL;
StartupInfo.lpTitle = NULL;
StartupInfo.dwFlags = STARTF_USESHOWWINDOW;
StartupInfo.wShowWindow = SW_MAXIMIZE;
StartupInfo.cbReserved2 = 0;
StartupInfo.lpReserved2 = NULL;
memset(&ProcessInformation,0,sizeof(ProcessInformation));
char szCmdLine[256] ;
sprintf(szCmdLine,"nmake.exe /B HFPlayer.mak" ) ;
bfProcess = CreateProcess(NULL,szCmdLine,NULL,NULL,FALSE,0,NULL, "D:\\My Documents\\My Dev\\HFPlayer",&StartupInfo,&ProcessInformation );
Anyhelp would be welcome !
Thanks !
|
|
|
|
|
I have a CFrameWnd derived class which I called CFrameWndEx. If I implement MFC functions (default onclose, ondestroy etc) the class derived from mine works fine and they are used automatically in case i will not override them. (I am not so good in english but trying to explain at my best). But when I try to add my own functions , for example OnHelpSearch or something like that with my own command IDs(not default MFC ones like ID_APP_ABOUT) and also add theit updatecommandUI the class derived from mine does not handle them (I forgot to mention that my class is being comiled into lib so I use import) and menu items and etc. are disabled. How can I solve that ?
Kratz
|
|
|
|
|
I have a small library extending MFC classes usin MFC 4.2. But now C++.NET is coming. Can I compile with NET my lib to use MFC4.2 or 7.0 when needed or I should make 2 different versions of my library ?
Kratz
|
|
|
|
|
Question:
I wanna get a array of string, but I am not sure the dimension of the array.
like this:
int caller()
{
char **Results=new char*[100];
myfunc();
...
}
then
int myfunc(char ***Results)
{
char* resutl0 =(char*) malloc(100);
..
char* resutl1 =(char*) malloc(200);
...
char* resutl2 =(char*) malloc(300);
...
(*Result)[0] = resutl0 ;
(*Result)[1] = resutl1 ;
(*Result)[2] = resutl2 ;
...
}
after finished some code, i wanna free the memory. so, how can i do?
1.
free(result0);
free(result1);
free(result1);
free(Results);
??
2. GlobalFree(Results)
??
3 ??
Thanks.
Code is still code.
|
|
|
|
|
Your method 1 is the right one. By the way, it should be Result[0]=result0 , without your extra * .
If you can afford it, I suggest you forget about char ** s and use vector s and string s instead, like this:
std::vector<std::string> Results(100);
...
Results[0]="Hi dude";
... Automatic cleanup, no worries about getting your strings out of bounds, etc. Give it a try.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
How do i implement multiple views that use the same document in an SDI application
Thanks, Delvi
|
|
|
|
|
|
Thanks , I'll be sure to check them all out. There must be atleast one sample i can use!!
|
|
|
|
|
Hi,
In one dialog based application, i showed a bitmap image. Now i want to
change the rgb color of pixels in the special area. I hope that where the mouse
moved to where the color will be changed. Is it possible or not?
Would you please send me some code or ideas about how to control the mouse move and set the bitmap image window?
Thanks in Advance!
chen
|
|
|
|
|
Hi
Except Windows Time, there are only icons in the taskbar's status area. Sure, the only functions to access it seems to be Shell_NotifyIcon.
But is there a way to add small text or non standard width icon (i don't find any thread speakking about this) ?
Thanks for help.
|
|
|
|
|
I can Set the receive buffer size to 400k(use setsockopt())under Win2000.
but why can't under win98(getsockopt() return is 65280byte),How to solve!
Thanks very much!
|
|
|
|