|
Carl, try using a margin-less body tag in your .html file, a la:
<body style="margin-left:0px; margin-right:0px;">
...
</body> You can use a similar trick to get rid off the annoying default scroll bar.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
This is not the web page, this is the Mainframe or View. I already have all margins turned off. I i view the page in just IE, there are 'no' right or bottom this lines.
This is a tiny thin border not controlled by the web page itself.
Carl
|
|
|
|
|
Hi All,
I have a tree view containing table names which I get by using the CTable class defined in ATLDBSCH.H. Under each table is a list of field names which I get by doing this...
CColumns rsColumns;
hResult = rsColumns.Open(m_session, NULL, NULL, tableData->sName);
All this is working fine but I need to show my field names in BOLD when they are either primary or foreign keys. There are two classes for getting this information. Namely CPrimaryKey and CForeignKey. When I try to use these I do not get any errors but also I do not get ANY rows returned. It is like there is no primary or foreign keys in my table but I know for sure that there are.
If anybody could offer me any help with this I would appreciate it ever so much. Has anybody used these classes before with any success?
Thank you,
Chris Ulliott
|
|
|
|
|
Yes. Some of it is a little dependent on the database in use, as that alters what you pass in for TABLE_CATALOG and TABLE_SCHEMA. I guess that you're using NULL and NULL for both of those at the moment.
If you're using SQL Server or Oracle, you can check (by generating scripts, or by looking at the properties/indexes for a table). Similarly, you should be able to use Access to determine that you really are seeing what you think you are.
If you're using Oracle or SQL, is it possible that the default schema has tables without keys?
Steve S
|
|
|
|
|
Hi Steve,
Thanks for replying. This is how im doing it...
CPrimaryKeys rsPK;
// the table name is just that. It does not contain the schema name (NOT LIKE "schema.table")
hResult = rsPK.Open(m_session, NULL, NULL, NULL, NULL, tableData->sName);
hResult = rsPK.MoveNext();
while (hResult == S_OK) // hResult is always some wierd value but GetLastError says "Success"!
{
// Never getting into here... Same with oracle or SQL Server or Access HMPH!
CString indexColumnName = rsPK.m_szColumnName;
indexes.Add(indexColumnName);
hResult = rsPK.MoveNext();
}
Thanks,
Chris
|
|
|
|
|
Is hResult == DB_S_ENDOFROWSET, by any chance?
You can look in the VC debugger by putting "hResult,hr" in a watch window, or even a quick watch, the hr specifies the format.
This would mean there's no primary key. However, you're passing in too many NULLs. You need (session,NULL,NULL,tablename).
For indexes you need (session,NULL,NULL,NULL,NULL,tablename) and for foreign keys, you need (session,NULL,NULL,NULL,NULL,NULL,tablename).
These should give you what you want.
You're asking yourself "How does he know this?"
In the OLE DB Programmers Ref, the restriction columns are listed in order for each of the TABLES, PRIMARY_KEYS, INDEXES, and FOREIGN_KEYS rowsets.
Steve S
|
|
|
|
|
Hi Steve / Anybody,
Although the primary keys are working fine I am having terrible trouble getting the Index information.
Any ideas what I am doing wrong? Here is some code:
CIndexes rsIndex;
hResult = rsIndex.Open(m_session, NULL, NULL, NULL, tableData->sSchema, tableData->sName);
if(hResult == S_OK)
{
hResult = rsIndex.MoveNext();
while (hResult == S_OK) {
CString indexColumnName =
rsIndex.m_szColumnName;
indexes.Add(indexColumnName);
hResult = rsIndex.MoveNext();
}
}
I have also tried it with 4 NULL's and not passing the schema name but it still gives me a zero record count.
Any ideas would be appreciated!
Thanks,
Chris
|
|
|
|
|
Hi,
any idea on how to disable a menu button. What I mean is, consider internet explorer browser the menu consists of 'File', if you click on it a drop down menu appears, what api could I use to disable the close button.
Kind Regards
Caoimh
|
|
|
|
|
If you are using the MFC in your application, you can handle the ON_UPDATE_COMMAND_UI handler for your menu item (you can do this via Class wizard). Then its a matter of setting the state of your item pCmdUI->Enable(isEnabled?TRUE:FALSE);
I Dream of Absolute Zero
|
|
|
|
|
If you aren't using MFC, then you can get the menu handle for the window (normally the top level window), and then get a handle for the sub-menu from there (they start at zero, of course!), and finally modify the state of a given item.
APIs to check out are:
HMENU GetMenu( HWND hWnd );
HMENU GetSubMenu( HMENU hMenu, int nSub );
BOOL SetMenuItemInfo( HMENU hMenu, UINT uItem,
BOOL fByPos, LPMENUITEMINFO lpmii);
That should take care of most things.
Steve S
|
|
|
|
|
|
Hi,everybody,I want to know how to create chm format files?I know that the Microsoft compiler must be used,but I really don't know how to use it.Can you tell me what I should to do ?Help me,Please!
|
|
|
|
|
You can use the HTML Help Workshop[^] from the Microsoft website to create these.
I Dream of Absolute Zero
|
|
|
|
|
Oh,I think I didn't represented it clearly,sorry!
I want to create chm files by my program,I want to know how to use the Microsoft's compiler in my program.Thanks!
|
|
|
|
|
Dear All,
I just created a combo box in VC++ 6.0 enviroment. but dont know how to get the selected item. I am using MFC to create this combo box
Regards,
Anson Tong
|
|
|
|
|
Sorry, i am NOT using MFC to create this combo box
Regards,
Anson Tong
|
|
|
|
|
Without MFC
int nCurSel = (int)SendMessage(hWndComboBox, CB_GETCURSEL, 0, 0);
will give the Currently Selected Item.
or
char szText[255];
GetWindowText(hWndComboBox,szText,255);
Hope it helps
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
It is better to use SendMessage(hWndComboBox, CB_GETLBTEXT, nCurSel, (LPARAM) (LPCSTR) szText) instead GetWindowText.
|
|
|
|
|
Why?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
If i rememeber good, GetWindowText won't returns text oly if you're using editable combo box,
it won;t return you selection in droplist combobox
rrrado
|
|
|
|
|
I use GetWindowText() for all three styles.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
This windows message is used for a combo box. If you have multiple choice what you expected to get, and GetWindowText copies the text specified window's title bar, but if you have a window control, the text of the control is copied but you never be sure which text will be copied.
|
|
|
|
|
Branislav wrote:
This windows message is used for a combo box.
Which is what the OP was inquiring about.
Branislav wrote:
If you have multiple choice...
You can't have multiple choices with a combobox.
Branislav wrote:
...but if you have a window control, the text of the control is copied but you never be sure which text will be copied.
This makes no sense. How could you not be sure what text will be retrieved?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Yes, you are right I am thinking about list box but in MSDN about potential message-map:
ON_CBN_SELCHANGE The selection in the list box of a combo box is about to be changed as a result of the user either clicking in the list box or changing the selection by using the arrow keys. When processing this message, the text in the edit control of the combo box can only be retrieved via GetLBText or another similar function. GetWindowText cannot be used.
|
|
|
|
|
Branislav wrote:
ON_CBN_SELCHANGE The selection in the list box of a combo box is about to be changed
Wrong. The CBN_SELCHANGE message is sent after the selection has changed.
Branislav wrote:
When processing this message, the text in the edit control of the combo box can only be retrieved via GetLBText or another similar function. GetWindowText cannot be used.
Wrong again. GetWindowText() can most certainly be used at this point, as the combobox has already been updated to reflect the new selection.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|