|
i want to add datatime pickup activeXcontorl on the dialg in my dll.
can i do like that, if can, how to realize ?
gucy
|
|
|
|
|
Do you have to use ActiveX or may be you could settle for the common control? If yes use resource editor in VC7(6) and pick it from the Dialog editor's list of available controls.
|
|
|
|
|
i don't want to use ActiveX control,i want common control.
But i use vc6.0 resource editor.is there any solution?
gucy
|
|
|
|
|
i'v found the control now
gucy
|
|
|
|
|
Hi,
Created a MFC app that uses the CEditView as a base class. I wanted to know if it was possible to insert text on the editor that pops up automatically. If it is, can i make it so that it comes up on each editor window that comes up?
Also, is there a way to change the app from a multiple document app to just a single document app without starting over?
Thanks in advance.
|
|
|
|
|
Lookup CView / CEditView :: OnInitialUpdate ().
This would be an ideal place for a "SetText (...)".
It is possible to switch to an SDI configuration, but I can't remember all the steps.
If you have a lot of code you don't want to simply copy across, create a blank SDI and
a blank MDI app, and compare the two to get the information you want.
Iain
|
|
|
|
|
There is not an OnInitialUpdate() in my program. I did not see it in class wizard either.
Could you possibly explain to me in more detail?
Is there another way to do this?
thanks again for your help.
|
|
|
|
|
I have a CDialogBar and I put a ComboBox and Button on it. I used the ComboBox property 'Data' and added ITEM; to it. When I load my appl. the word ITEM do not appear. My ComboBox type is a DropDown type, also I wanted the user to be able to add in new items in the combobox. How do I accomplish that?
|
|
|
|
|
The combobox "data" you type in using the resource editor actually exists as a separate resource
(DLGINIT) in the rc file. This is referenced when a dialog box is created, but presumably not
for a dialog bar.
Fortunately, it is not difficult to add items to a combo box.
After creating the dialog bar, get a pointer to the combo box.
CComboBox *cb = (CComboBox *) (pBar->GetDlgItem (IDC_MYCOMBO));
cb->AddString (....);
cb->SetCurSel (....);
Iain.
|
|
|
|
|
The box initializes, but when the user type in something, the program doesn't recognize it and also the initial information is deleted and the combo box is empty again.
This is the code to get the information out.
pActWin = GetActWin();
//Get the MainFrame obj and get the address out of the combo box
CMainFrame* pFrame = ((CMainFrame*) m_pMainWnd);
CDialogBar* pDBar = &(pFrame->m_wndAddressBar);
CComboBox* pCombo = (CComboBox*)
pDBar->GetDlgItem(IDC_Address);
CString strAddress = _T("");
int nIndex = 0;
nIndex = pCombo->GetCurSel();
if(nIndex == CB_ERR)
return;
pCombo->GetLBText(nIndex,strAddress);
How do I let the user enter in information and I do I get that information out?
Thanks for the help
|
|
|
|
|
I try to do a ListBox by myself,because i need a different style ListBox.
Now, i have a problem.it's a scroll bar(yes, the scroll bar by myself).
i don't know how to calculate the scroll bar pos,have any one ever do the ListBox by self?Please Help me!thx!
|
|
|
|
|
|
Thank you,I found a method can to calculate the pos.
|
|
|
|
|
Can anyone please tell me how to use ADO connection pooling using Visual C++.
Imtiaz
|
|
|
|
|
What's the basic difference between cout and printf, and between cin and scanf?
Thanks
|
|
|
|
|
cout and cin are stream functions, outputting a stream to the display. They use the < and > operators, which can be overriden to set up the display according to what is in the stream. This is C++.
printf and scanf are C functions, which have their own formatting process.
~RaGE();
|
|
|
|
|
Rage wrote:
They use the < and > operators
You mean << and >>?
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
E-Mail: nikado@pc.nu
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
Yup. How come it did not show both of them ?
~RaGE();
|
|
|
|
|
Rage wrote:
How come it did not show both of them ?
Did you write them as '<' and '>'?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
if you want to be picky, shouldt it be
<< or >>? since they cant and dont use both at the same time..
*.*
|
|
|
|
|
std stream classes are type safe. Var arg nature of printf family is dangerous. Form the purist point of view std is more OO.
|
|
|
|
|
Thanks guys, I'm doing a lot of reading...every little bit helps.
|
|
|
|
|
I have been trying alter the following program to store 13 digit numbers, so I tried to use "double" instead of "int" for my return type. It doesn't work. I want to create a sort program that can store 13 digit part numbers and display corresponding character data relating to those numbers. Is a binary sort function good for this or should I consider a different type of function? If the binary sort will work good, how do I use 13 digit double data types with this function? Thanks.
------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
int values[] = { 10, 20, 25, 40, 90, 100 };
int compare (const void * a, const void * b)
{
return ( *(int*)a - *(int*)b );
}
int main ()
{
int * pItem;
int key = 40;
pItem = (int*) bsearch (&key, values, 6, sizeof (int), compare);
if (pItem!=NULL)
printf ("%d is in the array",*pItem);
else
printf ("%d is not in the array",key);
return 0;
}
|
|
|
|
|
Why doesn't using double work? You only need to make a few changes:
double values[] = { 10.0, 20.0, 25.0, 40.0, 90.0, 100.0 };
int compare (const void * a, const void * b)
{
double _a = *(double*)a;
double _b = *(double*)b;
if( ABS(_a - _b) < 0.00000001 )
return 0;
else if( _a < _b)
return -1;
else
return 1;
}
int main ()
{
double * pItem;
double key = 40;
pItem = (double*) bsearch (&key, values, 6, sizeof (double), compare);
if (pItem!=NULL)
printf ("%lf is in the array",*pItem);
else
printf ("%lf is not in the array",key);
return 0;
} Since doubles are not exact, when you compare them, you might want to add in a delta value, where numbers that are within this amount of each other are considered equal, like I've put in the compare function. If you don't want this, then change the first if statement so it is just (_a == _b) .
BTW, when you're using int s, I don't recommend just returning the difference between them, rather return -1 if a < b or 1 if a > b or 0 if they are equal. Some implementations of the bsearch() function rely on these values being exact.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Ryan,
Question: what is ABS? I'm getting an error message saying it's an undeclared identifier.
Thanks, Dave
|
|
|
|