|
Got it. Thanks.
Matt (Padawan Learner)
|
|
|
|
|
Please Tell me How to search and operate a device,such as USB device?
Use the functions such as "SetupDiClassDev() etc.," need GUID,and How can I Get GUID use windows'API functions?
I Use Windows XP OS.
Thanks.
ST!!
Njbull
Sep.12/2003,Beijing
|
|
|
|
|
I need to draw a selection box in a real time video. This box is created when i pressed the left mouse button and drag the outline of the box. However since my codes are not in MFC, i do not know of any way to draw this box.. Can anyone help??
|
|
|
|
|
I am trying to print out everything in Picturebox.
I can't print out anything except blank.
Here is my source in MyViewClass::OnPrint(CDC* pDC, CPrintInfo* pInfo ) and please help me how I am doing wrong?
CRect rect;
GetWindowRect(&rect);
//CDC* pTempDC = GetWindowDC();
CDC memDC;
//IGBMapViewCtrl d;
//d.GetDC();
memDC.CreateCompatibleDC( pDC );
// create bitmap with my window-pDC and set it in the memory-DC
CBitmap bitmap;
bitmap.CreateCompatibleBitmap( m_MapView.GetDC(), rect.Width(), rect.Height());
memDC.SelectObject(&bitmap);
// open printer dialog
// detach DCs
bitmap.Detach();
|
|
|
|
|
to print a bitmap, you need to use a device independent bitmap (DIB), not a device dependent bitmap
|
|
|
|
|
Thank you, I will test it.
Shin
|
|
|
|
|
Thank you, I will test it.
Shin
|
|
|
|
|
Hello,
I'm trying to write a Scene Editor for a 3d engine. In doing this, I have to use Direct3D which means all my surfaces and what not depend on the size of my view.
The only solution I have come up with so far is to create all my stuff, wait until the view is opened so I can get the correct size of it and in it's OnDraw method, initialize Direct3D with the size of the view. I would like to move some of the Direct3D stuff over to my Document class so that they can share this with other views but I'm not sure how to do this. The view hasn't been created by the time OnNewDocument is called so I can't get the right size.
Any ideas?
Thanks
Shawn
|
|
|
|
|
A customer emailed today asking why a combo box in our program sorted like this:
Item1
Item10
Item2
etc
Our combo box sorts alphabetically and it's a field of names which generally wouldn't have numbers in it.
In other words, they expect "Item10" to follow "Item2" which makes intuitive sense but seems to be difficult to program for.
Has anyone ever seen a combo box that sorts alphabetically and numerically, in any program? Any ideas on how to reliably do that? Is this a known problem with a known algorithm?
|
|
|
|
|
Yeah, its a pain isn't it. Happens in all sorts of places.
Try using this http://sourcefrog.net/projects/natsort/[^] and then manualy inserting the items.
You could just wrap the comparison in a std::less or pass it to qsort.
Ryan.
|
|
|
|
|
Ahh! Outstanding link, thank you very much!
Cheers!
|
|
|
|
|
The simple solution is to make sure everything is in the form item001, item010, item283, like so - then it will work.
|
|
|
|
|
Yes, of course!
Thanks for pointing that out, I should have thought of it before.
|
|
|
|
|
Make every item in same string length, for example, populate your combo box like this:
CString sItem;
for (int i = 0; i < 100; i++)
{
sItem.Format(_T("Item%03d"), i + 1);
m_wndCombo.AddString(sItem);
}
Then items will be sorted in the way you desired.
|
|
|
|
|
Normally yes, but in this case the users enter whatever they want, it's a list of their clients and so I have no control over what they type in.
|
|
|
|
|
|
Ian Darling wrote:
StrCmpLogicalW is your friend.
Ahh! Didn't know about that one, thanks!
Unfortunately it's XP or above only I'm afraid, but will be most useful in future when we can weed people off of w98/wme/wnt4
Cheers!
|
|
|
|
|
Hi,
It's a newbie question. The SDI application show title "Untitled-Generator" where Generator is the name of the application. Now I want it show a different name and also want to change the name of the generated exe to that name. How do I do that without creating a new application with that name?
|
|
|
|
|
CDocument has a member called SetTitle.
|
|
|
|
|
Didn't read the question very carefully - The name of the app is in the resource string table - look there for a string with lots of \n's in it and change that whereever you see the old name. To change the exe, go into the Project Settings for the compiler and change the output file name for Debug and Link. Make sure that it is selected for both Debug and Release versions.
|
|
|
|
|
To change the name of the generated .exe goto Project > Settings > Link, and change the name in the Output file name edit box. I believe the string table can be used to change the internal name of the application so that it compiles a different app title (but if wanted to do this in code you can use CDocument SetTitle).
|
|
|
|
|
Hi,
I wanted to change the VC++ generated small MFC icon on the top left hand corner of my application. I changed the icon in IDR_MAINFRAME, but that only changed the icon in the About Box. Please tell me how to change that Icon?
|
|
|
|
|
When you open the icon in the resource editor, click on the "Device" combo box. Select the "Small (16x16)" option and modify that.
Regards,
Alvaro
Hey! It compiles! Ship it.
|
|
|
|
|
|
Hi
I've Installed Platform SDK (Nov 00) in order to use some new win abilities in win 2k, like transparent windows and etc.
I Installed the SDK, and added it's directories to the 'direcories' tab in the options dlg of VC6. After that I still can't use the new functions (like SetLayeredWindowAttributes())... what can be the reason?
I'm using VC 6 and Win XP.
thanks.
|
|
|
|