|
The compiler assumes it as a 16-bit number. So,
0x1F = 0000000000011111
0x1F << 6 = 0000011111000000 = 0x7C0.
So, for 8 - bit operation may be u can write as
unsigned long a = 0x1F;
a=LOBYTE(a<<6);
It gives the desired result....You can fit it into your program...
Harsha
----------------------------------
http://www.ece.arizona.edu/~hpg
----------------------------------
|
|
|
|
|
Thanks...and you clarified for me what hi and lo - byte means, I was wondering about that for some time!
|
|
|
|
|
Be aware that:
a) Bytes get int-expanded when shifting things around
b) char, int etc. are signed - which makes the shift "arithmetic", i.e. the highest order bit remains set.
So a) use unsigned char, and b) cast th shift result back to unsigned char.
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
Hello,
where can i get "tom.h". I have visual studio 6.0 enterprice eddition and sp5. but there is no such file.
Thanks in Advance to solve this problem.
Thank you
Asad Rasheed
|
|
|
|
|
Download the Platform SDK.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Hi , I wanted to know what is the function that detect a radio button is detected
example : in A Wizard the next button is disabled
what'is the function that enable the next button if a radio is checked.
Please Help,
Thanks
Bye
|
|
|
|
|
If you are using MFC then using classwizard, assign a member variable to the first radio button in the group.
Then, handle the BN_CLICKED message for each radio button in your group. Check the state of the member variable (having called UpdateData()). If it the right value then enable your Next button.
hope this helps
Adam.
My world tour
What I do now..
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
|
|
|
|
|
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
--------------------------------------------
|
|
|
|