|
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.
|
|
|
|
|
what is the problem? fetch the screenshot using GDI, extract the raw data of the bitmap and pass it to the video compressor. what is so difficult about this?
Don't try it, just do it!
|
|
|
|
|
How can we control the Z Order of controls on a Dialog?
kriaz.
|
|
|
|
|
SetWindowPos(...)
ARSALAN MALIK
|
|
|
|
|
If you only need to do this at design time then use the tab order (Ctrl+D) in the resource editor. Tab order 1..n when 1 is furthest away and 'n' is nearest i.e. n will be on top of 1.
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)
|
|
|
|
|
Hi All,
I am creating crystal reports(version 8.5) using VC++ code.
Its working fine on the the machines which have crystal reports installed .
however same is not the case with non crystal machines even after registring the Crystl32.OCX used by the Crystal Reports Object.
Do I need to do some thing in addition to this ?
kindly help.
thx
Sanjay
|
|
|
|
|
Do you have run time crystal dll's installed? I mean to say, you have to deploy some dll's with which you can view the reports. (view-only)
|
|
|
|
|
I am getting error " Unable to logon to server" while trying to run the report.
DSNs are same on both type of machines.
(one with crystal reports and one without it )
I have already distributed these dlls with the application.
(Crystl32.OCX,Craxdrt.dll, CRViewer.dll,CRDesignerCtrl.dll,Craxddrt.dll)
Is there anything db specific which needs to be distributed ?
thanks
Sanjay
|
|
|
|
|
Hi all,
Is there any way to hide an exe file , which was run from my code by the shell_execute command ?
Is there any other command that I can use in order to run an exe file from my code in hide mode ?
|
|
|
|