Newbi MFC Dialog question

Lets say I have dialog A.  On dialog A, I have a button that opens Dialog B. 
I want to be able
to set the control values of a combo box of values from Dialog A.

I tried setting them before the doModal(), but I keep getting assertion 
errors.

emailDLG dlg;
CComboBox* test = (CComboBox*)dlg.GetDlgItem(IDC_TESTBOX);
 test->AddString("test1"):
 test->AddString("test2"):
if (dlg.DoModal() !=IDCANCEL) {
..
....
......

Thanks in advance!

Scott 

0
skraemer8 (21)
8/12/2007 2:53:52 AM
vc.mfc 33608 articles. 0 followers. Follow

9 Replies
783 Views

Similar Articles

[PageSpeed] 47

Hi,

First, your probably not familiar with Control variables.
http://www.flounder.com/getdlgitem.htm
I have not used GetDlgItem(IDC_TESTBOX) in years.
So, it behooves you to learn to use control variables instead.

Then, this is what you do.
Dlg.m_Combo.SetItem()

I don't like doing it that way,
instead, I have a private member variable=20

private:
  CCombobox m_Combo;
public:
  CComboBox* GetComboBox() { return & m_Comb; }

Then, I do this instead.
Dlg.GetCombo()->SetItem()



HTH,
"Scott Kraemer" <skraemer8@cox.net> wrote in message =
news:emOLYwI3HHA.600@TK2MSFTNGP05.phx.gbl...
> Lets say I have dialog A.  On dialog A, I have a button that opens =
Dialog B.=20
> I want to be able
> to set the control values of a combo box of values from Dialog A.
>=20
> I tried setting them before the doModal(), but I keep getting =
assertion=20
> errors.
>=20
> emailDLG dlg;
> CComboBox* test =3D (CComboBox*)dlg.GetDlgItem(IDC_TESTBOX);
> test->AddString("test1"):
> test->AddString("test2"):
> if (dlg.DoModal() !=3DIDCANCEL) {
> .
> ...
> .....
>=20
> Thanks in advance!
>=20
> Scott=20
>
0
Nobody530 (222)
8/12/2007 3:29:15 AM
Scott Kraemer wrote:
> Lets say I have dialog A.  On dialog A, I have a button that opens 
> Dialog B. I want to be able
> to set the control values of a combo box of values from Dialog A.
> 
> I tried setting them before the doModal(), but I keep getting assertion 
> errors.
> 
> emailDLG dlg;
> CComboBox* test = (CComboBox*)dlg.GetDlgItem(IDC_TESTBOX);
> test->AddString("test1"):
> test->AddString("test2"):
> if (dlg.DoModal() !=IDCANCEL) {
> .
> ...
> .....
> 
> Thanks in advance!
> 
> Scott

The dialog window does not exist at this point.  (And, of course, none 
of its controls exist either.)  Somewhere down inside DoModal() they get 
created.

You have to initialize member variables of the dialog class.  Then the 
dialog class can initialize its own controls (in OnInitDialog) from the 
member variables.

-- 
Scott McPhillips [MVP VC++]

0
Scott
8/12/2007 3:32:16 AM
First, pretend you never, ever heard of GetDlgItem.  It is to be considered obsolete
technology most of the time, and while there are rare instances in which it can be used,
what you are doing is not one of them.

Create control variables.  To do this in VS.NET 2003 or VS 2005, just right-click on the
control, select "Add Variable", and create a variable.  The variable should be protected
(the system erroneously defaults to 'public', which is a mistake).  Give it a name.  I
tend to use c_Name for control variables.

Then you can access it via its control variable.

You cannot access any controls before or after the DoModal.  Before the DoModal, the
control does not exist because it hasn't been created, and after the DoModal, it doesn't
exist, because it has already been destroyed.

Typically, what you do is initialize a member variable with the values you want in a combo
box, for example, by adding them to a CStringArray, a CArray of some more complex type, or
a std::vector<CString>.  (std::string is usually more trouble than it is worth in MFC, and
is therefore not used).  Then, in the OnInitDialog handler of the dialog (which you add by
selecting the dialog class in the Class View, selecting the overrides [the funny thing
that looks like a piece of blue fudge in the properties], and asking it to OnInitDialog.
You then iterate over the string array and add the strings, or the objects you want to
add.

class CDialogB : public CDialog {
    ... stuff here
protected:
    virtual BOOL OnInitDialog(); // added from Properties 
    CComboBox c_ListOfStuff; // added from Add Variable menu item
public:
     CStringArray InitialValues;  // added by hand
};


void CDialogA::OnLaunchB()
    {
     CDialogB dlg;
     for(...some loop of your devising...)
          {
           ...figure out what to add to combo
           dlg.InitialValues.Add(...string to add...);
         }
     switch(dlg.DoModal())
        {
         case IDOK: ...
         case IDCANCEL: ...
         default:
        }  // typical cases you might add
    }

BOOL CDialogB::OnInitDialog() 
    {
     CDialog::OnInitDialog();

     for(INT_PTR i = 0; i < InitialValues.GetSize(); i++)
          c_ListOfStuff.AddString(InitialValues[i]);
     ... perhaps other initialization here
     return TRUE;
    }

Now here's another thing to know: dialog B has NO IDEA that dialog A exists.  It doesn't
know who called it, and one of the worst design errors you can make is to include
dialoga.h in dialogb.cpp.  A child dialog never, ever has a clue as to what its parent
might be.  A dialog should never try to modify any parent class, a view, a document,
global variables, app-class variables, etc.  Anything it gets, it gets by someone setting
its member variables.  Anything it wants to set, it sets by putting the desired values in
its member variables and the parent of the dialog copies them out.  A dialog never, ever
accesses controls in any class other than its own.  And no one outside the dialog class
ever accesses its controls.
						joe

On Sat, 11 Aug 2007 19:53:52 -0700, "Scott Kraemer" <skraemer8@cox.net> wrote:

>Lets say I have dialog A.  On dialog A, I have a button that opens Dialog B. 
>I want to be able
>to set the control values of a combo box of values from Dialog A.
>
>I tried setting them before the doModal(), but I keep getting assertion 
>errors.
>
>emailDLG dlg;
>CComboBox* test = (CComboBox*)dlg.GetDlgItem(IDC_TESTBOX);
> test->AddString("test1"):
> test->AddString("test2"):
>if (dlg.DoModal() !=IDCANCEL) {
>.
>...
>.....
>
>Thanks in advance!
>
>Scott 
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15972)
8/12/2007 4:14:37 AM
Okay, I tried it this way many times.... I always get a debug assertion 
failed error. I comment out the line, and it doesnt fail on me.
I made sure my DDX's were set:
 DDX_Control(pDX,IDC_COMBO,m_Combo);
my m_Combo is declared as:
 CComboBox m_Combo;



Tried it this way first:
dlg.m_Combo.AddString("test");

Second, used your method:
 dlg.GetComboBox()->AddString("Test");
 if (dlg.DoModal() !=IDCANCEL) {
.....


"Nobody" <Nobody@yahoo.com> wrote in message 
news:u%23zz2DJ3HHA.6128@TK2MSFTNGP02.phx.gbl...
Hi,

First, your probably not familiar with Control variables.
http://www.flounder.com/getdlgitem.htm
I have not used GetDlgItem(IDC_TESTBOX) in years.
So, it behooves you to learn to use control variables instead.

Then, this is what you do.
Dlg.m_Combo.SetItem()

I don't like doing it that way,
instead, I have a private member variable

private:
  CCombobox m_Combo;
public:
  CComboBox* GetComboBox() { return & m_Comb; }

Then, I do this instead.
Dlg.GetCombo()->SetItem()



HTH,
"Scott Kraemer" <skraemer8@cox.net> wrote in message 
news:emOLYwI3HHA.600@TK2MSFTNGP05.phx.gbl...
> Lets say I have dialog A.  On dialog A, I have a button that opens Dialog 
> B.
> I want to be able
> to set the control values of a combo box of values from Dialog A.
>
> I tried setting them before the doModal(), but I keep getting assertion
> errors.
>
> emailDLG dlg;
> CComboBox* test = (CComboBox*)dlg.GetDlgItem(IDC_TESTBOX);
> test->AddString("test1"):
> test->AddString("test2"):
> if (dlg.DoModal() !=IDCANCEL) {
> .
> ...
> .....
>
> Thanks in advance!
>
> Scott
> 

0
skraemer8 (21)
8/12/2007 4:42:30 AM
Okay, I can set other controls just fine...its this darn combo box giving me 
a problem.

"Nobody" <Nobody@yahoo.com> wrote in message 
news:u%23zz2DJ3HHA.6128@TK2MSFTNGP02.phx.gbl...
Hi,

First, your probably not familiar with Control variables.
http://www.flounder.com/getdlgitem.htm
I have not used GetDlgItem(IDC_TESTBOX) in years.
So, it behooves you to learn to use control variables instead.

Then, this is what you do.
Dlg.m_Combo.SetItem()

I don't like doing it that way,
instead, I have a private member variable

private:
  CCombobox m_Combo;
public:
  CComboBox* GetComboBox() { return & m_Comb; }

Then, I do this instead.
Dlg.GetCombo()->SetItem()



HTH,
"Scott Kraemer" <skraemer8@cox.net> wrote in message 
news:emOLYwI3HHA.600@TK2MSFTNGP05.phx.gbl...
> Lets say I have dialog A.  On dialog A, I have a button that opens Dialog 
> B.
> I want to be able
> to set the control values of a combo box of values from Dialog A.
>
> I tried setting them before the doModal(), but I keep getting assertion
> errors.
>
> emailDLG dlg;
> CComboBox* test = (CComboBox*)dlg.GetDlgItem(IDC_TESTBOX);
> test->AddString("test1"):
> test->AddString("test2"):
> if (dlg.DoModal() !=IDCANCEL) {
> .
> ...
> .....
>
> Thanks in advance!
>
> Scott
> 

0
skraemer8 (21)
8/12/2007 4:55:38 AM
I typically store the strings for the combo box in a CStringArray and pass a 
reference to it to the pop-up dialog and then, as Scott suggested, initilize 
the control in the OnInitDialog() function in dialog B.  You can retrieve 
the result the same way using a variable that gets set when the combo box 
selection changes.  The variable will persist even after the dialog (B) is 
closed so you can retrieve it after.

Tom

"Scott Kraemer" <skraemer8@cox.net> wrote in message 
news:u8HFd0J3HHA.5164@TK2MSFTNGP05.phx.gbl...
> Okay, I can set other controls just fine...its this darn combo box giving 
> me a problem.
>
> "Nobody" <Nobody@yahoo.com> wrote in message 
> news:u%23zz2DJ3HHA.6128@TK2MSFTNGP02.phx.gbl...
> Hi,
>
> First, your probably not familiar with Control variables.
> http://www.flounder.com/getdlgitem.htm
> I have not used GetDlgItem(IDC_TESTBOX) in years.
> So, it behooves you to learn to use control variables instead.
>
> Then, this is what you do.
> Dlg.m_Combo.SetItem()
>
> I don't like doing it that way,
> instead, I have a private member variable
>
> private:
>  CCombobox m_Combo;
> public:
>  CComboBox* GetComboBox() { return & m_Comb; }
>
> Then, I do this instead.
> Dlg.GetCombo()->SetItem()
>
>
>
> HTH,
> "Scott Kraemer" <skraemer8@cox.net> wrote in message 
> news:emOLYwI3HHA.600@TK2MSFTNGP05.phx.gbl...
>> Lets say I have dialog A.  On dialog A, I have a button that opens Dialog 
>> B.
>> I want to be able
>> to set the control values of a combo box of values from Dialog A.
>>
>> I tried setting them before the doModal(), but I keep getting assertion
>> errors.
>>
>> emailDLG dlg;
>> CComboBox* test = (CComboBox*)dlg.GetDlgItem(IDC_TESTBOX);
>> test->AddString("test1"):
>> test->AddString("test2"):
>> if (dlg.DoModal() !=IDCANCEL) {
>> .
>> ...
>> .....
>>
>> Thanks in advance!
>>
>> Scott
>>
> 

0
tom.nospam (3240)
8/12/2007 5:44:48 AM
I figured it out!  You can't edit the contents of a combo box because its 
not created yet.
I can do the CEdits ok :(

Anyways, a way around this is I made a CString m_temp[20];

added my dlg.m_temp[0]="Some Item"; etc.... and then on init dialog, I add 
them to the dropdown.

Thanks!

Scott
"Scott Kraemer" <skraemer8@cox.net> wrote in message 
news:emOLYwI3HHA.600@TK2MSFTNGP05.phx.gbl...
> Lets say I have dialog A.  On dialog A, I have a button that opens Dialog 
> B. I want to be able
> to set the control values of a combo box of values from Dialog A.
>
> I tried setting them before the doModal(), but I keep getting assertion 
> errors.
>
> emailDLG dlg;
> CComboBox* test = (CComboBox*)dlg.GetDlgItem(IDC_TESTBOX);
> test->AddString("test1"):
> test->AddString("test2"):
> if (dlg.DoModal() !=IDCANCEL) {
> .
> ...
> .....
>
> Thanks in advance!
>
> Scott 

0
skraemer8 (21)
8/12/2007 6:43:53 AM
Hi,

Scott and Tom are correct.
The controls are not initialized. /* I forgot about that, being I never =
use DoModal anymore */
You could do Create() instead.
That way, the controls would be initialized.
There is no need to deal with string arrays and other complications.
Plus,  you get a Non-Modal Dialog which IMHO is way better.

CView::LaunchDialog()
{
 if(GetDlgTest() !=3D NULL) return;
 SetDlgTest(new CDlgTest(this));
 GetDlgTest()>Create(CDlgTest::IDD, this);
 GetDlgTest()->SetOwner(this);
 GetDlgTest()->EnableWindow();
 ((CDlgTest*)GetDlgTest())->GetComboBox()->AddString("This");   /* Cast =
to your Dlg Type */
 ((CDlgTest*)GetDlgTest())->GetComboBox()->AddString("is");
 ((CDlgTest*)GetDlgTest())->GetComboBox()->AddString("a");
 ((CDlgTest*)GetDlgTest())->GetComboBox()->AddString("Test");
 GetDlgTest()->ShowWindow(SW_SHOW);
}

In your dlg's OnClose()
 GetOwner()->PostMessage(UWM_DIALOG_CLOSING, (WPARAM)this);

In your View in Message map
 ON_REGISTERED_MESSAGE(UWM_DIALOG_CLOSING, OnMsgDlgClose)
In the header
static const UINT UWM_DIALOG_CLOSING =3D =
::RegisterWindowMessage(_T("UWM_DIALOG_CLOSING-{76E2AC0A-0371-4fe3-A2AB-5=
8B06BE1B5EC}"));

Define the Method in your View
LRESULT CView::OnMsgDlgClose(WPARAM wParam, LPARAM lParam)
{
 if(GetDlgTest() =3D=3D (CDlgTest*)wParam)
 {
  delete GetDlgTest();
  SetDlgTest(NULL);
 }

put
afx_msg LRESULT OnMsgDlgClose(WPARAM wParam, LPARAM lParam);=20
in the header under the message map heading.

and
CDlgTest* m_pDlgTest;
Somewhere in the header.

Also, initialize m_pDlgTest to null in the constructor. i.e. =
SetDlgTest(NULL);

It's a little tricky at first, but no more need for DoModal and stopping =
the application.
Plus, you can initialize things like your combobox.

There should be something in here to show you how  to do NonModal =
Dialogs.
They are way better than Modal Dialgogs.
http://www.flounder.com/mvp_tips.htm#Dialog%20Box%20Series

My internet is sporadic, so if it stays up, I will answer any more =
questions.
Either that, or just post questions about Non-Modal Dialogs.

*note from my code that I stay away from directly accessing member =
variables
and use Get() and Set(). It is a very good habit to get into.


HTH,
"Tom Serface" <tom.nospam@camaswood.com> wrote in message =
news:eXMo3PK3HHA.600@TK2MSFTNGP05.phx.gbl...
>I typically store the strings for the combo box in a CStringArray and =
pass a=20
> reference to it to the pop-up dialog and then, as Scott suggested, =
initilize=20
> the control in the OnInitDialog() function in dialog B.  You can =
retrieve=20
> the result the same way using a variable that gets set when the combo =
box=20
> selection changes.  The variable will persist even after the dialog =
(B) is=20
> closed so you can retrieve it after.
>=20
> Tom
>=20
> "Scott Kraemer" <skraemer8@cox.net> wrote in message=20
> news:u8HFd0J3HHA.5164@TK2MSFTNGP05.phx.gbl...
>> Okay, I can set other controls just fine...its this darn combo box =
giving=20
>> me a problem.
>>
>> "Nobody" <Nobody@yahoo.com> wrote in message=20
>> news:u%23zz2DJ3HHA.6128@TK2MSFTNGP02.phx.gbl...
>> Hi,
>>
>> First, your probably not familiar with Control variables.
>> http://www.flounder.com/getdlgitem.htm
>> I have not used GetDlgItem(IDC_TESTBOX) in years.
>> So, it behooves you to learn to use control variables instead.
>>
>> Then, this is what you do.
>> Dlg.m_Combo.SetItem()
>>
>> I don't like doing it that way,
>> instead, I have a private member variable
>>
>> private:
>>  CCombobox m_Combo;
>> public:
>>  CComboBox* GetComboBox() { return & m_Comb; }
>>
>> Then, I do this instead.
>> Dlg.GetCombo()->SetItem()
>>
>>
>>
>> HTH,
>> "Scott Kraemer" <skraemer8@cox.net> wrote in message=20
>> news:emOLYwI3HHA.600@TK2MSFTNGP05.phx.gbl...
>>> Lets say I have dialog A.  On dialog A, I have a button that opens =
Dialog=20
>>> B.
>>> I want to be able
>>> to set the control values of a combo box of values from Dialog A.
>>>
>>> I tried setting them before the doModal(), but I keep getting =
assertion
>>> errors.
>>>
>>> emailDLG dlg;
>>> CComboBox* test =3D (CComboBox*)dlg.GetDlgItem(IDC_TESTBOX);
>>> test->AddString("test1"):
>>> test->AddString("test2"):
>>> if (dlg.DoModal() !=3DIDCANCEL) {
>>> .
>>> ...
>>> .....
>>>
>>> Thanks in advance!
>>>
>>> Scott
>>>
>>=20
>
0
Nobody530 (222)
8/14/2007 8:45:43 AM
You should not be able to do CEdit (the control) either.  You can set the 
variable that gets updated to the control since that does not attempt to 
access the window until after the dialog and controls are created.

Tom

"Scott Kraemer" <skraemer8@cox.net> wrote in message 
news:ue%23K7wK3HHA.1184@TK2MSFTNGP04.phx.gbl...
>I figured it out!  You can't edit the contents of a combo box because its 
>not created yet.
> I can do the CEdits ok :(
>
> Anyways, a way around this is I made a CString m_temp[20];
>
> added my dlg.m_temp[0]="Some Item"; etc.... and then on init dialog, I add 
> them to the dropdown.
>
> Thanks!

0
tom.nospam (3240)
8/14/2007 2:31:05 PM
Reply:

Similar Artilces:

I need help to display a dialog from a resource-only DLL
Hi, I created a resource-only Dll to store string, dialog, icon and bitmap. With loadstring function i can load a string from this dll, but i don't know how dipslay a dialog from it. here is my code : UINT CDataResource::GetResourceDialog(int ResourceID) { // load resource LPCDLGTEMPLATE lpDialogTemplate = NULL; HGLOBAL hDialogTemplate = NULL; HINSTANCE hInst = AfxFindResourceHandle(MAKEINTRESOURCE(ResourceID), RT_DIALOG); HRSRC hResource = ::FindResource(hInst, MAKEINTRESOURCE(ResourceID), RT_DIALOG); hDialogTemplate = LoadResource(hInst, hResource); if (hDialogTemplate != NULL) ...

Really simple questions re CSliderCtrl
Using SetSelection() I can get a CSliderCtrl to display a highlighted selection ... but so what? What use is it other than to look pretty? Which of the following is possible, and how do I do them? (1) Prevent the user from moving the thumb outside the highlighted range. (This seems to be what the documentation suggests that SetSelection does, but in fact it doesn't, the thumb can be moved outside the selection.) (2) Have the user change the selection. (The documentation seems to suggest this is possible, but I can find no combination of keystrokes or mouse actions that will do it.) -- ...

Newbie, accnts. payable & accnts.receivable sample DB
Hi guys, I�m running access 2003, windows xp pro SP2 I've been commission in my work to do a small application to track and report the accounts payable and accounts receivable movements, I'm not an accounting savvy person :(, does anyone know of a link or sample access database that can help me with the basic structure of the tables and reports?, any help would be greatly appreciated. Thanks ...

Strething bitmaps in MFC
Hi, I am using CBitmapButton in my dialog based application. CBitmapButtton provides a method named SizeToContent() which changes the size of button to that of the bitmap. What I need is the opposite funtionality i.e. the bitmap should be resized/stretched to the button's size. Does any one have any idea how to achieve this. Thanx in advamce. Wasif Ali try CDC::StretchBlt -- With Regards Alok Gupta Visit me at http://alok.bizhat.com "I Believe this will Help" "Wasif Ali" <swasif@itimpk.com> wrote in message news:#Be5VDCNFHA...

General design question
hi! i'd like to design a class - let's call it CDrawObject - that is able to contain some data and draw itself. furthermore i'd like to have a class CDrawMultiObject that is derived from CDrawObject and can contain objects of type CDrawObject. i imagine to have the following situation: CDrawMultiObject -> base object (i.e. an object manager ) CDrawObject -> first element CDrawObject -> secound element CDrawMultiObject -> third element CDrawObject -> first element CDrawObject...

Dialogs
Hi Is there any arguments to I can add to the statement below for the dialogue's "Look in:" to default to a specific folder? Application.Dialogs(xlDialogOpen).Show Thanks. >-----Original Message----- >Hi > >Is there any arguments to I can add to the statement >below for the dialogue's "Look in:" to default to a >specific folder? > >Application.Dialogs(xlDialogOpen).Show > > >Thanks. >. > You can try FileFilter = FileFilter + "Look in: name of directory,," ...

MFC memory leak, + return code help
Hi, I don`t use MFC often so maybe I`m asking a dumb question. I started noticing VC++6 reporting a memory leak when I ran the program in debug mode. Detected memory leaks! Dumping objects -> {27} normal block at 0x009A04C0, 33 bytes long. Data: < C > 00 43 00 CD CD CD CD CD CD CD CD CD CD CD CD CD {26} normal block at 0x009A0510, 40 bytes long. Data: < |L > 14 7C 4C 10 16 00 00 00 00 00 00 00 00 00 00 00 Object dump complete. Strange thing is I`m getting the same error in many of my MFC programs. So I tried removing parts of my code bit by bi...

Visio Newbie
Hello all, this is my first time using Visio for drawing a floor plan and I have a quick question. Yesterday, (Using a tape measure) I mapped out the floor plan of an office my company might be moving into. I wrote everything down in Inches. Is there a way once I get a room shape kinda close to teh measurements, that I can manually type in teh length for each wall? if not in inches, at least in feet. For example, I have one wall that is 154 inches ( 12.83 ft) Then the next wall is 242 incehs( 20.1 ft) The opposite wall of the first measurement is 288 inches, third wall 100 inches, then 13...

Printing question
We are having an issue with LPR printing using our software in conjucntion with a Windows 2008 server which is preventing us from being able to flash images to a printer from our application. We use Universe, SB+ and SBClient and would use the DOS shell from inside SBClient to use LPR print commands to send the images to the printer, this has worked fine on all other Windows servers but not 2008. What happens is when you drop to DOS you can browse to the %systemroot%\system32 folder and do a dir but you cannot see LPR. If you do the same from a normal command prompt the file ...

C++ / Access Newbie
Hi Folks... I have a small commercial package written in C++ (targeted to Windows platforms) that uses its own proprietary database. We are just starting to investigate the option of replacing our database with a commercial package, such as Access or MySQL. Can anyone recommend informative reading that provides details on programming C++ with either of these two databases? At this stage we have no (any I mean ZERO) experience such programming. Any information would be helpful: recommendations for Access over MySQL (or vice versa), sources of such comparisons, licensing considerations, OD...

Exchange newbie problem
Hi all; A user on our domain was deleted when he should not have been. His mail box was not deleted. When his account was recreated, we tried to reconnect the old mailbox. But when selecting a user in the "Select a new user for this mailbox" dialog a message comes back saying that the user cannot be found. We tried several different users a none can be found even though they can get there mail just fine. We need to get the messages from this mailbox. Any ideas would be great -- Craig in the High Desert. craig@craignet.com But it's a dry heat. you should be able to reconnec...

newbie
joining the group Hey Newbie where are you from and what versiona re you using? Fliehigh "cthomas23@hotmail.com" wrote: > joining the group > ...

Another COUNTIF question...
Hey all, i'm stuck. I need to do a formula that will count the number of cells in column 'A' only if the corresponding cell in column 'B' has a value of '0'. =COUNTIF(O:0,"0")+COUNTIF(P:P,">0") - just counts both, and that's as far as i have got. Can anyone help me please. Thanks ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ Hi =SUMPRODUCT((A1:A65536>0)*(B1:B65536<>"")*(B1:B65536=0)) (you...

Real Newbie newbie question
Hi All - I hope you can help me! I have Finepix M603 camera and although I take reasonable shots in daytime, I'm not able to produce anything at night. eg On The Thames on New Years Eve, may people were using digital cameras and their screens should clear bright picture - mine was black! What setting should I set on mine? Any advice really appreciated. --- David Scott Hampshire, England Wrong group. Sorry....... -- --- David Scott Hampshire, England "Dave" <cadasco@SUPERhotmail.com> wrote in message news:50kuejF1fh28sU1@mid.individual.net... > Hi All - I hope...

ot question
except for being something i need to do in an mfc app i'm working on this doesn't really have anything to do with mfc.... but its as bad a place to start as any other group i watch. i need a kind of generic algorithm to take an array of 3d points that describe a surface, then given two coordinates of another point interpolate the third coordinate on the surface. picture it like you have a set of random latitude, longitude and elevation points, then want to find the elevation of any given latitude and longitude coordinate. (over a small area, don't worry about spherical earth and...

reformulating question regarding maximum value
I had an hour ago put a question up named "find maximum", but I had not formulated my query fully, hence this query. In each row, I want to find the second highest value in that row, and then as output give the value of that cell in the first row. For example: 1 2 6 8 6 5 4 3 2 4 5 6 3 2 3 8 6 4 5 3 7 2 3 1 The second largest value in the second row is nr 6. It is in the fourht cell of that row. The fourth cell of the first row is the value 8. This should be the output for the second row. The second largest value in the third row is the number 6. It is in the first cell of th...

Using OLE DB in MFC Project
Hi, I have developed an MFC application. I now want to add database functionality to it. I have had a look at the various database technologies and have decided to try using direct OLE DB rather than ADO as it is faster. However I have noticed that in tutorials it is recommended to use the wizards in an ATL project. As i have said before my application has been written in MFC. I was wondering how easy it is to add direct OLE DB to my MFC application. I would appreciate suggesstions on how i can manage this, Thanks In Advance Macca ...

Formatting Cells Question
Hi I am having troubles with formatting cells in EXCEL 2003. I have a column of many hundreds of rows lthat contain data like this: 01Jan12 on fist glance this looks like a date but it really is not. EXCEL on the other automatically assumes it is a date and formats as such. 2001-Jan-12 I have tried formatting as text, General and even experimented with custom formats to no avail. In the same column I have 03Mar1543 Which is dispolayed exactly as is. How can I get EXCEL to simply display data like 01Jan12 exactly as is? You must format the cell as Text BEFORE typing any information...

proper closing of modeless dialog box in dll
I have created a modeless dialog box from a dll and would like to know what the correct method is for shutting it down. here is what I do: in the oncancel handler for the dialog: CDialog::OnCancel(); DestroyWindow() ((CMyApp *) AfxGetApp())->pDlg = NULL That last line I am doing because the process that uses the dll may reopen the dialog box and the way I judge whether or not the dialogbox needs to be created is by testing whether pDlg is NULL. If it is not NULL then obviously I don't want to be putting another dialogbox on the screen. So, is it safe to be assigning NULL to pDlg, ...

Exchange 2003 web access questions
Hi there: We've recently added an Exchange 2003 server into our network, while leaving the original Exchange 2000 server up and running with a few mailboxes on it. I'm currently having a problem completing the transition to 2003 because some old code doesn't seem to work anymore. We have implemented a very limited email interface for our factory workers, so that they can only send email to approved addresses, and all emails are CC'd to supervisors. I wrote this interface a couple of years ago in ASP, and it does every thing we need. If we try to copy this interface over to t...

eConnect newbie
Hi, I've installed eConnect 7.5 and am planning to use this to read & write xml files to GP can anyone give me samples or examples of how to do this, also my company is planning to upgrade to GP 9 shortly are there major changes between each version? Thanks in advance. JimB If you've installed eConnect, then you have several samples already. They are located in the samples folder underneath the eConnect installation. The changes from 7.5 to 9.0 are fairly minimal. Mostly, there are new xml elements that can be included, but many of those are optional. It's my gue...

MDI newbie ?
I want to add a "reload" command that will close the current(and only) document and reload it again. Here is what I have tried so far: <code> AfxGetMainWnd()->PostMessage(WM_COMMAND, ID_FILE_NEW); while(AfxGetApp()->GetOpenDocumentCount() > 0); AfxGetApp()->OpenDocumentFile(currentFluPath); </code> This doesn't work, because, as I've learned ID_FILE_NEW create just that, a new blank document so count is still 1. I can't figure out what I should check for, how I can know when the ID_FILE_NEW is done so that I can call OpenDocumentFile() Does ...

XSL Question #5
<xsl:if test="fTOC[starts-with(@filename, '5')]"> <xsl:element name="Section1"> <xsl:attribute name="titleRef">Section 1 - Section One</xsl:attribute> <xsl:for-each select="fTOC[starts-with(@filename, '5')]"> <xsl:copy-of select="."/> </xsl:for-each> </xsl:element> </xsl:if> I am going through a list of files starting with '5' and placing them under "Section 1 - Se...

Run Integration Quicker-Newbie
I am running an integration to import sales orders for invoicing. I use several additional query criteria in IM, but I do not think these criteria are passed to SQL Server 2000. Instead, the records are returned, then the criteria are applied. The integration is taking quite a bit of time to run. Does anyone have an idea on how to pass the criteria to SQL Server, or any other ideas to increase the performance? Thanks. use a SQL Server View "Shannon LeVert" <slevert@aviagen.com> wrote in message news:06c701c46daa$fbad4100$a501280a@phx.gbl... > I am running an in...

Off topic question
Which newsgroup should I subscribe to ask questions about newsgroups? What sorts of questions? About the groups themselves? About Usenet? About newsreaders such as Outlook Express (which I see you're using)? -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA http://word.mvps.org "Jim Birke .com>" <jimbir@yahoo<notthis> wrote in message news:eELhwFfqKHA.728@TK2MSFTNGP04.phx.gbl... > Which newsgroup should I subscribe to ask questions about newsgroups? > > I am subscribed to several newsgroups in msn...