|
I'm working with ODBC and using *.mdb tables.
I wanna show one of tables on a dialog.
How can I do this?
emroz
|
|
|
|
|
What you mean "show the table"
I assume you wanna show the data of the table?
You need EditBox, StaticBox, (may be ComboBox) for the data to be shown on the dialog box.
|
|
|
|
|
I wanna see all of records.
I used dataGrid in visual basic.
You can see the table on the form with it.
How can can I do it in visual C++
emroz
|
|
|
|
|
Hi,
You can use ListCtrl to do this. But you must write an sql query and insert data yourself. Property 'Datasource' don't exists in listrcl
cheickna
|
|
|
|
|
The simple way to incorporate ADO into your application is through the use of ActiveX controls. You can add the ADO data control to your Visual C++ project, just like any other ActiveX control. Once you add the ADO control to your project, and place it on a window, you’ll need to
specify the data connection in the control properties. You’ll also need to specify the source for the records that will be retrieved by the control.
To use the ADO control efficiently, you’ll also want to use data-bound controls that are ADO-enabled, such as the Microsoft DataGrid control. When you add these controls to
the window with the ADO control, you’ll specify the ADO control as the data source for the control. If the control is designed to only provide access to a single field in a record set, you’ll also need to specify which field is to be used for the control. Once you add all these controls to the window and configure them, you can run your
application and have full database access through ADO without having written a single line of code.
If you cannot follow all the steps then you should try to read something about ActiveX controls (how to add them to your application).
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
How to highlighted the cell's frame when I have 'copy' the cell,like Excel?
|
|
|
|
|
Hi,
I created one dialog based application.
When i draw listbox on dialog box and then any activeX
partially overlapping the listbox.
As at build time AcitiveX control is behind the Listbox
control. But after running, AcitiveX comes to the front.
I need to have ActiveX behind the listbox at runtime also.
Or AcitveX contorl' position should be consistence in both
run and build mode.
I need to solve it very
urgently, Please suggest some ideas.
Harinath Reddy
Bangalore,
India-560076
|
|
|
|
|
Bring your listbox to top using BringWindowToTop member function in your OnInitDialog. So, your listbox will always be on your ActiveX.
Hope this helps
|
|
|
|
|
Thanks for the suggestion.
But My problem is not only with a particular control or a specific order.
I will tell the problem again..
If u create Just a MFC AppWizard "dialog based" application.
Now if u draw any controls like: Listbox, edit control,combobox but not button and then ActiveX control overlapping with above control.
Runtime appearence of ActiveX will be different ie activeX will come to the front.
This behavior is just with MFC code.
I want the consistence behabior of ActiveX with Other controls.
I expect some idea from u.
Once again thanks
-Harinath
Harinath Reddy
HOneywell Technology Solutions Lab,
Bangalore,
India-560076
|
|
|
|
|
This problem I had asked previously . I used the solution given as follows.
m_imageList.Create(16, 16, 0, 1, 1);
hIcon = AfxGetApp()->LoadIcon(IDI_ADDUSER);
m_imageList.Add(hIcon);
pList->SetImageList(&m_imageList, LVSIL_SMALL);
pList->InsertColumn(0, "Users", LVCFMT_LEFT, 150);
But still image is not getting set . Icon used is of size 16 * 16
|
|
|
|
|
LoadIcon() only loads 32x32 icons, use LoadImage() instead.
Are you inserting any items? When you do, are you using index 0 as the image to show with the item?
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--=
NO CARRIER
|
|
|
|
|
I used LoadImage as follows . But still image is not displayed . I checked the values returned by functions used
All functions return successful values. Do we need to set any properties of the list control?
m_imageList.Create(32, 32, 0, 1, 1);
HANDLE hIcon1 ;
hIcon1 = LoadImage( AfxGetInstanceHandle() , LPCTSTR ("IDR_MAINFRAME"), IMAGE_ICON , 32, 32,LR_DEFAULTSIZE);
m_imageList.Add((HICON)hIcon1);
pList->SetImageList(&m_imageList, LVSIL_NORMAL);
|
|
|
|
|
I checked handle returned by loadimage . It returns NULL. I tried using GetLastError BUt it is returning zero .How to use LoadImage?
|
|
|
|
|
Here 's the code I use to set an ImageList to a CTreeCtrl, it works similar
as with an CTreeCtrl. I use a bitmap and a derived CTreeCtrl class though.
void C3StateTree::PreSubclassWindow()
{
<pre>
m_ImageList.Create(16, 16, ILC_COLOR4, 24, 0);
CBitmap nBitmap;
nBitmap.LoadBitmap(IDB_TREESTATES);
m_ImageList.Add(&nBitmap, RGB(255, 0, 255));
SetImageList(&m_ImageList, TVSIL_NORMAL);
ModifyStyle(0, TVS_CHECKBOXES);
ModifyStyleEx(TVS_FULLROWSELECT, 0);
m_Font.CreatePointFont(110, "Courier New");
SetFont(&m_Font);
m_hInsertAllowed = LoadCursor(AfxGetResourceHandle(), MAKEINTRESOURCE(IDC_ADD));
m_hArrow = LoadCursor(NULL, IDC_ARROW);
m_hNo = LoadCursor(NULL, IDC_NO);
CTreeCtrl::PreSubclassWindow();
}
Arjan.
|
|
|
|
|
www.lcdstudio.com is a driver for REAL LCD Displays...??!
what want you to do? I have no idea how to handle a real LCD, but I habe a control for moving around boxes with the mouse.
|
|
|
|
|
So you want a virtual LCD on your desktop?
You can make a window look like a LCD and use rect's as pixels. Fill them with a color for turing on and off...
hope this helps.
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
Urm sorry for that...
Is there any way you can trace wich pixels are turned on and trace the image or someting?
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
lol
What I mean with trace is: If you click on an image, you can somehow select that image or determine how it looks like...
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
"and now i am just stopped on thinking of dragging"
That was the reason why I said "lol"
Mandalay wrote:
(in this case you are monkey-sh*t)
I'll take this as serious offence and you won't get any 'hints' from me anymore.
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
Mandalay wrote:
(in this case you are monkey-sh*t)
With that kind of language you won't get any help around here.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
I am trying to create a bitmap during runtime. I would like to use an RGB color to create a bitmap (15x16) of just that color.
I tryed this code:
HDC dc= CreateCompatibleDC(NULL);
BITMAPINFO i;
ZeroMemory( &i.bmiHeader, sizeof(BITMAPINFOHEADER) );
i.bmiHeader.biWidth=16; // Set size you need
i.bmiHeader.biHeight=15; // Set size you need
i.bmiHeader.biPlanes=1;
i.bmiHeader.biBitCount=32; // Can be 8, 16, 32 bpp or other number
i.bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
VOID *pvBits;
HBITMAP hbmp= CreateDIBSection( dc,
&i,
DIB_RGB_COLORS,
&pvBits,
NULL,
0 );
HBITMAP oldBmp= (HBITMAP) SelectObject(dc,hbmp);
RECT rect= {0,0,16,15};
FillRect(dc, &rect, (HBRUSH) Currentcolor);
but i got always black rectangle (not color).
Please help me.
|
|
|
|
|
You must create compatible DC from the real context.
Just add next lines
HDC hdc= ::GetDC(NULL);
HDC dc = ::CreateCompatibleDC(hdc);
<span class=cpp-comment>
::DeleteDC(dc);
::ReleaseDC(hdc);
That's all
Best regards,
Eugene Pustovoyt
|
|
|
|
|
I used SQL Server 2000 created a data source.Then I put it on to my homepage.Although The server support SQL Server DataBase,but it is impossible for him to run a srever App for my Client App.So I must use my ID and Password connect to it directly from my Client App.Also I want it to work very smoothly no matter where my Client App runs . How can I do this on VC6?
|
|
|
|
|
How do I get my custom bitmaps in a CBitmapButton object to appear in colors appropriate to the user's custom desktop colors?
|
|
|
|
|
Hi,
Help me please with the following:
I created an application,
and added a dialog box to that,
and, in the dialog box there are edit boxes, and I can't manage the following: when I press the OK Button I want to check if there are any empty edit boxes, and if there are, not to closing the dialog box go to that edit box?
Thanx.
|
|
|
|