|
Have you searched this site's Database section?
I can't recommend one specifically because I've never used anything except MFC's and my own portable class library. However, I must ask: why? Why go to plain Win32?
You may consider copying MFC's classes and "adapting" them as your own, since they wrap around the Win32 API.
Regards,
Alvaro
|
|
|
|
|
You can use ADO. It is a COM object. Just create an instance and go to it.
Long ago (1995), I used a thing called DBLib. It was pretty primative. I don't know if its still avaialble.
Hope this helps,
Bill
|
|
|
|
|
I have added speech to one of my applications using the Microsoft SDK 5.0. It works on my development machine, but not on machines that do not have the SDK loaded. Are there files from the SDK that need to be added to the target machine?
|
|
|
|
|
Yes. They are described in the documentation for the SDK. If you are really documenation adverse, try running the DEPENDS utility that ships with VC. It will tell you all the things your program needs to run. Go to a standard configuration system and see which ones are missing. If this is for wide distribution, better go with the documentation.
P.S. Remember, when redistributing other peoples software, check the licensing agreements. This is especially true if you are developing commercial software and distributing Microsoft stuff.
Hope this helps,
Bill
|
|
|
|
|
Hi, All.
How can I change the Z location of a control?
* Using MFC
* Dialog Based App.
Thanks
BTW: I want to thank you guys 4 helping me. Thanks.
|
|
|
|
|
Use CWnd::SetWindowPos().
--Mike--
http://home.inreach.com/mdunn/
"Not our fault we are intellectually superior to the rest of the office." -- Paul Watson in the Lounge, 12/12/2001
Sonork - 100.10414 AcidHelm
|
|
|
|
|
I use a CHtmlView to display a web page,and i can use this code to get the IHTMLDocument2 interface pointer:
CDhtmlView * pView = (CDhtmlView *)GetActiveView();
LPDISPATCH pDispatch;
pDispatch = pView->GetHtmlDocument();
IHTMLDocument2 * pHTML;
pDispatch->QueryInterface(IID_IHTMLDocument2,(void **)&pHTML);
then i can use this pointer to do something.
but when a homepage use the to split into same frame. how i get the IHTMLDocument2 pointer of a homepage in a frame??
|
|
|
|
|
Call IHTMLDocument2::get_frames() to get a IHTMLFramesCollection2 interface. For each frame in the collection, query it for IHTMLWindow2, then call get_document(). (There's sample code in MSDN on the IHTMLFramesCollection2::item page.)
--Mike--
http://home.inreach.com/mdunn/
"Not our fault we are intellectually superior to the rest of the office." -- Paul Watson in the Lounge, 12/12/2001
Sonork - 100.10414 AcidHelm
|
|
|
|
|
I want to read/write a unicode file. Is there a API through which I know whether the file is unicode or not, is there a file header for a unicode file. If this is not there, what is the function (string related) i need to use.
thanks
Kannan
|
|
|
|
|
Here's some code I use to avoid using a UNICODE file in a non-unicode build (gpfs the kernel):
#if !defined(_UNICODE)
DWORD dwBytesRead;
ReadFile(hFile, szBuf, 4096*sizeof(TCHAR), &dwBytesRead, NULL);
if(dwBytesRead > 7) {
DWORD dwUnicode = IsTextUnicode(szBuf, dwBytesRead, NULL);
if(dwUnicode) {
m_bStringsLoaded = FALSE;
retval = MD_UNICODE_ERROR;
}
}
#endif
Not guaranteed to work for small strings - hence the '> 7' check (as if thats gonna help me!). Check the docs for IsTextUnicode - interesting stuff.
|
|
|
|
|
Thanks. It works For me.
Cheers
Kannan
|
|
|
|
|
I'm trying to use the windows media player active-x control in my app but i can't seem to load a file. This is what i have:
CString Movie = "C:\mymovie.avi";
m_cPlayer.SetFileName(Movie);
m_cPlayer.Play();
i tried to put "file:///" before the path because some web related stuff needs it, but that didn't work either.
How do i load the file?
Thanks
Kuniva
|
|
|
|
|
The backslash should be typed twice:
CString Movie="C:\\mymovie.avi";
...
|
|
|
|
|
In msdn ,in "Recordset: Locking Records (ODBC)",It
said "Relatively few ODBC drivers currently support pessimistic locking."
How can I know my ODBC driver support pessimistic locking?
|
|
|
|
|
SQLGetInfo should do it.
Regards,
Alvaro
|
|
|
|
|
- How to change the size of a toolbar?
- How to add/remove a image of a toolbar?
- Can you help?
- Regards,
BigMouth
|
|
|
|
|
Use SetSizes() to change the size of toolbar buttons.
The height of a toolbar will be the height of the buttons.
And the width will be the width of the containing window
For images use an image list and send a TB_SETIMAGELIST message. If you want to change the images, change the image list and send the TB_SETIMAGELIST message again
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
- Thanks pal!
- I still have a question. Can you show me an example about the usage of TB_SETIMAGELIST message?
- Have a nice day,
BigMouth
|
|
|
|
|
You can actually modify the imagelist directly - m_wndToolbar.GetToolbarCtrl().GetImageList() returns a pointer to the image list, and you can then use ExtractIcon to pull an image out, or Add or Replace to add an image or replace one respectively.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
- Thanks pal!
- I use the following codes, but it seems that it does not work.
void CMainFrame::OnEditCopy()
{
// TODO: Add your command handler code here
CImageList* list1=this->m_wndToolBar.GetToolBarCtrl().GetImageList();
list1->Add(AfxGetApp()->LoadIcon(IDR_MAINFRAME));
}
- Can you help me out?
- Regards,
Maer
|
|
|
|
|
I did this
m_wndToolBar.GetToolBarCtrl().GetImageList()->Add(AfxGetApp()->LoadIcon(IDR_MAINFRAME));
CWindowDC w(NULL);
w.DrawIcon(0, 0, m_wndToolBar.GetToolBarCtrl().GetImageList()->ExtractIcon(list1->GetImageCount()-1));
AfxMessageBox("");
in OnCreate on a vanilla SDI app, and the icon is there, plain as day. You didn't expect to see it in the toolbar, did you ? It's in the image list, but you need to create a new button or change the image index of an existing button for the toolbar to show it.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
- Thanks pal!
- I use the following codes. But it has no effect.
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
// TODO: Delete these three lines if you don't want the toolbar to
// be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
CImageList* list1=this->m_wndToolBar.GetToolBarCtrl().GetImageList();
m_wndToolBar.GetToolBarCtrl().GetImageList()->Add(AfxGetApp()->LoadIcon(IDR_MAINFRAME));
CWindowDC w(NULL);
w.DrawIcon(0, 0, m_wndToolBar.GetToolBarCtrl().GetImageList()->ExtractIcon(list1->GetImageCount()-1));
AfxMessageBox("");
return 0;
}
- Can you help?
- Have a nice weekend,
BigMouth
|
|
|
|
|
What do you mean by no effect ? Like I said, this will add the image to the imagelist, and draw it on the top left of your screen in order to prove that it's there. But you've still not added a button with this image, so it's still not going to be on the toolbar. You need to fill a TBBUTTON structure with info including the index of this image, then call AddButton to add that button to the toolbar.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
- Thanks, Christian pal!
- Sorry, I have misunderstood your meaning before. I am a newbie of CToolBar. I have never modified it before. Now I find it is a hard work for me. So, if it does not take very much of your time, could you show me a simple example of your method?
- Have a nice weekend,
BigMouth
|
|
|
|
|
Sure - this is how you'd add a button with the bitmap we've been putting into the image list, which calls OnFileNew:
int index = m_wndToolBar.GetToolBarCtrl().GetImageList()->Add(AfxGetApp()->LoadIcon(IDR_MAINFRAME));
TBBUTTON btn;
btn.fsStyle = TBBUTTON;
btn.fsState = TBSTATE_ENABLED;
btn.idCommand = ID_FILE_NEW;
btn.iBitmap = index;
m_wndToolbar.GetToolBarCtrl().AddButtons(1, &btn);
Note we store the index of the image and pass it to the button, and we pass in the ID of the command we want the button to execute.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|