|
See my reply here.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
hi all,
I am doing a Project using MFC and Access DataBase.In the Access Database, there is a Field called "Details" which data type is "OLE Object"..
How do we retrieve Valid data from that field using C++.?
I am trying like this:
BYTE * m_details;
CDatabase c1;CString s1;
c1.Open("demo");
CRecordset rs( &c1 );
rs.Open( CRecordset::forwardOnly, _T( "SELECT Details FROM ABC"));
do{
rs.GetFieldValue( (LPCTSTR)"Details",s1);
//I retrieve data like this:
m_details=(BYTE*)(LPSTR)(LPCTSTR)s1;
rs.MoveNext( );
}while( !rs.IsEOF( ) );
Program is compilling ...But I can not retrieve Valid value from the "Details" Field.."Details" is not integer or text..Data type of "details is Ole Object..
..
Can any body please reply me how to retrieve Correct and valid data from "Ole Object" data type field in a Access DataBase?
Thanks in advance..
|
|
|
|
|
This might be a stupid quistion for experienced developers, but is confusing me to much;
What is SDK? why it exists (any special reason)? why it is needed?
After some search on SDK, I have come to know that it is a s/w application /tool that allows to do low level API programming, here is the confusion i.e. when all APIs can be called in VC then why one should go for an SDK?
|
|
|
|
|
(1) VC contains part of the Platform SDK which is necessary to develop Windows applications (without that part you couldn't do it in VC)
(2) You need a newer Platform SDK if you want to access features available in new Windows versions
(3) If you are using a different compiler, you need the paltform SDK, too.
we are here to help each other get through this thing, whatever it is Vonnegut jr. boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
|
The MFC app is "dialog based", "main window" is a CPropertySheet with 2 pages.
logic process in CWinApp::InitInstance() looks like
//-------------------------------
Hide "main window"
if(error)
{
show "main window";
display error on main dialog;
}
exit the app;
//-----------------------------
i have to hide main window first for some reasons - hard to explain why in a few sentences.
according to process above, if no error, i should see nothing.
but actually i always see the dialog in a flash.
it means main window (property sheet) has not been hidden properly and thoroughly.
do you know how to hide the dialog without seeing a flash?
thx
includeh10
|
|
|
|
|
When you create dialog you specify its style, and one of the styles is if the window is shown or hidden. Remove shown flag. Use this if you create dialog through CDialog::Create()
If you created dialog in Resource editor then doubleclickit to change its properties, and turn off Visible property.
|
|
|
|
|
I need to create a window that docks to the right of the desktop, pushing all existing windows to the left.
One solution is to use a desk band, but it has some undesirable features, such as, another desk band can come and merge into mine.
Is there a way to make a custom window behave like the desk band, or to make restrictions to the deskband such that it can be docked only on the right, and no other deskbands can be merged into it?
Thanks.
|
|
|
|
|
How can I enter data into VtChart control (TVtChart) dynamically
in Borland C++
tijo joseph
|
|
|
|
|
you are on the Visual C++ forum... not borland's. sorry
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
tutorial.rc(29): error RC2135 : file not found: ID_MENU
tutorial.rc(33): error RC2135 : file not found: MENUITEM
tutorial.rc(20): error RC2144 : PRIMARY LANGUAGE ID not a number
tutorial.rc(31): error RC2164 : unexpected value in RCDATA
Here is the resource file. It is kind of big:
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "tutorial.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
ID_MENU MENU DISCARDABLE
BEGIN
POPUP "&File"
BEGIN
MENUITEM "&Start Smart Logger", ID_FILE_START
MENUITEM "Stop Smart Logger", ID_FILE_STOP
MENUITEM SEPARATOR
MENUITEM "&Save", ID_FILE_SAVE
MENUITEM "E&xit Smart Logger", ID_FILE_EXIT
END
POPUP "&Choose Dave Card"
BEGIN
MENUITEM "&P3", ID_CHOOSEDAVE_P3LOG
MENUITEM "&P4", ID_CHOOSEDAVE_P4LOG
MENUITEM "&P5", ID_CHOOSEDAVE_P5LOG
END
POPUP "&Choose Charlie Card"
BEGIN
MENUITEM "&ROM2", ID_CHOOSECHARLIE_ROM02LOG
MENUITEM "&ROM3", ID_CHOOSECHARLIE_ROM03LOG
MENUITEM "&ROM10", ID_CHOOSECHARLIE_ROM10LOG
MENUITEM "&ROM11", ID_CHOOSECHARLIE_ROM11LOG
END
POPUP "&Help"
BEGIN
MENUITEM "&About Smart Logger", ID_HELP_ABOUT
END
END
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""tutorial.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_DIALOG1 DIALOGEX 0, 0, 232, 129
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION |
WS_SYSMENU
CAPTION "Dialog"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "OK",IDOK,19,111,70,14
PUSHBUTTON "Cancel",IDCANCEL,128,111,73,14
CONTROL "Ins00",IDC_CHECK1,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,9,4,34,10
CONTROL "Ins02",IDC_CHECK2,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,9,17,34,10
CONTROL "Ins04",IDC_CHECK3,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,9,30,34,10
CONTROL "Ins06",IDC_CHECK4,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,9,43,34,10
CONTROL "Ins08",IDC_CHECK5,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,9,56,34,10
CONTROL "Ins0A",IDC_CHECK6,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,9,69,34,10
CONTROL "Ins0C",IDC_CHECK7,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,9,82,34,10
CONTROL "Ins0E",IDC_CHECK8,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,9,95,34,10
CONTROL "Ins10",IDC_CHECK9,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,45,4,34,10
CONTROL "Ins12",IDC_CHECK10,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,45,17,34,10
CONTROL "Ins14",IDC_CHECK11,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,45,30,34,10
CONTROL "Ins16",IDC_CHECK12,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,45,43,34,10
CONTROL "Ins18",IDC_CHECK13,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,45,56,34,10
CONTROL "Ins1A",IDC_CHECK14,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,45,69,34,10
CONTROL "Ins1C",IDC_CHECK15,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,45,82,34,10
CONTROL "Ins1E",IDC_CHECK16,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,45,95,34,10
CONTROL "Ins20",IDC_CHECK17,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,81,4,34,10
CONTROL "Ins22",IDC_CHECK18,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,81,17,34,10
CONTROL "Ins24",IDC_CHECK19,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,81,30,34,10
CONTROL "Ins26",IDC_CHECK20,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,81,43,34,10
CONTROL "Ins28",IDC_CHECK21,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,81,56,34,10
CONTROL "Ins2A",IDC_CHECK22,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,81,69,34,10
CONTROL "Ins2C",IDC_CHECK23,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,81,82,34,10
CONTROL "Ins2E",IDC_CHECK24,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,81,95,34,10
CONTROL "Ins30",IDC_CHECK25,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,117,4,34,10
CONTROL "Ins32",IDC_CHECK26,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,117,17,34,10
CONTROL "Ins34",IDC_CHECK27,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,117,30,34,10
CONTROL "Ins36",IDC_CHECK28,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,117,43,34,10
CONTROL "Ins38",IDC_CHECK29,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,117,56,34,10
CONTROL "Ins3A",IDC_CHECK30,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,117,69,34,10
CONTROL "Ins3C",IDC_CHECK31,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,117,82,34,10
CONTROL "Ins3E",IDC_CHECK32,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,117,95,34,10
CONTROL "Ins40",IDC_CHECK33,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,153,4,34,10
CONTROL "Ins42",IDC_CHECK34,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,153,17,34,10
CONTROL "Ins44",IDC_CHECK35,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,153,30,34,10
CONTROL "Ins46",IDC_CHECK36,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,153,43,34,10
CONTROL "Ins48",IDC_CHECK37,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,153,56,34,10
CONTROL "Ins4A",IDC_CHECK38,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,153,69,34,10
CONTROL "Ins4C",IDC_CHECK39,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,153,82,34,10
CONTROL "Ins4E",IDC_CHECK40,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,153,95,34,10
CONTROL "Ins50",IDC_CHECK41,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,189,4,34,10
CONTROL "Ins52",IDC_CHECK42,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,189,17,34,10
CONTROL "Ins54",IDC_CHECK43,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,189,30,34,10
CONTROL "Ins56",IDC_CHECK44,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,189,43,34,10
CONTROL "Ins58",IDC_CHECK45,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,189,56,34,10
CONTROL "Ins5A",IDC_CHECK46,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,189,69,34,10
CONTROL "Ins5C",IDC_CHECK47,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,189,82,34,10
CONTROL "Ins5E",IDC_CHECK48,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,189,95,34,10
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_DIALOG1, DIALOG
BEGIN
BOTTOMMARGIN, 128
END
END
#endif // APSTUDIO_INVOKED
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
Thanks
|
|
|
|
|
CNewbie wrote:
tutorial.rc(29): error RC2135 : file not found: ID_MENU
tutorial.rc(33): error RC2135 : file not found: MENUITEM
Can you confirm that ID_MENU is present in the resource.h file?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I try to build a menu bar wich contains in adding to menu items also some controls as Menu Bar with controls as ComboBox and Buttons (see as example the menu bar of Word XP which contains a combobox for help question).
If someone has an idea please help me!
RDANA
|
|
|
|
|
First off, what you are creating is a rebar control. This rebar control has two bands. First band is a menu bar control, and the second band is a combobox control.
Note that a menu bar control is NOT a CMenu object. MFC does not directly support a menu bar (as far as I remember), so you must design one yourself. A menu bar, basically, is a toolbar with a collection of text-only buttons. When clicking on a button, a pop-up menu is launched. This menu can be loaded from a resource, just like a normal pop-up menu would be.
To create a menu bar object, follow the implementation sample from MSDN here[^].
After this, create a CReBar control. From the frame window, remove the menu. Instead, add the CReBar, add the newly created menu bar control, and add the combo box control. You can add more controls if you want to. Then add the CReBar control into the frame window. Voila, you're done.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Antti Keskinen wrote:
Note that a menu bar control is NOT a CMenu object. MFC does not directly support a menu bar (as far as I remember), so you must design one yourself.
that's it. any "movable" menus also are not CMenu s...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I now can obtain a pointer points to the place where a bitmap stored in the memory, but I'm wandering how to display it on a dialogue based programme.
Thank you for your attention.
the simplier the better!
|
|
|
|
|
Select the bitmap into a new device context, (must be compatible, CreateCompatibleDC() does this);
then just CDC->BitBlt(); on the OnPaint() proc of the dialog app
|
|
|
|
|
rw104,thank you for your instructions, but I want to display the bitmap on a dialogue, so can you give me some more delights.
the simplier the better!
|
|
|
|
|
CDC imgDC;//temp CDC to render the bitmap into
imgDC.CreateCompatibleDC(pdc); //pdc is the standard screen dialog CDC, imgDC needs to be compat..
CBitmap yourBitmap;
yourBitmap.LoadBitmap(IDB_RESOURCEIMAGE);
//IDB_RESOURCEIMAGE is an image resource
//You already have a pointer to a bitmap so you do not need these two lines.
imgDC.SelectObject(yourBitmap);//bitmap gets selected into the dc
//bitblt the image , you 'll need to decide co-ordiantes
pdc->BitBlt(0,0,100,100,&imgDC,0,0,SRCCOPY);
That's it;P
|
|
|
|
|
There have been articles on transparent windows. In these cases, the topmost window is given varying degrees of transparency so the lower window is still visible. However, is it possible to add an overlay, something like a corporate logo for instance, that would do nothing but show the logo covering the screen. All controls and data entry would be at one or more of the lower-level windows. If the logo screenshot goes behind bacause the active window is pulled up, the effect is lost so I would want to avoid that. If a new window is popped up, I would still want the overlay remaining on top. The overlay kind of just sits on top, pretty much like you pasted a transparecy on the face of the monitor.
If the logo is the first one to be painted on the screen, all other windows would have to be made transparent, which might be difficult and multiple windows at 80% transparency does lead to opacity at some point.
Is there any way to accomplish what I want?
Thanks.
|
|
|
|
|
I have some codes that print some words, lines and a bitmap to the printer. But everything printed fine except the bitmap even it works fine in print preview.
Can you help me?
Thanks
|
|
|
|
|
What's the problem ? Is the bitmap really tiny ? If so, you need to get the size of the printer DC and stretchblt your image onto it.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
No, the image size is ok and the print preview works quite well, but it did not appear on the actual paper (bitmap lost).
|
|
|
|
|
What`s the code? What`s the problem? You couldn`t use the same CDC for printing bitmap with the CDC for printing lines and words.
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
I expect that the bitmap is tiny on the print out? is this what is happening?
if so it is because you are drawing the bitmap into a printing device context, in which case a much higher resolution is used, you need to use the CDC function
StretchBlt() to draw the bitmap into a resolution equivalent rectangle which you will need to work out. So look up StretchBlt()on MSDN its is very simple.!! this
function simply stretches the bits in the bitmap accordingly.
Print preview probably works because it uses a screen DC just like what you are drawing on.
P.S. I hope this is the problem you are getting, if not soz!!
|
|
|
|
|