|
I changed it, but had the same issue. I ended out renaming the ID, deleting the old ID and creating a new button with the old ID name. It got a new random ID value, and all's good.
Thanks for your help, David.
BW
The Biggest Loser
"Farm Donkey makes us laugh. Farm Donkey hauls some ass." -The Stoves
|
|
|
|
|
brianwelsch wrote:
It got a new random ID value...
Actually, there not random at all. They are controlled by the _APS_NEXT_CONTROL_VALUE macro at the bottom of the project's resource.h file.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Does anyone know how to disable the safe mode of windows?
Thanks in advance
|
|
|
|
|
Hi gurus,
I'd like to know how to
1) save the list of all open documents in an MDI before closing the application and the last active document
1) reload the documents when the MDI application starts.
Thanks
Best regards.
There is no spoon.
|
|
|
|
|
The MRU list is handled automatically with an MFC application.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi everyone!
I needed to save picture from CBitmap object to BMP file. I have made this method:
BOOL SaveBMPImage( LPCTSTR sBMPFile, CBitmap& bitmap )
{
BITMAP bmap;
bitmap.GetBitmap(&bmap);
BITMAPINFOHEADER bmih;
bmih.biSize = sizeof(BITMAPINFOHEADER);
bmih.biWidth = bmap.bmWidth;
bmih.biHeight = bmap.bmHeight;
bmih.biPlanes = 1;
bmih.biBitCount = 32;
bmih.biCompression = BI_RGB;
bmih.biSizeImage = 0;
bmih.biXPelsPerMeter = 0;
bmih.biYPelsPerMeter = 0;
bmih.biClrUsed = 0;
bmih.biClrImportant = 0;
BITMAPFILEHEADER bmfh;
bmfh.bfType = 0x4d42; // 'BM' WINDOWS_BITMAP_SIGNATURE
bmfh.bfSize = bmih.biSize + bmih.biSizeImage + bmih.biClrUsed * sizeof(RGBQUAD) + 14 ;
bmfh.bfReserved1 = bmfh.bfReserved2 = 0;
bmfh.bfOffBits = 14 + bmih.biSize + bmih.biClrUsed * sizeof(RGBQUAD);
CFile file;
if( !file.Open(sBMPFile , CFile::modeWrite | CFile::modeCreate ) )
return FALSE;
// Write the file header
file.Write( &bmfh , min(14,sizeof(BITMAPFILEHEADER)) );
// Write the DIB header
file.Write( &bmih , bmih.biSize);
long velkost;
velkost = bmap.bmWidthBytes * bmap.bmHeight;
// otocenie obrazka (je dolu hlavou)
CDC dc;
dc.CreateCompatibleDC(NULL);
dc.SelectObject(&bitmap);
long i,j;
COLORREF farba;
for( j=0 ; j
|
|
|
|
|
Misenucik wrote:
It works everywhere - except...
So what is it that does not work? Have you stepped through the code to see what values are different between two machines? Do you have error-checking in place? How do the two .bmp files differ?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I am not sure about the value that the GetBitmapBits() returns, but all others are the same. In wiever looks the picture as I am looking through a film negative (just violet,red and black colours) and the picture is there twice.
If you have any idea or if you have any method for saving a CBitmap to BMP file that works everywhere and you'll send it to me, I will be very thankful.
Thank you very much
|
|
|
|
|
Misenucik wrote:
bmih.biBitCount = 32;
are you sure your bitmap from GetBitmapBits is actually 32 bits?
Software | Cleek
|
|
|
|
|
Hi,
I have to code a SDI MFC application as below:
----------------------
| This is heading |
| |
| 1. some text |
| 2. Some text |
| 3. Some text |
| 4. Some text |
| |
----------------------
The "This is heading" part should not be scrollabe and below that part i.e from "1. Some text ......." should be scrollable.
Please tell me which CView subclass should I use.
Send me sample code / any articles.
Thanks & Regards,
Neeraj
|
|
|
|
|
You could use a CFormView derived class that has a static header and a scrollable window below it. I do not have any examples but they are very easy to use. Just like designing a dialog box.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
This looks like a job for CListView .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi,
hopefully someone can help me.
Having a DialogBox with i.e. 10 EditBoxes, is there any way to get the variable's name associated.
Let assume:
EB1 - control-ID "IDC_EDIT1", type "CString", element "m_first_name";
EB2 - control-ID "IDC_EDIT2", type "CString", element "m_last_name";
etc.
How I get "m_first_name" or "m_last_name" (not its value!, but the name) and it's type? and there is a way to count the number of controls in a Dialog?
Thanks in advance and Regards
Filippo
|
|
|
|
|
Hi,
hopefully someone can help me.
Having a DialogBox with i.e. 10 EditBoxes, is there any way to get the variable's name associated.
Let assume:
EB1 - control-ID "IDC_EDIT1", type "CString", element "m_first_name";
EB2 - control-ID "IDC_EDIT2", type "CString", element "m_last_name";
etc.
How I get "m_first_name" or "m_last_name" (not its value!, but the name) and it's type? and there is a way to count the number of controls in a Dialog?
Thanks and Regards
Filippo
|
|
|
|
|
Do you need to get this information at runtime? I think getting names of variables is impossible at runtime!
ARSALAN MALIK
|
|
|
|
|
Yes!
I thought some like :
Dim ctl As Control
For Each ctl In Me.Controls
MsgBox ctl.Name
Next
.
In Access Dialog it'is possible, so I was hoping that in VC++ would be possible too.
Filippo
|
|
|
|
|
Can I ask you why you need this ?
There is probably another solution for your problem (like for example, getting all the Id's of the controls ans working with that...)
|
|
|
|
|
I would like to "standardize" a procedure that make easy to display in different dialogs a certain number of values.
I have i.e. two (indipendent) Database tables, one containing first and last name and age (first_name,last_name, age), the other containing i.e company names and adresses (company_name,company_address).
In my App i have two dialog boxes containing each two EditBoxes with CString m_first_name, CString m_last_name, int m_age in the first one , and CString m_company_name and CString m_company_address in the second one.
I could write for every control its assigning value instructions, but what happen if my dialogs have ten's of EBoxes?
With a loop looking like:
CString elemName= "";
for (long i=0; i <mydlg.controlcount(); i++)="" {
="" mydlg.controlname(i)="" -=""> m_first_name
elemName.Format(Mid(myDlg.ControlName(i),2,99)); // first_name
switch (myDlg.ControlType(i)){
case dbText: // write in i.e. m_first_name the value of first_name
myDlg.ControlName(i).SetValueAsString(elemName);
break;
case dbInt: // i.e. Age
myDlg.ControlName(i).SetValueAsInt(elemName);
break;
etc...
}
}
Does it look somehow clear?
Filippo
|
|
|
|
|
You can also use the SetWindowText function in this way:
GetDlgItem(Id)->SetWindowText("Blah");
What you can do is something lije that: retrieve the number of fields you need to create and then create dynamically (for example) an edit box per field (and you specify an ID different for each of them). Then you can retrieve the values of your fields and use SetWindowText to print it in the edit box...
But this is just a suggestion...
Hope this helps
|
|
|
|
|
From the VB sample you are talking about, it is possible when using an activeX control, since the control supports a property "Name"
I am not disturbing your question, this is just for information. If someone can correct me with more info on what i said, I would appreciate that
Thanks
-------------------------
Have a great day ahead!
Regards,
Sohail Kadiwala
modified 21-Apr-21 21:01pm.
|
|
|
|
|
you can use GetDlgCtrlID() to get the id (i.e. IDC_TEXT1), but other than that the variables you associate with your control (i.e. m_txtName) aren't part of the control, just mapped to it using DDX. If you really need to know the name of a control at runtime, I think the best way would be to make a class derived from the class you want (class CMyEdit : public CEdit) and add Get/Set functions for name as a string or just make a public member variable called m_strName.
[insert witty comment here]
bdiamond
|
|
|
|
|
|
Hello,
you are right. I remember reading the variable names are resolved to their respective addresses during compilation.
I could be wrong though.
|
|
|
|
|
Hi,
I create a combo dynamically like this. I want to get a vertical scroll bar, but I don't how. Can anybody help me out.
CComboBox m_SchemaCombo;
m_SchemaCombo.Create(WS_CHILDWINDOW | WS_VISIBLE | WS_TABSTOP |
CBS_DROPDOWNLIST,
CRect(row3,
frameTop + 3 * topBottomOffset + buttonHeight3,
editBoxWidth,
frameTop + 3 * topBottomOffset + buttonHeight2 + buttonHeight2 + buttonHeight2),
this, IDC_SCHEMA_COMBO);
Thanks,
Prahsant
|
|
|
|
|
Hi,
Im starting a project to make a low resource constantly running screen recrder for windows. It will output a medium quality video in a common format. I was just wondering if anyone has any ideas on how to start this. I have never seen any source code for anything similiar to this. Any help or advice with the following would be great
1) How to turn a series of jpegs into a movie?
2) How to record directly to video using DivX compression.
3) The best language to use C# or C++
I have found many plugins and small programs that do the job of compression but I intend to write everything from scratch, many thanks.
|
|
|
|