|
but this already exist...
it is the mht file type...
TOXCCT >>> GEII power
|
|
|
|
|
What do you mean by: "without any source(jpg,gif)lost"?
Do you want to put the jpg's in the same file?
For the HTML it would be easy... open byte mode read a html file write it to your file, read another and add it to your other file... It would be good if you put some kind of seperator between those html's such as ~seperator~ . For the jpg or other sources you can add them in the same way but you have to write somewhere in your file (The top would be good) the filename,etc...
For the file format I have no information... I think you have to write your extension into the registry and specify the application for it...
Well... I am a beginner ...
|
|
|
|
|
Hi
Provided that I have a class declaration as follows:
class A
{
...
}
and a class object a1:
A a1;
I want to know the difference between the following:
A a2 = a1; (1)
A a2(a1); (2)
A a2 = A(); (3)
A a2(A()); (4)
What is the most preferred? My colleague says that (1) and (2) are equal, since (1) will call the copy contructor automatically and operator= will not be called, is that true?
Thanks!
|
|
|
|
|
** cough **
I was not only wrong, but very wrong
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
When class A has a copy constructor, these lines:
A a2 = a1;
A a2(a1); mean the same thing. The first line does not call operator= (this is a misconception I see posted occasionally). Likewise, lines 3 and 4 construct a new A object then use the copy constructor to copy it into a2 .
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
You cannot stop me with paramecium alone!
|
|
|
|
|
Hi
Thanks for the reply. I have one more question regarding the copy constructor though:
If I'm not wrong, the = operator usually returns an object (in this case, it returns A& [or const A&? or const A? or A?, I'm not sure here, any help will be appreciated]), but since the copy constructor does not return anything, does this mean that the = operator in this case will not return anything also?
Thanks!
|
|
|
|
|
As I said, that is a constructor call in disguise, it doesn't call operator= . The reasoning is that in C you write:
int x = 1; but in C++ the original syntax was the constructor-call one:
A a1;
A a2(a1); So to make the two congruent, C++ also added these:
int x(1);
A a2 = a1; which both initialize a variable. For C++ objects this calls an available constructor with one parameter. If you want to call a constructor with more parameters, you have to use the a2(a1) style of syntax.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
You cannot stop me with paramecium alone!
|
|
|
|
|
Hmm, I could have sworn Meyers explicitly states that not to be the case. However, testing shows you to be correct on your first point but not the second. All four variations result in the same thing.
When I get into work, I will check Meyer's book.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Ok, I checked Meyers and it was an attack of bad memory. He mentions this case:
std::string me;
me = "Bob";
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
|
Hi,
I am trying to create a simple Dialog Based form but have run into a problem that has me stumped.
My code is something like this:
HWND HWndParent;
WinMain(....) {
HWND HWNDStatus;
HWndParent = CreateWindow("PintrackrApp", "Pintracker",
WS_DLGFRAME|WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX
|WS_BORDER, 200, 100, 600, 350, NULL,NULL,
hInstance, NULL);
HWndStatus = StatusBarCreate(hInstance);
ShowWindow(HwndParent,nShowCmd);
ShowWindow(HWndToolbar,nShowCmd); //This is fine
ShowWindow(HWndStatus,nShowCmd);
//Window message loop here
}
HWND StatusBarCreate(HINSTANCE hInstance) {
HWND StatusBar;
RECT rectTest;
int nArray[2];
int nParts;
InitCommonControls();
StatusBar = CreateWindow(STATUSCLASSNAME,"Test Status Bar",
WS_CHILD | WS_VISIBLE | WS_BORDER,
351,0,0,0,HWndParent,NULL,HInstance,NULL);
StatusDC = GetDC(HWndParent);
GetClientRect(HWndParent, &rectTest);
ReleaseDC(HWndParent, StatusDC);
nArray[0] = (rectTest.right)/2;
nArray[1] = (rectTest.right);
GetClientRect(HWndParent,&rectTest);
SendMessage(StatusBar,SB_SETPARTS,sizeof(nArray)/sizeof(nArray[0]), (LPARAM) (LPINT) nArray);
SendMessage(StatusBar,SB_SETTEXT,0(LPARAM) (LPSTR) "TEST STATUS MESSAGE");
SendMessage(StatusBar,SB_SETTEST,1,(LPARAM) (LPSTR) "Test Msg2");
return(StatusBar);
}
Everything compiles ok but when I run the program and display the window I don't see the status bar. If I maximize the window I see the Status Bar displayed about halfway down in my window. Both of the messages and partitions appear to be correct. The status bar is also only as wide as my Toolbar. It does not fill the whole width of my window.
I have tried searching MSDN & Code Project Fourms and the only thing I found suggested checking that my screen resolution is not smaller than my window. The screen resolution is 1024 x 768 and my windwo is 600 X 350. I am Stumped, I thought windows was supposed to be smart enough to place the status bar at the bottom of the window. Any ideas?
RWA
|
|
|
|
|
|
Huh? What does Clikety[^] mean?
|
|
|
|
|
|
Ok, once you explained it Clikety I was able to follow the link. Thanks.
I did some more research on this myself and finally figured it out . In the Platform(?) SDK MSDN doc it mentions that windows defaults it's positions for a new window based on the last window created. Since I was creating a Toolbar before the Status bar the Status Bar was placed in a position I didn't expect. I experimented a little and finally got the right positioning when I create the Status Bar BEFORE I create the Toolbar....
Thanks for your efforts....
|
|
|
|
|
How do i intercept any dialup connection attempts in Windows 95/98? For example, if you normally connect to the Internet thru dialup networking, how do you popup a messagebox before the "Connection" dialog appears? I've read something about API hooking, but I'm not possibly sure how this is done. Your help would be very much appreciated.
Feed your mind...
|
|
|
|
|
Hi!
Well I am looking for the same thing... I made an application for the dialup processes ( using RAS ). Well I don't know anything for intercepting the dialup connection requests... Well I didn't try it but what will happen if I try to open a dialup connection while I have a connection opened? Will it close the old connection automatically and connect the new one or send an error message? ( I can't try it right now cause I have no dialup modem right now... )...
Another thing is API hooking but someone warned me that it would slow down the system very much to filter all the requests made by all applications...
Please let me know if you find something about it!
Well... I am a beginner ...
|
|
|
|
|
looking for a quick way to dynamically change tooltip text--
I.E. change tooltip string text based on some other action
|
|
|
|
|
Have you tried CToolTipCtrl::UpdateTipText(...); ?
|
|
|
|
|
I'm looking at doing some VERY simple webpage parsing. My plan is to turn either the source or the output of the webpage into a text file, and then parse that. However, I do not know how to either get a pages source or output into a text file.
Any hints or better (as in simplier) methods would be well appreciated.
If you have a problem with my spelling, just remember that's not my fault. I (as well as everyone else who learned to spell after 1976) blame it on Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
i'm not sure to understand...
htm, html, dhtml files and so on are pure text file !
for example, you can do this simple following thing : save this page (this one or another is you prefer) as an html file...
then, browse you hard disk toward the recently saved file. right click on the file and open it with Notepad... what do you see ? binary ? no of course.
you can submit your parser an htm file directly.
If you really need to have a txt file, you can simply change the extension (*.htm -> *.txt) or add the txt extension to the file name (*.htm -> *.htm.txt). whatever you want...
TOXCCT >>> GEII power
|
|
|
|
|
Not exactly what I mean. I wish to have a program go to a site, and then parse that. I want to only have to press a button to have it do all that...
I wish to use fstream to parse the page's text, but I can't figure out how to access the text through the program.
If you have a problem with my spelling, just remember that's not my fault. I (as well as everyone else who learned to spell after 1976) blame it on Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
Have the program save a copy of the file (InternetReadFile) then use the fstream functions to read/parse it like it was any other file.
|
|
|
|
|
1) Open web page in Internet Explorer
2) From the menu select File/Save As...
3) In the "Save Web Page" dialog set "Save as type" to "TextFile (*.txt)
4) Give the file a name and a location and click the "Save" button
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|