|
hi,
I've three questions:
1-How to change boutton color?
2-How to use the horisental bar in a liste boxe, despite a activate when the text bypasse width of the list boxe it still remains deactivated?
3-how to use the progression bar? ( give me an example if it is psossible )
very urgent, I need reply befor tomorrow if you can.
|
|
|
|
|
|
LOL
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
His english sounds like from a french guy. Now it makes me sad.
How low can you go ? (MS rant)
|
|
|
|
|
sorry for my english,
I've three questions:
1-How to change button color?
2-How to use the horizontal bar in a list box, despite I activate it ,when the text bypass the width of the list box the bar is still deactivated?
3-how to use the progression bar? ( give me an example if it is psossible )
|
|
|
|
|
In a MDI application I have a CFormView (called CListForm) associated with a IDD_FORMVIEW dialog type which I use as a template for a docking bar (used to show some thumbnails). The IDD_FORMVIEW dialog simply contains a CListCtrl. In CMainFrm.cpp, CMainFrame::OnCreate() is used to create every toolbar and even my thumbnails docking bar.
// This bar is derived from CSizeBar 2.44 by Cristi Posea
CViewBar m_wndImageBar;
CRuntimeClass* m_pRuntimeClass;
m_pRuntimeClass = RUNTIME_CLASS (CListForm);
m_wndImageBar.Create(this,
m_pRuntimeClass,
(CCreateContext *)(lpCreateStruct->lpCreateParams),
"Images", WS_CHILD | WS_VISIBLE | CBRS_TOP,
AFX_IDW_CONTROLBAR_FIRST + 33));
The problem is how to access to CListForm from CMainFrm.cpp because now I have to populate the list with a list of bitmap pointers using a CListForm member function I called PopulateList(). I tried to create a pointer to CListForm object in this way:
CListForm* m_pListForm;
m_pListForm = (CListForm*)m_pRuntimeClass->CreateObject();
m_pListForm->PopulateList();
Object is correctly created and shown in my MDI application and its member variables correctly allocated but its hWnd handle points to NULL!!! WHY?!? Infact when PopulateList() calls this function:
CListCtrl* pListCtrl = (CListCtrl*) GetDlgItem(IDC_LIST_CTRL);
to refer to its child CList control, it crashes.
Which is the correct way to fully access to my CListForm from CMainFrame class?
Thx
|
|
|
|
|
Have you tried GetActiveView( )? This function is a member of CFrameWnd so you should have access to it in your CMainFrame class. Note that you'll have to typecast the return value to CListForm*
Hope this helps.
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
Is there any small (really small) library or tip to convert a bmp file to jpg?
I mean, not a huge kind of classes or libraries at once. Just a single header file or some C that makes it without MFC ?
Regards.
|
|
|
|
|
LibJPEG is 90Kb when compiled, CxImage with CXIMAGE_SUPPORT_JPG only will be about 110K.
|
|
|
|
|
|
Ok, i have the jpeglib.lib library file, can you tell me how to convert the bmp to jpg now?
Regards.
|
|
|
|
|
I use jpeg library a lot, it's pretty easy. Check out the docs, Google up some sample code from the many packages that use it. Here is a small sample of compressing an image to a monochrome jpeg:
(A bit of code is always good. I stripped out a lot of particulars.. mostly error handling setup. Use this example as a source of good keyword combos in Google.)
bool JPEGCompressMono(FILE* Out,int Quality,unsigned char* pSrc,int Width,int Height)
{
struct jpeg_compress_struct cinfo;
struct jpeg_error_mgr err;
cinfo.err = jpeg_std_error(&err);
jpeg_create_compress(&cinfo);
jpeg_stdio_dest(&cinfo,Out);
cinfo.image_width=Width;
cinfo.image_height=Height;
cinfo.input_components=1;
cinfo.in_color_space=JCS_GRAYSCALE;
jpeg_set_defaults(&cinfo);
jpeg_set_quality(&cinfo,Quality,TRUE);
jpeg_start_compress(&cinfo,TRUE);
int Slop=(Width%4)?4-Width%4:0;
JSAMPROW row_pointer[1];
while (cinfo.next_scanline < cinfo.image_height)
{
row_pointer[0]=pSrc+(Height-1-cinfo.next_scanline)*(Width+Slop);
jpeg_write_scanlines(&cinfo,row_pointer,1);
}
jpeg_finish_compress(&cinfo);
jpeg_destroy_compress(&cinfo);
return true;
}
|
|
|
|
|
allright, but what if i need to convert a file for example it should be some function
that takes as argument 1 an output file and as for argv[2] the input file for example and does the dirty thing. isnt there something like this?
cause all i get in my program is a handle to the bitmap. nothing else, and i want to convert that bitmap to jpg. or even, i can save it to a bmp file and then for example i want to convert that bmp file to jpg.
all i see is that in the declaration of the RGBToJpegFile(...) there is a BYTE *data.
i have no idea what to do with it when i have a handle to bitmap / bmp filename.
|
|
|
|
|
If you have a handle to the bitmap, use GetObject with a DIBSECTION struct to find the bitmap bits (assuming handle is to a DIB section). If the handle is not to a DIB, use CreateDIBSection to create one, select it into a temporary DC and blit the bitmap into your DIB, then proceed. If the image is in a file, just read it into a space on the heap. (or map it into memory if truly large...)
|
|
|
|
|
If you are using MFC 7.0 (that is Visual Studio .Net) check
out the CImage class which should serve your purpose.
|
|
|
|
|
Hi, im writing a program for an FPGA controller in c++ at uni. Since i wanted to make a GUI, i've been using MFC and have found it relatively easy with all the toolbar drag and drop functions. Although, when i run it at university, the machines that dont have VC++ but have Borland C++, cause a problem for the MFC exe file due to the absence of libraries etc. A friend reccomended that using a WIN32 API dialog would be better as it wouldnt be as dependent on computer config as the MFC application. Im fairly new to Visual C++ and hence i cant say im very clear on making a a dialog based application in Win32. Moreover, id rather stick to MFC, its seems easier. Is there anyway of solving this problem? can one stick to MFC, but still design a dialog based application that will work on almost every computer? Also, can anyone provide links to win32 dialog based apps tutorials?
Cheers,
Ayush
|
|
|
|
|
You can do a static linking and see if that works
Regards,
Venet.
Donec eris felix, multos numerabis amicos.
|
|
|
|
|
Could someone explain how one goes about static linking?
|
|
|
|
|
Go to Project and Settings, you should find it there somewhere.
Can't remember the exact tabs as I don't use MFC.
Regards,
Venet.
Donec eris felix, multos numerabis amicos.
|
|
|
|
|
Go to the Project Settings, click on the General tab, and select "Use MFC in a static library". Doing so, you don't need at all MFC dlls to run it on target machines.
How low can you go ? (MS rant)
|
|
|
|
|
Hi,
I would like to add a new feature to my GUI: user resizeable controls. I already have a resizeable CDialog, now there are inside two CListbox next to each other. If I resize the one the other should become smaller (and visa versa, e.g. similar to the explorer window). It looks like this:
--------------------------
| | |
| | |
| | |
| | |
| | |
---------------------------
^listbox1 ^listbox2
^
let user resize here with mouse
Two question............
What is the general technique to do this? Is this a SplitterWindow?
Is there already a class on CodeProject?
Thanks for pointing me into teh right direction!
|
|
|
|
|
PS: There are also more controls in the dialog.
Not that you think my dialog consists of two listboxes only (dunno if this is important to mention). However, the two listboxes are the part that the user should be able to resize. The overall width of both listboxes should stay the same. Thanks... and im curious, how this can be done.
|
|
|
|
|
PPS: It's totally NOT urgent... so if you read my posts and have a hint, I appreciate any help. Meanwhile I spend my weekend on reading MSDN and what I found here.
|
|
|
|
|
The new UI elements that are present in VS.NET (and also in Office XP), such as the menus that are all white with the translucent blue highlighter, toolbars with the translucent blue highlighter, and tabbed documents with similar features are all rather slick. Are these elements and styles available to us mortals or is Microsoft doing a ton of custom control work? Anyone have an links that detail how all of this can be integrated into our apps?
thanks
|
|
|
|
|
Where can i find the documentation abour the registerd MFC ActiveX controls? Not about the creation and usage of the controls. Just i want the documentation like the class definition and purpose of the memeber functions and data memebers etc. Please help.
|
|
|
|