|
Do you want to get bmp file of a html page?
|
|
|
|
|
No, it's not to get the pictures from the web.
It is to convert the whole html page to image、bmp or Jpeg. (Yes, it's like the snapshot.)
I've already can "Draw" a html to bmp, with anyone of the functions given,
but it's only to html which is not very big.
I think it must have sth to do with the clipboard.
|
|
|
|
|
It looks like you posted this message as a reply to your self and I am assuming that you where trying to reply to me. I am sure that I do not have the answer, although it is possible that I do not understand the question.
You say that you can draw it to bmp but it is only to html, which is not the same thing. A bmp is basically a bunch of pixels (dots/pels/points) that can be displayed on a screen. Html is a language that describes what is to be displayed and more.
If you copy it (which is stored on the clipboard) then you will get a copy of the html file, which is just another text file. The reason for this is that it is just another text file and not a bitmap image. Every thing you see on your display is a bitmap image that has been created or loaded by the operating system (or application) and therefore when you make a copy you get a copy of the description or the image, depending on what form it was originally presented to the system.
I do not know exactly what you are looking for because a bunch of pixels does not tell you anything truly useful.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
In cliboard, it's not a text, it already became a image by GDI function.
Not only html, other formats can be convert to image too.
|
|
|
|
|
Well [blank] if you have a bitmap image on the clipboard then you can copy it to any program that accepts them. If your program does not then it is in your code and you already know that.
Any format that can be translated into a displayable (still) image can be converted to bmp, it is just that sometimes you have to steal them with other code because the code that does the translation does not provide that function.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
|
Oh ~Thx!
But I cannot use "DrawToDC" successfully, it always causes error in "QueryInterface()".......
It seems that it is not refer to the size of html?
|
|
|
|
|
I have written a basic program using MFC. the project name was mfc3.sln. I created it with the style: An empty project. I wrote all codes myslef. somewhere in my program, I have called AfxMessageBox(...). but my project's name appears in messagebox's title bar. how does messagebox know what is my project's name?
|
|
|
|
|
All the source code for MFC comes with your compiler. I quick look yields the fact that the main code behind AfxMessageBox is in the function CWinApp::ShowAppMessageBox . The following is copied from this function:
TCHAR szAppName[_MAX_PATH];
szAppName[0] = '\0';
LPCTSTR pszAppName;
if (pApp != NULL)
pszAppName = pApp->m_pszAppName;
else
{
pszAppName = szAppName;
DWORD dwLen = GetModuleFileName(NULL, szAppName, _MAX_PATH);
if (dwLen == _MAX_PATH)
szAppName[_MAX_PATH - 1] = '\0';
}
So it uses the m_pszAppName pointer in your project's CWinApp derived class or the name of the .EXE itself.
If CWinApp is used it's set like this:
CWinApp::CWinApp(LPCTSTR lpszAppName)
{
if (lpszAppName != NULL)
m_pszAppName = _tcsdup(lpszAppName);
else
m_pszAppName = NULL;
.
.
.
Steve
|
|
|
|
|
Stephen Hewitt wrote: All the source code for MFC comes with your compiler.
Actually it does not, the majority of it comes with the compiler. I learned this by digging very deeply into the code trying to find the source of a particular piece of information and ran up against a road block. That is the ultimate source of the information was outside of the code given us to look at.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Hi all,
i am having this lil doubt over pointers. In some books and links its said that its same i.e both means that it is pointer to character which holds the contents of the character type variable.
Please let me knw what is correct. I am so confused about this issue...
Thanks in advance...
|
|
|
|
|
You are right. Both are the same.
It is just a stylistic difference. Proponents of char* p say it emphasizes that the type of p is a pointer to a character. Proponents of char *p say it minimizes confusion with the syntax of C/C++. For example:
char* p, n, x;
char *p, n, x;
char* p, n, *x;
char *p, n, *x;
If you can't tell, I prefer the "char *p" syntax.
HTH,
Mike
|
|
|
|
|
ok gr8...
Now its making some sence ....
What do you understand by the below piece of code ..
class linklist
{
private:
struct node
{
int data;
node *link;
}*p;
So here link is a variable of type structure and node *link gives out the contents of the address of type struct node ..that means its giving the value stored in link. But what is this *p after the close bracket.
Pls correct me if i said something wrong....and pls tell me about this *p...
Thanks a lot
|
|
|
|
|
CS assignment?
Link is defined as a "node *" -- remember, node* p and node *p are equivalent. So that would not make link a variable of type structure but of type pointer to structure instead.
The *p is a shortcut syntax in C... it declares p to be a pointer to a node.
This is why you must place a semicolon after a struct or class declaration - otherwise it treats the struct {} as a type and the next token the variable name. So you could do:
struct {int x, y;} pt;
And then later you could access pt.x and pt.y . The type of pt would be called an "anonymous struct" since it has no name. I could have written:
struct POINT {int x, y;} pt;
and then pt would be a POINT structure.
Mike
|
|
|
|
|
That was I little confusing even for me. Let me clarify a little bit for ‘Software_Specialist’.
pt is a variable of type ‘struct POINT’.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
ah... right.. Thanks.
Sorry about that.
|
|
|
|
|
Cool! I just remember how simple concepts such as that where very confusing. We may take them for granted, but any one who ask such a question needs clarification.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
1. The prior replies were correct, the two forms are the same.
I like it to the left because then it says what it is, a pointer to some type, char* (pointer to a char, or a string of chars), or a pointer to an int: int*; also, when you do a typecast ( "(char*)" )it looks like this:
char* pointer =(char*) malloc(...); -- since the malloc() function returns a pointer to a chunk of memory. See the part about deferencing below, for yet another reason to shift * to the left.
2. However, as far as having several variables declared in one line, you can do it, but, in general, style guides typically suggest that in modern code, there should only be one (not more than one) declaration per line of code:
char c = '\0';
char* p, i, x; is confusing -- the * only applies to p, not i or x.
// as an extra here in this example, I'm initializing the variable 'c' to equal the 'null terminator,' ('\0'), that is used by the C language to terminate (i.e., end, all strings); also called a sentinel. The C run-time libraries look for this character to detect that the string has ended.
3. Next, you can declare a pointer (pChar) to point to the character (c):
char* pChar = &c;
Here, I'm initializing the pointer to have a value set equal to the address of the variable 'c'. The "&" operator returns the address of what follows it. The pointer variable 'pChar' has the special job of holding the address
of another variable's address, that is, where it 'lives' (resides) in memory. This can be used as one way to prevent crashes, due to uninitialed vars.
4. Now you can do this
char next = *pChar;
And next will have the value also held by 'c' the null ('\0'), which I could have set to any char, such as 'a', 'b', etc. When the asterisk is applied to the initialized pointer, in this way *p, then it is being "dereferenced" meaning that you are going to get the value of the variable the p hold the address of -- yes, it's called indirection, and can be confusing. But this give C the power to do many amazing things, when done right.
5. The struct definition in C let's you declare a variable (as simple struct object, or as a pointer to one of those struct objects, that you are defining the struct to represent, when you define the struct (the 'p' in this case, if I recall correctly) -- this is somewhat strange in that most other languages don't allow for this.
Your text book should show many examples of the linked list. That stuff gets very complex, very quickly, so get someone to show/explain it (fast!) and save yourself hours/days/weeks of pain and strain -- it is much harder than you think, at first. Good Luck!! Tons of examples exist in the net: Checkout: http://www.cppworld.com/tutorials/?tutorial=structures
|
|
|
|
|
so with in main there is no need to declare a object of struct if we want as p could access the data.
I mean there is no need to do -:
int main()
{
Point p1, p2;
because we can do something like this now i.e.
p.data, p.link;
Is that right.
Thanks a lot to all of you to make it so clear.
|
|
|
|
|
Excellent! That will give the original poster much information to dwell on.
‘Mike_V’ was correct as I stated and your knowledge appears to be just as good. I am a teacher by nature, not by vocation, and therefore I like to clarify things when I can.
Why you where writing your post I was doing the same, so take a look and tell me what you think.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Interesting handle you gave yourself ‘Software_Specialist’, add in training to that.
You have gotten off the point of your original post; which had to do with pointers and not types.
In you little code snippet you declare the variables ‘p1’ and ‘p2’, the variable ‘p’ does not exist unless it was declared globally. The values stored in ‘p1’ can be accessed via ‘p1.data’ and ‘p1.link’, and the values stored in ‘p2’ can be accessed via ‘p2.data’ and ‘p2.link’.
You can create your own data type at any time and any where in your code, whether it is a ‘struct’ or a ‘class’.
int main()
{
struct MY_DATA_TYPE { int a, b, c; } my_data;
my_data.a = 1;
my_data.b = 2;
my_data.c = 3;
…..
}
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
The books you have read are correct, they are the same thing. I personally like writing it as char* p , but that is deceptive, as the symbol ‘*’ applies to (modifies) the variable ‘p’ and not the main type (char). The current trend is to declare each variable on an individual line to avoid confusion by those who do not understand that little detail. Once you understand what the ‘*’ symbol means in your code, then you can decide how best to express that meaning by its placement in your own code.
When declaring a variable with the modifier ‘*’, you are stating that the variable will be holding the address (location in memory) of the location where the value, or values, is actually stored. This is referred to as an indirect reference, meaning that it tells you where the value is stored and does not represent the value itself. When using a pointer variable you can use either ‘*p’ or ‘p->’ both of which is called a reference. A reference refers to the actual value(s) stored in memory and can be used to modify that value(s).
The simplest way I know how to explain it is this:
If I know the address of your house and can send you a letter at any time, then I know where you live (that is a pointer). If I go to your house as a guessed, then I can observer and affect the contents of your house, if I so choose (that is a reference).
That is enough, I only took one class on programming and that was because I was having trouble understanding the concept of pointers. Once I understood that the rest of it became non-relevant to me.
Good Luck!
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Thanks a lot to all of you.
Now its making much sence and i could now continue with programming of Linked List based problem.
|
|
|
|
|
hello,
I want to get edit box value from an application.I am using GetWindowText Api,but returning caption not the value written in edit box.Using spy++ , window class name is QWidget , window caption is something which is not visible.
Any idea?
|
|
|
|
|
Only one; look up QWidget which is a cross platform library for creating applications.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|