|
<br />
HDC hdc=CreateCompatibleDC(::GetDC(this->m_hWnd));<br />
HBITMAP hbit=CreateCompatibleBitmap(GetDC()->m_hDC,800,600);<br />
hbit=(HBITMAP)SelectObject(hdc,hbit);<br />
hbit=(HBITMAP)LoadImage(AfxGetInstanceHandle(),"d:\\error.bmp",IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE|LR_CREATEDIBSECTION);<br />
<br />
SelectObject(hdc,hbit);<br />
BitBlt(GetDC()->m_hDC,0,0,800,600,hdc,0,0,SRCCOPY);<br />
whitesky
|
|
|
|
|
See i go bit by bit..how do i know the current background color of the Bitmap.I do i know ,what ever color i got from Getpixel is the current color of the Bitmap..and last but not least i am using Vc2005..when i declare CImage image; ERROR :undeclared indentifer CImage..?
|
|
|
|
|
include atlimage
whitesky
|
|
|
|
|
Hello,
Can anybody help me how to distinguish 2 USB audio devices? I have one PCI2USB card (4 ports) and have 4 USB composite (HID + Audio) devices, which can be use which Skype. Anytime I reboot my PC the device name changed, sometimes it is "USB Audio Device", sometimes it is "USB Audio Device 2", sometimes it is "USB Audio Device 3", and sometimes it is "USB Audio Device 4". Anybody know how Windows assign the USB device name? Any naming convention? And finally, how can I get the VendorID/ProductID from the device name? (For example, i want to know if "USB Audio Device 4" is mapped to which vendorID/ProductID?
Thank you in advanced
Best regards,
Dong
|
|
|
|
|
Hi
I hope that you might have known the GUID of your device.
Then you can search for the GUID in registry
[HKYE_LOCAL_MACHINE\SYSTEM\currentcontrolset\control\class]
under this key you will find your GUID key
under your GUID key thir will be one
"MatchingDeviceId" key which stores VID and PID.
Regards
Anil
-- modified at 7:39 Friday 2nd June, 2006
|
|
|
|
|
Anil,
Thanks for quick reply.
Seem that under HKYE_LOCAL_MACHINE\SYSTEM\currentcontrolset\control\class, all USB audio devices have the same name "USB Audio Device". I could not find "USB Audio Device (2)", "USB Audio Device (3)", and so on. But if I open Sound and Audio Devices Properties Dialog, I could see 4 USB Audio Devices "USB Audio Device", "USB Audio Device (2)", "USB Audio Device (3)", "USB Audio Device (4)". I could recognize my USB device is "USB Audio Device (2)". But next reboot, my device may be named as "USB Audio Device (3). So, my previous setting becomes wrong.
Best regards,
Dong
|
|
|
|
|
Hello again
In Unicode build,how to convert a TCHAR array to array of char -s ?
thanks
|
|
|
|
|
|
I thought there might be the API UnicodeToAscii, but not for C++ / MFC ...
Maxwell Chen
|
|
|
|
|
Maxwell Chen wrote: I thought there might be the API UnicodeToAscii, but not for C++ / MFC ...
There is are classes CW2A , CA2W .
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
Nibu thomas wrote: There is are classes CW2A, CA2W.
You forgot to mention that these are ATL macros.
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
use WideCharToMultiByte
Amar
|
|
|
|
|
Hi,
My application is running fine , When Active Configuration is Win32Release and Project->Setting are "Use MFC in a Shared DLL"
but it crashes when Active Sonfiguration is same Win32Release but change the Project->Setting to "Use MFC in a Static Library"
it crashes at following code.
m_pListenSock is an object of CSock class which is inherited from CSocket class.
UINTCServerHandler::OnMsgStart(WPARAM wp, LPARAM lp)
{
m_pListenSock = new CSock();
m_pListenSock->Create (200); // It crashes at Create call
m_pListenSock->Listen ();
return 1;
}
Regard
|
|
|
|
|
So have you stepped into the call to Create() to find the offending statement?
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
Hallo
How can i change the interpretation of a variable.
Example
<br />
int text = 123456;
...<br />
...<br />
THX
Timen
|
|
|
|
|
This should work!!!
<code>
int nText = 12345;
char szText[10];
int nHex =0;
itoa(12345, szText, 10);
nHex = strtol( szText, NULL, 16);
</code>
Regards
Anil
|
|
|
|
|
Either write your own converter (multiply each digit with powers of 16), or convert to string using sprintf and convert back to hex using sscanf.
Cheers
Steen.
"To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Steen Krogsgaard wrote: Either write your own converter (multiply each digit with powers of 16), or convert to string using sprintf and convert back to hex using sscanf.
This makes non-sense. A number is neither in decimal, in hexa, or whatever else; it is just a number. Its representation may change but the number will always be the same. You can say 0x14 or 20 or 0b10100, all these three strings represent the same number.
-- modified at 7:23 Friday 2nd June, 2006
Sorry, I misread the thread
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
Hallo
1. Well at least it makes sence. cause i have to controll some hardware. To calculate the needed commands the shortes way is to interprete int as Hex bit shift this and the result is the needed command.
Outherwice if you cant see the sence then become a lectural
2. int - char - hex is what i have and this is as fast doing a lot of if else
combinations - well but i need somthing fast - much faster ?!?!
Well the THX
Timen:->
|
|
|
|
|
tbrake wrote: 2. int - char - hex is what i have and this is as fast doing a lot of if else
combinations - well but i need somthing fast - much faster ?!?!John Simmons, 05/31/2006
|
|
|
|
|
tbrake wrote: int text = 123456; // editable by user !!
...
// On one position I need to convert to 0x123456
123456 in base-16 is 0x1E240. Use itoa() or sscanf() to do the conversion.
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
tbrake wrote: How can i change the interpretation of a variable.
cout<<<code>hex</code><<123233;
cout<<<code>oct</code><<121223;
cout<<<code>dec</code><<12323;
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
hi
i want to include windows open file and open directory widows on the press of the button in my program... can any one please help
|
|
|
|
|
|
Damn. Beat me by mere seconds
Cheers
Steen.
"To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|