|
Hi everyone,
Hi everyone
im very new to visual c++ programming, although i worked on borland c++ before.
i have a problem in controlling some controls according to a certain conditions.
for example;
I have two dialogs:
The first one is to ask the user
How many edit boxes he want to see?
The second dialog should show him the number of edit boxes he entered in the first editbox;
So if the user has entered (2) in the editbox in the first dialog,
he must see two editboxes in the second dialog.
It is very important for me to know this
Please just remember that im very new to MFC programming, so write me a clear code as a beginner.
thank you for reading my messege
F.X
|
|
|
|
|
void CYourDialog::OnButtonEnterDlgNum(void)
{
char lpBuffer[256];
m_YourEditCtrl.GetWindowText(lpBuffer, 255);
// you could also use this
// GetDlgItem(IDC_YOUREDITCTRL)->GetWindowText(lpBuffer, 255);
int iMax = atoi(lpBuffer);
CEdit *ceEdit;
for(int i = 0; i < m_yourint = iMax; i++)
{
ceEdit = new CEdit;
ceEdit.Create(0/* your styles */, CRect(0, 0, 0, 0) /* your rect */, m_YourSecondDlg /* the CWnd object of your 2 dialog */, IDC_ID + i /* your ID (must be unique!)*/);
}
}
hope this helps
Я люблю русский язикь!
|
|
|
|
|
Which recordset to use CRecordset or CDaoRecordset with Ms Access database?
I had seens many posts,threads and source code on various forums that uses CDaoRecordset with MSAccess data baseand some uses CRecordset
WHat are pros and cons of using each of them?
WHich one is better?
Thanking you?
|
|
|
|
|
The main difference is that CDaoRecordset accesses data through a Data Access Object (DAO) based on OLE. CRecordset accesses the DBMS through Open Database Connectivity (ODBC) and an ODBC driver for that DBMS. The DAO classes generally offer superior capabilities because they are specific to the Microsoft Jet database engine. So you need to decide if you want to access the data through DAO or ODBC, although the DAO classes can access both types of data sources. That will govern which class to use.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Such problem. I'm write application(not MFC) with support System Tray Icon. I try to do like this: if I select menu item then he must to set MF_GRAYED, and the other item which was MF_GRAYED must set to MF_ENABLED. For this I'm using SetMenuItemInfo. But this dont work. Though SetMenuDefaultItem is work without problem. Help me, what's the problem? Thanks in advance.
|
|
|
|
|
Does anyone know how to change paper size while printing under MFC?
The idea is that page sizes are supposed ti differ from page to page (custom sizes)
|
|
|
|
|
Had slight computer problems.
|
|
|
|
|
Do you want to change the paper size during a print job or do you want to have different paper sizes for each print job?
If you want to set the paper size for a print job you have to get the printer DC and then you can change the dmPaperSize member of the DEVMODE structure.
But I think you should give some more information what you exactly want to do.
|
|
|
|
|
Different paper sizes in one print job, every page different, not standard but custom (arbitrary) paper sizes.
|
|
|
|
|
Does anyone know how to change paper size while printing under MFC?
The idea is that page sizes are supposed ti differ from page to page (custom sizes)
|
|
|
|
|
You'll need probably different print DC to each page.
CPrintDialog dlg;
HGLOBAL hDevMode = dlg.m_pd.m_hDevMode;
DEVMODE* dm;
CDC dc;
::GlobalAlloc(hDevMode, sizeof(DEVMODE));
for (i = 1; i <= nNumOfPages; i++)
{
if (dm = (DEVMODE*)::GlobalLock(hDevMode))
{
dm->dmPaperLength = 123;
dm->dmPaperHeight = 456;
::GlobalUnlock(hDevMode);
}
dc.Attach(dlg.GetPrinterDC());
dc.DeleteDC();
}
Robert-Antonio
"I launched Norton Commander and saw, drive C: on the left, drive C: on the right...Damn, why I need two drives C:???So I formatted one..."
|
|
|
|
|
Doesn't work on all printers, on many it sets the paper size to deafult. I also need to get the orginal paper sizes from devmode, but it doesnt always report them correctly (sometimes both are 0).
|
|
|
|
|
Hi i am adding to the ms -access database through the MFC code
CRecordset. Prior to adding the record last designID was 74
<br />
CRSDesign dRS(pdb);<br />
<br />
if(!dRS.Open ())<br />
return FALSE;<br />
if (!dRS.CanAppend ())<br />
return FALSE;<br />
<br />
dRS.AddNew();<br />
dRS.m_DesignName = DesignName;<br />
dRS.m_DesignType = DesignType;<br />
dRS.m_Remarks = Comments;<br />
dRS.m_D_Designer = Designer;<br />
dRS.Update();<br />
<br />
dRS.Requery ();<br />
dRS.MoveLast ();<br />
long DesignID = dRS.m_DesignID ;<br />
AfxMessageBox(_ltoa(DesignID,cc,10)); ---> 74<br />
Message box also gives design id as 74. How to overcome this.?
Well
Select @@IDENTITY as num FROM B_DESIGN
query with MS- Access Database does returns just
0
0
0
0
0 For the number of record i am having in my table
Main Problem
DesignID is autonumber field in my data base and is primary key
It is having following values:
12
15
23
70
71
73
74
112
Now when i am running following query into data base (MS-Access query)
SELECT Last(DesignID) FROM B_Design
it returns 74
Even i put a loop after requery and getting designID in message box it starts from 112,5,12,15 .......
When i move recordset to MoveFirst() it will give designID - 112
and when MoveLast() then it will give 74
Have any body idea about this?
How to resolve this problem?
If any more clarification is required please ask for that?
|
|
|
|
|
How about using
SELECT Max(DesignID) FROM B_Design
instead?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Hi,
For memory stats we have overloaded the operator new in such a way that it allows us to allocate memory and store information about which module is doing it. This is all great.
However, now that we have moved to a multi-threaded environment, do we need to protect the call _malloc_dbg(...) (in a debug build) and the ::operator new(...) (in non-debug) with a critical section?
"Programming today is a race between software engineers striving to build bigger and
better idiot-proff programs, and the Universe trying to produce bigger and better idiots.
So far the Universe is winning." -- Rich Cook
|
|
|
|
|
in dos one could access hardware directly because dos's singe-threaded. multi-threaded oses like windows have to take care themselves that hardware pieces are accessed by just one program at a time.
this means for you that not you're allocating memory, but the os's doing it for you; you don't need any multithreading resource-locking techniques at all.
Я люблю русский язикь!
|
|
|
|
|
Multithreaded operating systems do not protect your from accessing hardware at the same time. Two threads can access the same page of memory and cause all sorts of mess if locking isn't used to manage the data in the page.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
When you build with the MT (multithreaded) CRTL (c run time library), you will be getting the multithreaded version of new and delete which have built in locking support. You don't have to worry about it.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
My program makes a file with some data, how can I export this data into a graphic, like an excel graphic. I'm not using MFC, but winapi 32.
sorry my english
Christian
|
|
|
|
|
Hi All!
How can i programmtically retereive all users login/logout time from the domain server? I have gone through the Derek Lakin's artical "How to get a list of users from a server" but it hangs when i use the domain name (works for local machine). Are there any set of APIs for this?
Best Regards,
Bilal Anjum
|
|
|
|
|
--------------------------------------------------------------------------
PLZ DO FORWARD THIS MAIL TO ALL YOUR COLLEAGUES, FRIENDS,
JUNIORS,CLASSMATES,SENIORS AND ALL THE GROUP YOU ARE MEBER OF
(to Support C/C++ ),IT WONT TAKE YOUR MUCH OF YOUR TIME BUT
WILL HELP US A LOT.
THANKING YOU IN ANTICIPATION
------------------------------------------------------------------------
Hello Friends ,
We are very glad to invite to join our C/C++ Community.
Q : Who We are ?
Ans : we are community of 700 C/C++ programmar.
Q : What we do ?
Ans : We dicuss all about C/C++ ( but strictly
only about C/C++ ).We answer each others
query.We do Projects also on this group by
forming small team among our self.We discuss
about almost all the compilers.
(gcc,turbo,borland ,visual,quick ...)
Q : What do we want ?
Ans : We want to bring all Indian C/C++ programmers
together at one place, PROGRAMMERS TOWN
if you know/love C/C++ programming
you should join us.
IF YOU DON'T KNOW C/C++. DO NOT HAVE ANY
RELATION WITH C/C++. YOU CAN HELP US BY
FORWARDING THIS INVITATION TO EVERY
PROGRAMMER YOU KNOW,
ALL YOUR FREINDS, ALL YOUR COLLEAGUES,
ALL JUNIOS,CLASSMATES, SENIORS .TELL THEM
TO FORWARD IT TO THEIR FREINDS AND LET THIS
TRADITION GO ON. AFTER SOME TIME THIS CHAIN
WILL SURELY REACH TO A C/C++ PROGRAMMER,
THAT IS WHAT WE WANT.
Q : How it is useful for me ?
Ans : you can ask your doubts , you can asnwer
others queries .if you are not expert you
can join us and discuss all your doubts here.
you can keep yourself update by joining this
group.
Q : How do i join this community ?
Ans : method 1 : just write a blank mail to
Programmers-Town-subscribe@yahoogroups.com,
then you ll get an automated reply within
one minut, now open that mail , click on reply
then click on send.
method 2: just write a blank mail to
Programmers-Town-subscribe@yahoogroups.com,
then you ll get an automated reply within
one minut, now open that mail.
there is one link given , open that link in
new window . and click on join button.
method 3: open this URL (If you are not in
company this is the best)
http://groups.yahoo.com/group/Programmers-Town/
and click on join button .
Suggestion :
as we are around 700 members in this group,
its very high traffic every day 8-10 mails.
so its better if u subscribe using daily
digest option u ll get only one mail per day,
which will contain all the mails of the day
(size won't be much its text only, no attachment).
How to use dialy Digest Option that you will come
To know after joining this group.
Programmers-Town Team
http://groups.yahoo.com/group/Programmers-Town/
|
|
|
|
|
Anonymous wrote:
as we are around 700 members in this group,
its very high traffic every day 8-10 mails.
OMG! How do your servers cope?!
Lets be honest, isn't it amazing how many truly stupid people you meet during the course of the day. Carry around a pad and pencil, you'll have twenty or thirty names by the end of the day - George Carlin
Awasu 1.2.1 [^]: A free RSS reader with support for Code Project.
|
|
|
|
|
Thanks but no thanks
CodeProject is a million times better
|
|
|
|
|
hello everybody,
i like to develop a parser which should parse the user given inputs..
exampl,
----------------------------
# code
ln 123,232,23,223;
mycircle 233,343,12;
Textout "text",23,23,"2";
# end
when i run the program, the user pinputted codes should be mapped with the vc+++ Line,Circle,Textout routines with app.parameters provided by the user.
suggest me an idea to solve this..
with regards,
Mahes
|
|
|
|
|
take a look and read further:
http://www.antlr.org/
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|