|
|
TCP or UDP socket is identified by the key. The key containing IPaddress of the source machine, source port (client port), IPaddress of the destination machine and destination port.
If all the numbers are equal, it is recognized as a packet for some socket.
In case of TCP there follows some additional checkings like SEQuence number etc. But it is already delivered to some session
|
|
|
|
|
|
I am having problems "refreshing" a picturebox in Windows 98. In winXP this doesn't seem to be a problem. Is anyone aware of this, or can offer a solution, or where to look in my code
Here is a snippet of one of my functions to let you know how I am displaying in the picturebox. The picturebox has a baseball diamond, and I write little .bmps of the baserunners and then I use TextOut to display the runner's names, but The names get written on top of eachother, which only happens in Windows 98.
<br />
void CJoeBroadCastDlg::DrawBatter(CString str_PlayerName)<br />
{<br />
CEdit* Picture;<br />
Picture=(CEdit*)GetDlgItem(IDC_PICTUREBOX);<br />
Picture->EnableWindow (true);<br />
Picture->ShowWindow (SW_SHOW); <br />
CDC * my_cdc = Picture->GetDC();<br />
if (!my_cdc)<br />
{<br />
AfxMessageBox("Error: Invalid CDC pointer!!!");<br />
return;<br />
}<br />
CBitmap oBitmap;<br />
VERIFY(oBitmap.LoadBitmap(IDB_BASEBMP));<br />
<br />
CBitmap oField;<br />
VERIFY(oField.LoadBitmap(IDB_FIELDBMP));<br />
my_cdc->SetBkMode(TRANSPARENT);<br />
my_cdc->SetTextColor(RGB(255,255,255));<br />
my_cdc->SetBkColor(RGB(189,153,103));<br />
my_cdc->DrawState(CPoint(127,210), CSize(0, 0), &oBitmap, DST_BITMAP, NULL);<br />
my_cdc->FillSolidRect(127, 227, 100, 16, RGB(189,153,103));<br />
my_cdc->TextOut(127, 227, str_PlayerName); <br />
}<br />
This is called to "refresh" this screen, basically draws on top of all other displayed items before next event/drawing happens. But it doesn't seem to be working in Win98 If a .bmp baserunner is drawn, it too is not cleared.
<br />
CBitmap oField;<br />
VERIFY(oField.LoadBitmap(IDB_FIELDBMP));<br />
m_picturebox.SetBitmap(oField);<br />
Thanks
Later, JoeSox www.joeswammi.com A Season in Hell[^]
|
|
|
|
|
You are drawing all that to an edit control? I don't know if you need to use an edit for some specific reason, but I think it would be much easier to derive a class from CStatic and do your drawing in the OnPaint of the CStatic subclass. Then, when you want to redraw it, you simply call Invalidate().
Chris Richardson
C/C++ Include Finder[^]
|
|
|
|
|
Thanks for replying to my disparate plea for help. For some reason I didn't get my regular email notification, so I just saw your reply late last night and I have been doing testing off and on thru out the day, in my spare time.
Chris Richardson wrote:
You are drawing all that to an edit control? I don't know if you need to use an edit for some specific reason
When I was doing research on the subject I found this link:
http://www.experts-exchange.com/Programming/Programming_Languages/Cplusplus/Q_20403906.html[^]
My user clicks on the menu "Open Virtual Game Cast" which then opens a dialogbox(CDialog(CJoeBroadCastDlg) it must be a dialog box because the user must tell the program which simulation number they would like to watch, and the dialog has stop and cancel button etc. In this dlg is a picturebox which has the Baseball diamond and baserunners running around , plus I use text to speech engine so the user also hears playby play.
But take a look and the link and tell me what you think, if you wish . I know I could have used a better approach but I am short on time and need to implement a fix ASAP, because the goal is to release by baseball season.
Thanks again.
Later, JoeSox www.joeswammi.com Killing In The Name[^]
|
|
|
|
|
If it wouldn't be too much of a problem, could you send me the bitmaps you use? I'll write up an example program, showing the proper way to get this type of thing done. Then it should be pretty straightforward to integrate it into your code
Chris Richardson
C/C++ Include Finder[^]
|
|
|
|
|
I just figured it out!!! woo hoo. I needed to add RedrawWindow() , in XP it did it automaticlly, I think.
I didn't get the notification email, so I don't have your email address but I posted the .bmps and the class that handles this here http://joeswammi.com/downloads/RES.zip[^]. It is not the best code in the world, I am self taught and have been programming for speed since I need to get the basic features done by baseball season. I appreciate your help. I think I understand what your saying, but I would have to redesign my whole class, which I would lose at least a week or two and that's when the real baseball season starts. That's nice of you to offer, if's it's not that much trouble, I would like to see the correct way of doing it, I tried researching this before designing the class but I couldn't find the correct material, but don't spend too much time on it, if you don't want to. Thanks I better goto bed
Later, JoeSox www.joeswammi.com Killing In The Name[^]
|
|
|
|
|
Joe, i followed ur "rant" into here
your really missing the whole "window" paradigm. i have never tried to do what you are doing since it is so non-standard.
typically you don't draw into a device context of a child window from a parent window.
the standard approach for your situation would be to derive a class from CWnd that represents your drawing canvas, let's call it CDiamond. The parent window can handle placement and sizing of the child window if you desire. then when CDiamond class receives a WM_PAINT message you do your drawing to the device context at that time.
hope this helps
-pete
"No matter where you go, there your are..." - Buckaoo Banzi
-pete
|
|
|
|
|
|
um, not to overstate the obvious, but does RedrawWindow() not work?
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
|
I tried you suggestion again but in a different spot in my code and it works Thanks!!
Later, JoeSox www.joeswammi.com Killing In The Name[^]
|
|
|
|
|
Cool. NP.
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Hi,
How do you retreive the path and filename of the running program?
It's so I can create self-extracting modules.
Thanks in advance.
|
|
|
|
|
|
DWORD GetModuleFileName(
HMODULE hModule,
LPTSTR lpFilename,
DWORD nSize
);
for the hModule , just pass the HISNTANCE of the program, usually a variable named hInst in WIN32 APIs or returned by AfxGetInstanceHandle() in MFC
|
|
|
|
|
Well yeah, I know that .... I think you meant to reply to the other guy
Chris Richardson
C/C++ Include Finder[^]
|
|
|
|
|
Sorry for that, I did meant to reply to the other guy.
|
|
|
|
|
|
I am currently tring to include the library Netapi32.lib
|
|
|
|
|
In VC6: Go to Project, Settings, Link tab. Select the General category from the dropdown. Add NETAPI32.LIB to the Object/library modules field.
In VS.NET: Go to Project, Properties, Linker, Input. Add NETAPI32.LIB to the Additional Dependencies field.
Software Zen: delete this;
|
|
|
|
|
#pragma comment(lib, "Netapi32.lib") somewhere in your source...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
I dont know if this is the right place for my Question, but i've got now solution by posting this question to many boards ;-(
I've the following situation, i'am running Windows XP with a networkcard and a 56k modem as internetconnection. there is a problem when i hangup the modem connection, the statistic counter are getting lower than before.
i can check that with "netstat -e"
This one is before i hangup my modem
Received Sent
Bytes 1602015 1158327
Unicastpakete 8346 8196
Nicht-Unicastpakete 140 118
Verworfen 0 0
Fehler 0 0
Unbekannte Protok. 0
This one is after i closed my modem connection
Received Sent
Bytes 858279 1122709
Unicastpakete 7283 7397
Nicht-Unicastpakete 144 103
Verworfen 0 0
Fehler 0 0
Unbekannte Protok. 0
Has anyone an idea? I currently make programm witch checks
this things by using GetIfEntry, but doesnt get the right
values, is this a XP bug ?
{
*pReceived += mib.dwInOctets;
*pSent += mib.dwOutOctets;
}
http://www.pmasoft.net/englisch/onlineeye_prof.htm
Thank You
|
|
|
|
|
I'm playing video with IGraphBuilder interface. But i want to draw on this video (client area of ActiveX wnd [IVideoWindow]) some GDI objects ( line, circle, text) - only playing, stepping, pausing.It may be done with filters, but i don't know, plzplzplz help
thnx
J.
|
|
|
|