|
How about you read each line and store it in an array of lines.
As you read each line, shuffle the existing lines through the array and read in the current line.
That way you will always have the last 4 lines in your array.
When you reach the end, just display the contents of your line array.
Be aware that your file may not have 8+ lines. It might have only 2 or it might have six (resulting in the two middle lines being printed twice).
You will have to check for this.
If sex is a pain in the ass, then you are doing it wrong!
|
|
|
|
|
HI!
I face some trouble in set the window's size. It seems MoveWindow set the size of whole window including the header. But I try to set the window has the exact client size I want, for example 128*128. How can i realize it?
|
|
|
|
|
You are not giving enough information. I will assume that you have a window and you want to fill
its client area with another window.
Use GetClientRect() to get the client area. You are probably using GetWindowRect()
|
|
|
|
|
|
i don't know if it is the right place to go with this question but mayby somebody will help me. i need to check if control(button,window,desktop icon etc.) i going to click with right mouse button, has context menu or not, and of course i have to do it from my programm , not just by clicking this control. Unfortunatly api getmenu() is no use here.
i will by greatful for any help.
Christopher.
chriss_rook
|
|
|
|
|
I don't think there is a way. When you right-click the control it is sent a WM_CONTEXTMENU message. A control may do whatever it wants when it gets this message.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
I've got a situation where I would like to be able to OpenPrinter(...), and then be able to AddPrinter(...) using the configuration from the First printer.. Thereby duplicating the printer (with a different name), but keeping all the configuration on Windows2000.
Has anyone done anything like this before, or am I going down a dangerous path?
|
|
|
|
|
When I activate my window,my window will not hide the other application window.like when you activate the win2k's desktop,you can see the application
you have run.
|
|
|
|
|
I am trying to use the MM_ISOTROPIC mapping mode with a CScrollView. I keep getting the "Error: must call SetScrollSizes() or SetScaleToFitSize() before painting scroll view." message. To work around this I put a call to SetScrollSizes in my OnInitialUpdate() method. With this call I set the mapping mode to MM_TEXT and size to 100 x 100. I reset the mapping mode in OnPrepareDC to MM_ISOTROPIC and use the SetWindowExtent and SetViewportExt to get the right part of the document to show. This prevents the error but does not show any scroll bars?
Does any body use MM_ISOTROPIC with a CScrollView or know of a demo/sample that does this.
Thanks for any help!
|
|
|
|
|
You are not supposed to use MM_ISOTROPIC with scroll views. The Scroll view has a function
SetScaleToFitSize which will scale the view to the window size.
|
|
|
|
|
I would like to have single instance app that does the write
thing on XP. If some user tries to start the app and it is
running, the bring it to the front otherwise start new instance.
Also if a differnet user starts the app then they should get there
own instance. Anyone know of any place to read up on this behavior.
Thank You
Bo Hunter
|
|
|
|
|
It is in the codeproject.
Just try to search for "single instance"
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Does anybody know if there is a maximum interface card count defined in windows?
What about a maximum IP address count per interface?
Thanks
|
|
|
|
|
Don't know about max cards per system, but Windows only allows one IP per interface.
The question "Do computers think?" is the same as "Can submarines swim?"
DragonFire Software
Jeryth
|
|
|
|
|
Windows does allow multiple IPs per card. Go to your TCP/IP Properties for the ethernet card in question, click on the Advanced button. On the IP Settings tab you should the currently listed IP addresses for the interface. In your case, you should probably only see one. You can click on the Add... to add additonal IP addreses.
|
|
|
|
|
Hi,
I created a class from CFrameWnd that has a CListView as a view.
I created these kinds before but now I have a starnge problem
If I pop up this window and close it, everything is fine. But as soon as I even click inside the window and then close it, I get an exeption and the debugger throws me here:
<br />
CView* CFrameWnd::GetActiveView() const<br />
{<br />
ASSERT(m_pViewActive == NULL ||<br />
m_pViewActive->IsKindOf(RUNTIME_CLASS(CView)));<br />
return m_pViewActive;<br />
}
What is the problem ?
|
|
|
|
|
You could use ASSERT(::IsWindow(m_pViewAvtice) to see if the HWND is available. You could be probably deallocate the HWND somewhere
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
I'm trying to use DirectX v9.0 to draw stippled lines. I use the ID3DXLine interface. For the most part it works. However, I can't get stippled (pattern) lines to render correctly. The pattern does not appear to render correctly. It seems like it only renders correctly if the line is drawn vertically. Any help would be greatly appreciated.
Gort...Klaatu, Barada Nikto!
|
|
|
|
|
I'll have to check my DX 9.0 book tonight, I only have my 8.1 with me now and it doesn't mention ID3DXLine at all, to give you a technical answer, supposing I can find it. A few things to check on in the mean time: update your DX runtime, 9.0b just came out a little while ago, it could be this, but I'm thinking unlikey. Also update your graphics drivers. I had difficulties rendering minor polys until I figured I needed to up my Detonators. BTW if you have an ATI card, don't forget to uninstall all drivers for it thru your control panel before you install the new ones, you get major problems otherwise. One final thought: diagonal lines can be hard to notice any patterns on them since the pixels only touch around the corners for the most part. Do you get this problem when drawing horizontal lines as well? Give me a code snippet to work with and I'll see what I can dig up.
The question "Do computers think?" is the same as "Can submarines swim?"
DragonFire Software
Jeryth
|
|
|
|
|
Thanks for the reply. I am using v9.0. I'm also going to update the drivers. As for horizontal lines, it sometimes fails there also.
Gort...Klaatu, Barada Nikto!
|
|
|
|
|
One other thing. After updating the graphics drivers, reinstall DX 9.0b over the top of that to make sure everything's talking nicely.
The question "Do computers think?" is the same as "Can submarines swim?"
DragonFire Software
Jeryth
|
|
|
|
|
Tough thing. I can't find mention of it in my DX9 book. Whoa. I did look it up on MSDN and actually understood most of it. If you could show some code that you're using, I might be able to come up with something. If the pattern is not being rendered on the line, do you have some control path where SetPattern() is not being called? Another thing is if your video card supports this function in hardware. I've a Radeon 9000 that supports a lot of DX9 in hardware, but not all, especially when it comes to transparency effects, namely cloaking in Halo. It could have something to do with that.
The question "Do computers think?" is the same as "Can submarines swim?"
DragonFire Software
Jeryth
|
|
|
|
|
There were a number of problems with ID3DXLine in the initial release of the DirectX 9.0 SDK which were supposedly fixed in the DX9 Summer Update SDK, which made a large number of fixes and improvements to D3DX. Try updating your copy of the SDK if you haven't updated already.
ID3DXLine simply draws lines via very-thin quads (similar to what many drivers do internally for older cards which don't support drawing lines), so it shouldn't be a driver problem, but you never know
- Mike
|
|
|
|
|
Thanks to both of you for your replies.
I'm currently using the 9.0b (4.09.0000.0902) SDK. I assumed this was the most current. It appears now it might not be. As for a code snippet, the following is the "guts" of the routine that renders the lines:
================================
void draw_line_strip_dx(int numpts, p_3d pts[], MC_BYTE color)
{
D3DXMATRIX worldMatrix;
D3DXMATRIX viewMatrix;
D3DXMATRIX projectionMatrix;
D3DXMATRIX resultMatrix;
D3DXVECTOR3* pVertices=NULL;
BYTE r = GetRValue(Wd_colors[color]);
BYTE g = GetGValue(Wd_colors[color]);
BYTE b = GetBValue(Wd_colors[color]);
D3DCOLOR vcolor = D3DCOLOR_XRGB(r,g,b);
pVertices = new D3DXVECTOR3[numpts];
for (int n=0; n<numpts; ++n)
="" {
="" pvertices[n].x="pts[n][X];
" pvertices[n].y="pts[n][Y];
" pvertices[n].z="pts[n][Z];
" }
="" get="" world,="" view="" and="" projection="" matrices.
="" pdirect3ddevice-="">GetTransform(D3DTS_WORLD, &worldMatrix);
pDirect3DDevice->GetTransform(D3DTS_VIEW, &viewMatrix);
pDirect3DDevice->GetTransform(D3DTS_PROJECTION, &projectionMatrix);
// create a transform: world * view * projection.
D3DXMatrixIdentity(&resultMatrix);
D3DXMatrixMultiply(&resultMatrix, &worldMatrix, &viewMatrix);
D3DXMatrixMultiply(&resultMatrix, &resultMatrix, &projectionMatrix);
// render line strip.
pDirect3DDevice->BeginScene();
pDirect3DLine->Begin();
pDirect3DLine->DrawTransform(pVertices, numpts, &resultMatrix, vcolor);
pDirect3DLine->End();
pDirect3DDevice->EndScene();
// clean up.
delete pVertices;
}
================================
I've also updated my drivers. It did not help. I'm going to take a look at updating to the "Summer SDK".
Gort...Klaatu, Barada Nikto!
|
|
|
|
|
I have resolved this problem by installing the latest SDK and adding some code. I'm not totally convinced that the updated SDK helped, but with the added code, the problem no longer exists. I added calls to SetGLLines() and SetPatternScale() to define the line stipple.
Gort...Klaatu, Barada Nikto!
|
|
|
|