|
You have many options:
1)Specify the database in the ODBC DSN
2)Specify the full qualifier in your statements (select * from MyDB..MyTable, insert into MyDB..MyTable...)
3)Do a SQLExecDirect of "use MyDB"
onwards and upwards...
|
|
|
|
|
halblonious wrote:
I mean, there's like 6 databases in that DSN...
A DSN is tied to only one database at a time. When you created the DSN through the ODBC applet in Control Panel, you were asked to pick the database. I've used DSNs with both Access and SQL databases, and aside from how the actual DSN dialog box looks and behaves, it's a 1:1 relationship.
I may be way off base here. If so, please provide a small code snippet to help clarify the issue(s).
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Using the CDatabase class to read an Access databases
By Zahirul Haque also on this site shows how to cinnect to the actual MDB file if you are using ACCESS
Ger
|
|
|
|
|
Hi!
I'm using an Html Control to print a document. I'm using the IDM_PRINT and IDM_PRINTPREVIEW commands.
I would like to make a page break, but I don't now the way, or the HTML tag to put in my document to do this.
And another question, is it possible to control the header of my pages. How to do this?
Thks in advance!
Appstmd
http://www.appstmd.com
|
|
|
|
|
The HTML tag is style="page-break-before:always"
onwards and upwards...
|
|
|
|
|
Thanks a lot!
I also find an article on MSDN about how to change print settings in a WebBrowser control: http://support.microsoft.com/default.aspx?scid=kb;EN-US;236777
Appstmd
http://www.appstmd.com
|
|
|
|
|
Hello,
Over the last few weeks I have been writing a win32 application not using MFC and I have come up against a problem. I'm trying to figure out how to add a toolbar with icon buttons and a combo box below it. To get an idea of what I want here's a picture: http://k1studios.com/images/trav.gif.As you can see I want to have that exact layout but I have no idea how to develope that since I don't have the help of MFC. So if anybody has any idea I would REALLY appreciate it. Thank you, Caleb
|
|
|
|
|
If you really want to hold buttons and combobox together at one toolbar, you should use CDialogBar .
On the other side, the standard approach is to put buttons and combobox to two separate toolbars, that are docked together, as in the Internet Explorer. There you should use CReBar .
In both case you can design the toolbar layout in Dialog editor.
Robert-Antonio
|
|
|
|
|
are there dangers of using typedef in C++ ?
I'm cleaning up some old legacy C code, ported to C++, and there are some typedef that are somewhat useless.
are typedef only semantic ?
I have something like :
struct myStruct<br />
{<br />
<br />
};
and somewhere else
typedef myStruct anotherName
and it bugs me to have to search for files and functions with 2 different type names!!!
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
the useful typedef was with the C to avoid the systematic rewrite of struct keyword in object instanciations like struct MyStruct MyObject.
But, as far as i know, even if your typedefs seem useless, there is no danger to let them where they are. If you want to remove them, you'll have to change all the code !!!
TOXCCT alias Nicolas C.
|
|
|
|
|
If anotherName is what's used all over the code, the best thing to do is to rename myStruct to anotherName and get rid of the typedef.
Regards,
Alvaro
"I do" is both the shortest and the longest sentence in the English language.
|
|
|
|
|
no, anotherName is used in about 10% of the code; and does not reflect what it is !!!
I've removed the anotherName typedef and only use one name in all the code.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
In C++ a struct name is a fully qualified type name, where as in C it is not. Hence you see all the typedefs.
In C++, a typedef is a type name alias. So if typedef SomeType SomeAlias , then SomeType is fully equivalent to SomeAlias.
If you do not want all these differnent names, just search and replace all instances of the typedef names with the struct name. No danger at all.
--
He just smiled and gave me a vegemite sandwich.
|
|
|
|
|
I downloaded the DXSDK and what I started out to do was trying to get the samples to compile. So I enter Samples\C++\Direct3D and pick a random sample. I then open up the .sln file with VS .NET 2003 which pops up an question about if I want to convert the project. A question where I of course pick yes. Everything works fine so far and after some reading I of course want to compile the thing to see what it looks like. After hiting F5 and waiting for a few secs it complains about not finding d3dx9.h. Fine, probably some include missing so I take a look at the includes and add the path to d3dx9.h. After another compile it complains about a lib, which I remedy by including the path to the libs as well. On the third compile I get LNK1104, which means a file couldn't be opened, namely d3dx9dt.lib. The file do exist in the supplied lib path though. So naturaly what I'm asking for is a way to get this thing to work
|
|
|
|
|
I have an file_1.exe command line program but no source code. I want to create anothere .exe, file_2.exe, with a better command line interface but it still have to call file_1.exe to perform some operations which I don't know how to code. From file_2.exe, I can call file_1.exe to perform whatever, but is there a way to package file_1.exe into file_2.exe such that we don't have to copy both programs to a system before running it.
|
|
|
|
|
One solution is to import the file_1.exe into file_2.exe as a resource. Load file_1.exe resource into disk at runtime.
Kuphryn
|
|
|
|
|
See if this article helps.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Thankx for all the response...but those two suggestions will not work..
I try import the file_1.exe as a resource file into file_2.exe Visual C++ project. I can still compile but it will not package file_1.exe into file_2.exe. There is still a requirements for copying both file_1.exe and file_2.exe to the same dir.
The link is very helpful but not in this case. It still requires two files to manage which is what I try to avoid.
|
|
|
|
|
What you want cannot be achieved. In order for file_1.exe to be "ran", it must be saved to disk first. Managing two files instead of one is hardly a showstopper, though.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
yeah Davidcrow, this definely is not a showstopper. It is just a matter of convenience.
I just found an article from this site that give me a place to start. The article is "Launching Program from Resources" by Mohammad Salah on Mar 28, 2001. It is similar to what Kuphryn had suggested earlier. This article has instruction to add exe to project resource as well as sample code to access exe from resource file. It is definitely good place to start.
Hope this will help others as well.
|
|
|
|
|
iluvyuri wrote:
This article has instruction to add exe to project resource as well as sample code to access exe from resource file. It is definitely good place to start.
I like my article better! At a minimum, it provides more detail.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
I'm looking to make a dialog based program that utilizes a tab control and I'm looking for the best way to go about this. Currently I have the main dialog with the tab control on it and I've created two child dialogs to add to the tab pages. This is how I add the pages, and switch between them in my code. To me it doesn't look like the best way to do things so I was hoping to get some ideas on a better way to go about this. Here is the code:
BOOL CDataManDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_tabData.InsertItem (0, " Media Sales ");
m_tabData.InsertItem (1, " Price Information ");
VERIFY (m_dlgSales.Create (IDD_MEDIASALES_DIALOG, this));
VERIFY (m_dlgPrice.Create (IDD_PRICE_DIALOG, this));
CRect rectCtrl;
GetDlgItem (FRAME_TAB_DIALOG)->GetWindowRect (&rectCtrl);
ScreenToClient (&rectCtrl);
m_dlgSales.MoveWindow (&rectCtrl, TRUE);
m_dlgSales.BringWindowToTop ();
m_dlgSales.ShowWindow (SW_SHOW);
m_dlgSales.SetFocus ();
return FALSE;
}
void CDataManDlg::OnTabSelected(NMHDR* pNMHDR, LRESULT* pResult)
{
int nCurrentTab = m_tabData.GetCurSel ();
m_dlgSales.ShowWindow (SW_HIDE);
m_dlgPrice.ShowWindow (SW_HIDE);
CWnd* pWndCurrentTab = NULL;
switch (nCurrentTab) {
case 0:
pWndCurrentTab = &m_dlgSales;
break;
case 1:
pWndCurrentTab = &m_dlgPrice;
break;
default:
ASSERT (FALSE);
break;
}
if (pWndCurrentTab != NULL) {
CRect rectCtrl;
GetDlgItem (FRAME_TAB_DIALOG)->GetWindowRect (&rectCtrl);
ScreenToClient (&rectCtrl);
pWndCurrentTab->MoveWindow (&rectCtrl, TRUE);
pWndCurrentTab->ShowWindow (SW_SHOW);
pWndCurrentTab->Invalidate ();
pWndCurrentTab->UpdateWindow ();
pWndCurrentTab->BringWindowToTop ();
pWndCurrentTab->SetFocus ();
}
*pResult = 0;
} One thing that really bothers me is I have to have a staic control on the form that is sized to the tab control - minus the tabs (FRAME_TAB_DIALOG) in order to have the child dialogs sized correctly. This doesn't seem like a good way to do things. Any help and/or ideas would be greatly appreciated. Thanks.
- monrobot13
|
|
|
|
|
Yesterday, was a question like that, but a guy had a lot of control and he couldn't manage all of them...
I said him the better is using CPropertieSheet class with CPropertiePage....
Regards
Carlos Antollini
Do you know piFive[^] ?
|
|
|
|
|
That's an idea. Thanks.
- monrobot13
|
|
|
|
|
Can someone give me a quick explanation on copy constructors and what they are used for? I am alittel confused about them.
Thanks!!
|
|
|
|