|
|
Thnks for reply...
I already used DCB structure in my program..
but have same effect...
the probm is If i load a file of 172kb using TurboC++ prgm
then it takes appx 55 sec...
but
when I load file using VC++ prgm that uses CreateFile() API
it takes appx 211 sec... i.e. appox 3.5 times.of TC
so plz... reply....any option to decrease load delay..
n speed up my transmission...
PLz ..... ur reply always matter to me..
|
|
|
|
|
I am trying to implement "intellisearch" combo box like we have in IE.
I create a separate list box and draw it below combo box when user starts typing in something.
The Combo box has to be a parent of this list box. When I draw the list box using the Create method, it offcourse will try to draw the list box inside the client area of the combo box, and fails to do so.
Can we draw a child window outside the client area of the parent?
<br />
<br />
bool CAutoCompComboBox::CreateListBox()<br />
{<br />
CRect clientRect(-1, -1, -1, -1);<br />
<br />
GetClientRect(&clientRect); <br />
<br />
BOOL bRet = _listFilter.Create(WS_CHILD | WS_VISIBLE | <br />
WS_VSCROLL | LBS_STANDARD,<br />
clientRect, this, 1);<br />
<br />
<br />
_listFilter.Create(WS_CHILD | WS_VISIBLE | <br />
WS_VSCROLL | LBS_STANDARD,<br />
clientRect, GetParent(), 1);<br />
<br />
<br />
Thanks in advance..
Misha
Evil triumphs when good people sit quiet...
|
|
|
|
|
|
Thanks,
Thats the problem. I don't want to subclass the list box which comes with CCombobox. I have to keep it separate.
all ideas would be greatly appreciated.
Evil triumphs when good people sit quiet...
|
|
|
|
|
what about WS_POPUP style instead of WS_CHILD and position the popup window relative to combobox and send the messages to and fro between combo box and popup listbox. I think popup window is the best match as "intellisearch" kind of control pops up when some thing is typed and closes when out of focus from combobox.
|
|
|
|
|
Thanks, that seems to work. the code looks like this:
ClientToScreen(&clientRect); <br />
<br />
BOOL bRet = _listFilter.CreateEx(0, <br />
_T("LISTBOX"), <br />
_T(""), <br />
WS_POPUP | WS_VISIBLE | WS_BORDER | WS_VSCROLL <br />
| LBS_NOTIFY <br />
,<br />
clientRect.left, clientRect.top, <br />
clientRect.Width(), clientRect.Height(), <br />
this->GetSafeHwnd(), <br />
NULL, <br />
NULL);<br />
Evil triumphs when good people sit quiet...
|
|
|
|
|
How can I design a compiler (I dont need statement parsing or evaluating expressions, but how to generate Windows PE Code)
How can an EXE file be built from my compiler?
|
|
|
|
|
Design a compiler you need to lot of info and its very difficult but for make a exe file I think(not sure) I saw a article on the www.codeguru.com that it explained about exe files(PE,...) and very other useful info.
|
|
|
|
|
I have a class in win32.
For a small part of my project, I would just love to be able to display a jpeg or gif image instead of just bmp images.
Are there any third party classes that will help? What controls should I use?
It's not a big enough part of my program to do myself, it's just an extra feature that would add alot of appeal to the app.
I would also love to be able to load an image from the disk and not from my resources each time as I don't think my user can edit those.
Thanks for any help!
|
|
|
|
|
Have you heard about IPicture?
IPicture manages a picture object and its properties. All you need to do is instantiate IPicture and call Render. Remember you don't need to do a CoCreateInstance for this, instead call OleLoadPicture.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Got a link?! Would love to use it. A quick google search didnt' turn up anything.
EDIT:
Found some info on it but I can Load from a file?
modified on Tuesday, April 22, 2008 1:24 AM
|
|
|
|
|
|
Loading and Displaying Bitmaps[^]
using GDIplus, Image::FromFile
You can create Image objects based on files of a variety of types including BMP, GIF, JPEG, PNG, TIFF, and EMF.
|
|
|
|
|
GDI+ will do it in 3 lines, excluding the code needed for
initialization, which only needs to be executed once per
process.
Something like this (shows example initialization code):
#include <gdiplus.h>
...
ULONG dwToken;
Gdiplus::GdiplusStartupInput input;
Gdiplus::GdiplusStartupOutput output;
Gdiplus::Status status = Gdiplus::GdiplusStartup(&dwToken, &input, &output);
if(status == Gdiplus::Ok)
{
Gdiplus::Bitmap srcBitmap(L"c:\\some.jpg", FALSE);
Gdiplus::Graphics wndGraphics(someHWND);
wndGraphics.DrawImage(&srcBitmap, 0, 0);
Gdiplus::GdiplusShutdown(dwToken);
}
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Was sure to do the #include but I'm getting all kinds of linker errors. Is there anything I'm missing.
Also can I load an image and have it scaled based on a preferred height and width?
Edit
Was Missing the .lib file.
Still not sure on how to scale the image.
Also getting a nasty exception when trying to run the last line (the shutdown one). When I comment it out it works fine! but I don't think that's the best thing to do.
modified on Tuesday, April 22, 2008 9:19 PM
|
|
|
|
|
Link to gdiplus.lib to resolve the linker errors (you found that one).
Graphics.DrawImage() has a bunch of overloads, several of which will
stretch the image. To actually resize the image you need to create a second
Image/Bitmap object and draw the original image stretched to the new image.
I'm not sure about the exception - I haven't seen that before
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
How to add button to ClistCtrl?
thanks in advance.
|
|
|
|
|
See Here[^] for some hint
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
Hello! I have been struggling for the whole day, and could not figure out the following problem:
I am testing my VC++6.0 MFC application, and already tested on several PCs, some of them runs OK, on some PCs the GUI fails to call function OnInitDialog, the dialog still get displayed, however I found out the exe actually did not run function OnInitDialog, so the initialized values assigned in this function were not applied.
PCs that work:
all PCs with VC++ installed.
1 PC that never had VC++ installed.
1 PC that had VC++ installed but removed before the test.
PCs that doesn't work
1 PC that had VC++ installed but removed before the test.
1 PC that never had VC++ installed.
I tried Create() and DoModal() to create the dialog, both fail on the failing PCs.
Please let me know if you have any clue. Thank you very much!
rqy
|
|
|
|
|
Rongqi wrote: Please let me know if you have any clue.
Sounds like a version mismatch between the mfc42.dll on some of the PCs and the version you're building against. Either link your program to the static library, or make sure your installer puts the right version in the right place.
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
Thanks for replying.
I copied the same version of MFC42.DLL to the ones that were not working, but it didn't help...
|
|
|
|
|
Assuming you put it in the right place on the target machines, you are encountering some other problem. Things to check:
- OnInitDialog() is actually not being called (try putting a message box at the start of it and confirm that it doesn't appear on the problem machines)
- The problem machines aren't running Win9x
- This is a normal dialog (not a file dialog / print dialog / other common dialog)
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
Shog,
1. OnInitDialog() is actually not being called (try putting a message box at the start of it and confirm that it doesn't appear on the problem machines)
It is true that OnInitDialog() is not called on the problem PCs, the MessageBox I put in the beginning of OnInitDialog()proves that
2. The problem machines aren't running Win9x
All the test machines are either W2K or WXP
3. This is a normal dialog (not a file dialog / print dialog / other common dialog)
This is a single page dialog that has some edit boxes and check boxes.
I have tried "use MFC in a Static Library" in the project Setting->General->Microsoft Foundation Classes. And also tried copy the mfc42.dll to the exe folder of the problem machine. I am not sure if that is the right way to do it as you mentioned.
Thanks
|
|
|
|