|
Or, just give each radio button a unique id. (IDC_RADIO1, IDC_RADIO2) Then, you can map a OnClick handler for the ID and no member variable is required. In your handler, you can always ask the button whether it is checked or not as follows:
<br />
void MyClass::OnRadio2Clicked()<br />
{<br />
BOOL bChecked = SendDlgItemMessage(IDC_RADIO2,BM_GETCHECK);<br />
<br />
if (bChecked)<br />
else<br />
}
onwards and upwards...
|
|
|
|
|
I am developing an application in MFC, using the Microsoft Web Browser control, embedded in a CFormView. I have two specific questions related to using the browser control:
1) How do I retrieve the HTML text that is currently being displayed in the web browser? Specifically, when the OnDocumentComplete message fires, I would like to retrieve the HTML currently in the browser, and do some custom parsing on it.
2) None of the standard accelerator keys (ctrl-c, ctrl-v, etc.) work when the web browser control has focus. The only way I can perform these standard operations is to use the context menu (right-click), which is somewhat time consuming for many users.
Thanks in advance!
Brian
|
|
|
|
|
see this
http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/mshtml/reference/commandids.asp
|
|
|
|
|
Thanks, I will check it out.
|
|
|
|
|
1) Try GetouterHTML().
2) In an app I'm slowly working on I grab the keystrokes in Javascript code embedded in the page and send them back to my C++ code.
For an excellent resource on this subject see:
http://www.beginthread.com/Topic/MSVC[^]
Hope that helps.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
I don't see 'GetouterHTML' as a member of the HTML browser class that was generated for me when I added the browser control to my project.
I will take a look at the URL you posted - thanks.
Brian
|
|
|
|
|
Sorry, that was me.
Please respond to *this* post, so I will get an email notification.
Sorry.
|
|
|
|
|
knappbl wrote:
I don't see 'GetouterHTML' as a member of the HTML browser class that was generated for me when I added the browser control to my project.
It is a member of IHTMLElementPtr. eg.
MSHTML::IHTMLDocument2Ptr pDoc( GetHtmlDocument() );
MSHTML::IHTMLElementPtr e;
if ( e != NULL )
{
e = pDoc->Getall()->item( _T("mybody") );
TCHAR szBuff[ 50000 ];
strcpy( szBuff, e->GetouterHTML() );
....
}
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Yeah... How do you get the Icon of a Window? any help would be appreciated
But unfortunatly... The Big Red Boat had Cerebal Palsy...
|
|
|
|
|
I'm sure that there there is an article in CP that get icon and images from files. But I don't have the link now,so search this site.
Mazy
No sig. available now.
|
|
|
|
|
|
Hi,
I use CImage class to read and display an image from file and I do this in OnDraw(CDC *pDC).
How can I cache this image because I don't wanna read it from file whenever OnDraw is called?
thank u in advance.
|
|
|
|
|
Hello,
I've created a program which is waiting for incoming network connections via I/O Completion Ports and I've created a pointer in the network class to a packet processing class which's object is created outside of the class on the heap memory.
All the things worked fine, but I got an error. No compiler or linker error - no error at all, but GetQueuedCompletionStatus() doesn't receive completed packets, when I add a specific number of bytes (in variables) in the Packet Processing Class. What's this??? Memory problems? Other problems? The Processing Class do nothing - an object of it is just created - that's all and the Packet Processing class has no relation to the Thread Function which is call the GetQueuedCompletionStatus() function.
I can only add a WSABUF variable plus 3 bools and 1 short. That's all.
What do you think is the error?
Thanks for your attention and your help,
bond006
|
|
|
|
|
Hi,
I had some problem like this when I used new operator to create an object of a class (a class containing objects of other classes). So, I could get around it by using malloc.... Although, it may sound unprofessional, you may want to give it a try.... Also, if your recently added variable is a static instance of another class which needs dynamic memory allocation, it would be wiser to use a pointer instance of the new class... Pl. share if it solves the problem.
Harsha
----------------------------------
http://www.ece.arizona.edu/~hpg
----------------------------------
|
|
|
|
|
I don't know how I solved the problem. I didn't use malloc and I had no static variables in the class.
It was a quite weird problem.
|
|
|
|
|
I need a way to send a udp packet from win9x but with the source ip of my choice. Since raw socket support is only implemented since win2000 i don't see how i could do this but i know that it must be possible. I know that one way is to write your own NIC driver but thats a bit exagerated according to me. Isn't there another way i could do this... like.. um i don't know, maybe alter the packet directly while still in memory but already passed through the udp stack. I don't know i'm just making things up here lol. But if someone has any ideas or knows how to do it please let me know. Thanks!
Kuniva
--------------------------------------------
P.S.: The practical purpose of this is because there is an application listening for broadcasted udp packets and it uses the source ip for something. Maybe there is another way for me to pass it a packet? Like not sending one out but just putting it there in memory so to the application it seems like it received one? Hope you know what i mean..
|
|
|
|
|
Arhh i can't modify my message anymore!! it says it wasn't posted by me, and loox!! the lil head is dark, but i'm not anonymous!! Itzzz buggyy, someone fix o't! lol
Kuniva
--------------------------------------------
|
|
|
|
|
P.S.: please don't ban me lol
Kuniva
--------------------------------------------
|
|
|
|
|
It's called "bèta-testing" i swear!
Do i get any points for finding these bugs, maybe platina level??? hmmm??
Kuniva
--------------------------------------------
|
|
|
|
|
I'm a little confused here cuz if you're saying that an application is listening to broadcast UDP packets and it needs the broadcaster's source address, then you don't need raw mode.
Regular Winsock API programming of a UDP socket can transmit a broadcast message which automatically inserts the IP address (as the source IP) of the computer sending the broadcast message. This is handled by Winsock. You simply just setup the in_addr structure with the remote port and IP address that you are sending a message to, setup your data field, and you don't have to put in any of the raw type parameters like length of fields, checksums, source IP address, or anything like that. All of that is done for you. You only have to specify the char array that holds your data and the length of it in the sendto() function.
Oh yeah, I forgot. You also have to do a setsocketopt() with a SO_BROADCAST option. Here's some code:
WSADATA wsaData;
SOCKET sock;
SOCKADDR_IN dst_addr;
char sampleMsg[132];
int optval = 1;
int optlen = sizeof(int);
dst_addr.sin_family = AF_INET;
dst_addr.sin_port = htons(myPort);
dst_addr.sin_addr.s_addr = inet_addr("255.255.255.255");
strcpy(sampleMsg, "This is a test sample msg from the box. ");
rc = WSAStartup (MAKEWORD (1, 1), &wsaData);
if(rc != 0)
{
}
sock = socket(AF_INET,SOCK_DGRAM, 0);
if(sock == INVALID_SOCKET)
{
}
rc = setsockopt(sock, SOL_SOCKET, SO_BROADCAST, (char *)&optval, optlen);
if(rc == SOCKET_ERROR)
{
}
while(!kbhit())
{
printf("Sending data: %s Any key to quit.\n", sampleMsg);
rc = sendto(sock, sampleMsg, strlen(sampleMsg) + 1, 0, (struct sockaddr*) &dst_addr, sizeof(dst_addr));
if(rc == SOCKET_ERROR)
{
}
Sleep(1000);
}
|
|
|
|
|
em..yea.. i was affraid you might not understand.
See, I know how to broadcast packets, and i know winsock fills in the ip for me, but thats exactly what i DONT want. I want to fill in the source ip myself, i want to change it to any ip i want, i need this because i need to pretend there is another computer present which is broadcasting ip packets from it's ip, while infact they are coming from the same computer on which the application is running that is listening for the broadcasted packets.
I hope this claryfies things...
Kuniva
--------------------------------------------
|
|
|
|
|
Yeah, I misunderstood. Was wondering why you were doing everything lately in raw mode. Sorry.
|
|
|
|
|
Yea, been working in raw mode a lot lately, wanted to figure it all out, but i still want my application to run on win9x. So no ideas for changing the source ip on win9x?
Kuniva
--------------------------------------------
|
|
|
|
|
Sorry, I had no idea that raw mode wouldn't work on 9x....I just assumed that you needed Winsock 2.0 and if it wasn't installed on 9x, you just install it. I had run into an issue before about trying to put a network card into promiscuous mode and that it would only work on Win2K (of course now I could just use the winpcap lib) but I didn't know about the raw mode restriction too.
Maybe something in that WinPCap library could help you accomplish what you want to do. It's at http://winpcap.polito.it/ Winpcap is used in many products one of which is the freeware sniffer/analyzer, ethereal.
|
|
|
|
|
Yea.. thanks for replying, but kind of already use ethereal and Winpcap, don't think u can use winpcap for generating though, but i'll look into it.
But anyways, thanks for replying, and if i ever do get it sorted, i'll be sure to post an article about it here on CP.
P.S.: And i will get it sorted! Grrrrrrrrrr....
Kuniva
--------------------------------------------
|
|
|
|