|
I have two files:
a.txt:
20020102,23.0
20020103,23.0
.............
20021220,23.5
b.txt:
20010101,22
20010102,25
...........
20010301,35
Now I want to append the latest datas of the file "a.txt" to the file "b.txt". How could I do ! Please tell me the easy way to do it!
The focus is: I want appending the "latest" datas of a.txt to the file bb.txt
The latest datas in the file a.txt are the datas that are not included in the file b.txt.
Note: i only want to append the datas that the b.txt is not included.
Thanks a lot!
|
|
|
|
|
Hi,
1. Is it possible to remove the right scrollbar of a WebBrowser control ?
2. In my control I load a page that open a new window with ad every 2 minutes, so i wrote this code to prevent this :
void CBrowserDlg::NewWindow2Explorer(LPDISPATCH* ppDisp, BOOL* Cancel)
{
*Cancel = TRUE;
}
The problem is that if I click on a link, and that link try to open a new window, it will be blocked, so is it possible to intercept the URL of the page that is going to be opened ?
|
|
|
|
|
tinkywinky wrote:
1. Is it possible to remove the right scrollbar of a WebBrowser control ?
I am doubtful that removing the WS_VSCROLL style would do much (especially since, from what I remember, several windows are embedded, not only one). After all, scrollbars are dynamically set and are part of the web browser.
tinkywinky wrote:
2. In my control I load a page that open a new window with ad every 2 minutes, so i wrote this code to prevent this :
Implement the BeforeNavigate2 event handler.
|
|
|
|
|
What is the easiest way of getting a file from the http protocol, of course without the prompt asking the user for confiramtion??
|
|
|
|
|
see the functions
InternetOpen
InternetOpenUrl
InternetReadFile
InternetCloseHandle
..in this order .. and you should easily be able to download a file via http!
greetings
markus ![Smile | :)](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_smile.gif)
|
|
|
|
|
Hi all,
I'm trying to find out how I can 'get into' the ras dial process before a connection is established. Basically, I need to be able to measure the time it takes to carry out the various stages of dialling a connection - whether or not it's my app which instigates the dial.
Currently, I measure the dialling stages (dial, connect, auth, projection, etc) if I dial myself (using a RasDialFun and RasDial). I can measure the timings for the later stages of a dial (everything from Auth onwards) by using RasConnectionNotification to indicate a new connection being made, and then by polling with RasGetConnectStatus to see the later connection stages change. However, I have no way of detecting a new dial occurrence before the physical link is established.
Ideally, I'd like to be able to detect the dialling as soon as it occurred, and monitor the time it takes for the call to be answered (including failures, such as line engaged, etc) for *any* connection, instigated by any app (or even the user dialling via DUN). Is this possible?
Thanks
Mark
________________________
http://www.webreaper.net
|
|
|
|
|
I assume you are using the callback in RasDial e.g. RasDialFunc(UINT unMsg, RASCONNSTATE rasconnstate, DWORD dwError) and checking rasconnstate for all states such as RASCS_OpenPort
If not I can post the states I check.
I never managed to check for a line engaged, what happens is when a line is enaged you get a timeout notification, I would like to teminate the call on an engaed tone, so if you find out how I would be very interested to find out how you did it!
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
|
|
|
|
|
That's exactly what I'm doing, and it works perfectly - as long as I perform the dial myself.
However, I also want to monitor the dialling even if it's performed by another app, or by the user manually starting a connection via dial-up networking. In the latter case, whilst I can get an HRASCONN handle by enumerating RAS connections, it only 'appears' after the RASC_Auth status occurs - meaning I can't time the actually dialling part of the connection unless I initiate it.
Regarding the engaged error issue, I'm not sure - but it's something I have to handle/detect, so if I find a solution I'll post it back in this thread.
________________________
http://www.webreaper.net
|
|
|
|
|
I have one code downloaded from
http://safariexamples.informit.com/0130869856/Samples/Chapt_04/DDISpy/
It is DDI functions spy.
When I start compiling the code. I get the error
"Cannot open include file: 'ntddk.h': No such file or directory"
I included the inc(include) and libfre\i386(library) in the project through the Tools->Options->Directories... but Still no effect...
what I need to do
VIkramS
|
|
|
|
|
Hi guys,
I want a SDI window without minimize, maximize buttons with maximized window. I have overwritten the PreCreateWindow's CREATE STRUCTURE like this:
cs.style=WS_MAXIMIZED | WS_OVERLAPPED | WS_SYSMENU | WS_BORDER; I am getting the window without the buttons but not maximized. What could be wrong??
Thanks in advance.
Satya
|
|
|
|
|
An easier way to do this is to go in the InitInstance(à function of your App-derived class. It's in this function that the function is created.
Find these lines:
<br />
m_pMainWnd->ShowWindow(SW_SHOW);<br />
m_pMainWnd->UpdateWindow();<br />
and replace them by these ones:
<br />
m_pMainWnd->ModifyStyle(WS_SYSMENU, NULL);<br />
m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);<br />
m_pMainWnd->UpdateWindow();<br />
|
|
|
|
|
Thanks cedric,
I got it. ![Smile | :)](https://www.codeproject.com/script/Forums/Images/smiley_smile.gif)
|
|
|
|
|
How can I retrieve an information about length (either in time or frames) from MPEG-1 file? I mean raw, without using any tools, not DirectX too.
The problem is that using DirectX and some other SDK, I'm getting different results, since I've seen in the past that DirectX had several bugs (when working with MPEGs), I can't say for sure which one is right. The difference I get is 24 frames (25 fps, which is almost a second).
Thanx
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
Still haven't found an answer (if anyone know, post please), but found that DirectX still have problems and I cannot work with it if I want frame-accurate
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
Here's some header info for the MPEG file format which should help you:
1-4 byte Sequence header In Hex 000001B3
12 bits Horizontal size In pixels
12 bits Vertical size In pixels
4 bits Pel aspect ratio
18 bits Picture rate
Mind the difference between bits and bytes here. Only the sequence header is four whole bytes, the rest are all a certain amount of bits.
The picture rate stands for a certain frame rate:
1 = 23.976 frames/sec
2 = 24
3 = 25
4 = 29.97
5 = 30
6 = 50
7 = 59.94
8 = 60
|
|
|
|
|
Yep, thanx, found this one too, but it doesn't give me an info about the length... More I'm reading, more I'm thinking that there is not actual length is written into MPEG file...
Anyway.. Vitec (SDK) does a good work, unlike DirectX, which couldn't be used for a frame-accurate editing
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
After upgrading to WInXP pro, JIT Debugging isn't working anymore.
I completely disabled error reporting, but this didn't help.
VC++ options has JIT debugging enabled.
The application shows a msg box with the exception, and OK / CANCEL.
I click Cancel, VC++ pops up, goes into "Debugging" layout, displays the same exception again, this time only with an OK button. OK terminates the debug session.
Wasn't a big problen until now - but now I have an "issue" that appears only with release builds (seems to be performance-dependent, i.e. appears in an "release build with debug info" too), and only if I don't start it under the debugger.
Any ideas?
Peter
Italian is a beautiful language. amare means to love, and amara bitter.
sighist | Agile Programming | doxygen
|
|
|
|
|
As part of my MDI program I created a CMyScrollView class derived from CScrollView. I've overrided the following functions: OnInitialUpdate,OnUpdate,OnSize,OnPrepareDC,etc. In OnInitialUpdate I've called "SetScrollSizes". Everything went well when there's only one file opened, but when I clicked the "new" toolbar button or opened another file, the following MFC codes asserted(in CScrollView::OnPrepareDC(...) from viewscrl.cpp):
#ifdef _DEBUG
if (m_nMapMode == MM_NONE)
{
TRACE0("Error: must call SetScrollSizes() or SetScaleToFitSize()");
TRACE0("\tbefore painting scroll view.\n");
ASSERT(FALSE);
return;
}
#endif //_DEBUG
and the call stack showed:
CScrollView::OnPrepareDC(...)
CMyScrollView::OnPrepareDC(...)
CView::OnPaint()
CWnd::OnWndMsg(...)
CWnd::WindowProc(...)
Where does my codes go wrong? Can anyone help me?
|
|
|
|
|
I have a question. Where can I find a free class (Visual C++) which I can use for parsing XML document?
|
|
|
|
|
CodeProject has a SOAP/XML Section full of simple Xml parsers.
Besides that, MS distributes the MSXML parser, and it's free.
|
|
|
|
|
Does any C++ class exist that would handle most of this functionality for me???
I need it to act system wide so I believe it must be a dll...
Thanks
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski ![Smile | :)](https://www.codeproject.com/script/Forums/Images/smiley_smile.gif)
|
|
|
|
|
Look past MSDN mag issues. You've got a free VBScript/JScript engine mouse/keystroke recorder.
|
|
|
|
|
I've created a pattern brush (not sure if this kind of brush is the right one) in this way:
HBITMAP hBmp=NULL;
m_Height = 400;
m_Width = 622;
CString csPath = "C:\\xxx.bmp";
hBmp=(HBITMAP)::LoadImage(NULL,csPath,IMAGE_BITMAP,m_Width,m_Height,LR_LOADFROMFILE);
CBitmap *pBmp=CBitmap::FromHandle(hBmp);
m_brush.CreatePatternBrush(pBmp);
::DeleteObject(hBmp); And I try to show it using this code (in OnPaint()):
CRect rcClient;
rcClient.left = 0;
rcClient.right = rcClient.left + m_Width;
rcClient.top = 0;
rcClient.bottom = m_Height;
dc.FillRect(&rcClient,&m_brush); I'm trying to use this code in order to show a big image as background, I need to place it not at 0,0 coordinates, and it seems impossible by using this code because it seems that the pattern always begin at 0,0... the problem is that if I change the drawing coordinates, the rect that is filled is filled correctly (the size of the rect is the right one) but the image being drawn inside is not the desired (it gets drawn not at the starting point of the image, it is started at the x,y offset in which the rectangle is being drawn; and when the image reach it's end, then it's restarted at its 0,0 coordinate...
How can I do it?
Thank you in advance...
|
|
|
|
|
see my article,
WndImage Control[^]
It provides the "basics" to paint a bitmap, plus supports tiling (which you're probably looking for).
[edit] I just noticed I didn't update the article yet. An updated version with palette handling support can be found here[^]
Italian is a beautiful language. amare means to love, and amara bitter.
sighist | Agile Programming | doxygen
|
|
|
|
|
Can anyone tell me the easiest way to handle events fired from ATL control in a MFC application. There is a code here at CP but it works only if the connection point interface inside the control is not a dispinterface.
|
|
|
|
|