|
yes web browser having that interface to store in local drive. But how can i achieve same using vc++?...i can save html document of the link but some photos and style sheet all won't come ...
|
|
|
|
|
If you are working under windows, check out WinINet[^].
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
Hi!
I want to add the Icon through code in MFC. Is it possible? I've to read the Icon file name from an XML file,and add the file as an Icon from VC++ code. I don't want to go and right click the "Ico" folder and add the file. How to add an Icon from code?
|
|
|
|
|
Use the LoadImage API to load the icon from the file and then use CWnd::SetIcon to the loaded icon for the window.
|
|
|
|
|
Add it to what?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
A rather relevant question I might add.
|
|
|
|
|
Thanks.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
Hi,
how to get System CPU_TYPE through C++ code? any method is available?
Please share ur idea and url.
Regards,
M.Mathivanan
|
|
|
|
|
Just grab it from the registry. Also, you could be more fortunate with the results of your searching. This information has been posted many, many, many times before.
HKEY_LOCAL_MACHINE->HARDWARE->DESCRIPTION->System->CentralProcessor
|
|
|
|
|
|
Hardware information can only be retrieved through system libraries, not a standard C++ function. For that reason you should mention the OS you're working on. The answer given above works for Windows systems, but not for e. g. Linux or any Mac OS.
Generally speaking, the answer you seek should be in the documentation for your system libraries, which should be available at the website of the manufacturer of the OS (for Linux you might want to check out the site of the distributor). So if you're seeking an URL, that's where you should go.
|
|
|
|
|
Hi,
I build a SDI project with VS2008. Now I want to change the color of the status bar. I inserted
m_wndStatusBar.GetStatusBarCtrl().SetBkColor(RGB(255, 0, 0));
into function
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
but the color didn't change. Can anybody tell me why?
|
|
|
|
|
Do you have themes enabled?
|
|
|
|
|
No, I just used MFC standard SDI project style.
|
|
|
|
|
OK, if you used Visual Studio (post VS6) to create your project, then inside stdafx.h (at the bottom) you will find manifest directives.
If you find these manifest directives, it means your app is themed. If it is themed, then CStatusBarCtrl::SetBkColor() won't work. You'll have to use a CStatusBar control that draws itself - there are several here on CodeProject: http://www.codeproject.com/KB/statusbar/[^]
|
|
|
|
|
Thank you for answer. I've created a new class CMyStatusBar derived from CStatusBar and then made status bar red.
|
|
|
|
|
Hey everybody,
can anybody help me decode the right characters from their binary codes stored in a file? I have this decoding algorithm that goes through all the bits strings and checks if it's 1 so it can output the value stored at the left child of a node in the Huffman tree. However, I only get 'e' every time it prints out every decoded characters in the binary sequence. To give everyone an idea, here is what the decode looks like:
void decode (QueueNode *ithNode, char *bitCode, int codeLength)
{
QueueNode *curNode = ithNode;
for (int j = 0; j<codeLength; j++)
{
if (bitCode[j] == '1')
{
cout<<curNode->leftCursor->value;
continue;
}
else
curNode = ithNode->rightCursor;
}
}
ifstream codeIn("outfile.txt", ios::ate);
char *charGet;
size = codeIn.tellg();
codeIn.seekg (0, ios::beg);
charGet = new char[size];
for (i = 0; i<size; i++)
codeIn>>noskipws>>charGet[i];
cout<<"\nDecoding file:\n";
decode(codeTree, charGet, size);
; but then the output looks like this:
Decoding file:
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee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eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
At this point, the user needs only to enter any character to exit; the program has no runtime error at all.
Can anyone please help me with this? Thank you.
|
|
|
|
|
Does "outfile.txt" contain binary data or text (you're opened as text which is fine if you have 1s and 0s you that are human readable)?
Either way, see this about ios::ate...
"ios::ate - open() performs a seek to the end of the file. Setting ios::ate does not open the file for input or output. If you set ios::ate, you should explicitly set ios::in, ios::out, or both"
modified on Tuesday, May 3, 2011 8:00 PM
|
|
|
|
|
"outfile.txt" is basically the input file that has the binary string of 1s and 0s, and that has to be decoded using the Huffman Algorithm that I made.
|
|
|
|
|
did you see the part about ios::ate?
|
|
|
|
|
Actually, for me to set the ios::ate means that I'm getting first the size of the file; then, I implement seekg(0, ios::beg) to start getting the values. It does work in the encoding part pf my program, where I get first the size of the file, seek back and then use for loop (with the limit of the size) to get each character.
|
|
|
|
|
Francis Paran wrote:
curNode = ithNode->rightCursor;
As you haven't posted the definition of your Tree I can only make assumptions, but shouldn't this be
curNode = ithNode->rightCursor->value; ?
|
|
|
|
|
No, because curNode just points to a node, in which a char variable can get its value.
|
|
|
|
|
Ah, of course. Somehow I was mixing this up with the cout line above, thinking this was also meant to be sent to cout . You're correct.
|
|
|
|
|
Sadly, moving the curNode to point to the right child (with the else statement) will always end up gettin 'e' for all the values being decoded. Any ideas why this is so?
|
|
|
|