|
Using a CFile object comes to mind. If you are not using MFC, there's also CreateFile() and WriteFile() .
"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 MFC Application..There is a Button in the Dialog.(Button Name is "create Access Database")
When I click the Button ,I want to create a Access Database and make a link with that database..
How do I do that?
any one know this,please help me..
Thanks in advance..
|
|
|
|
|
1. Learn to be patient. You asked this earlier today.
2. Learn to use MSDN search engine.
Goto Microsoft's Developer Network[^] site, and in the "Search MSDN for" box, type in
Create access database c++
and press 'Go'. This will bring up at least one article explaining how to do this using DAO. If you want to use OLE DB instead, try
JET database c++ "OLE DB"
as your query.
MS are recommending OLE DB or ADO over JET/DAO and ODBC for "portability" reasons (JET won't be supported on Win64).
You could also try and get hold of either
Database Programming with Visual C++ 6 in 21 days (Sams)
or
Visual C++ 6 Database Programming Tutorial by Wendy Sarrett, although my copy is a Wrox Press book, and they don't do it any more. Amazon might have used ones though...
Steve S
Developer for hire
|
|
|
|
|
How do i get the User Names and other details of users in a Win 9x system. It seems NetUserEnum is not supported in 9x.
Yuvaraj N
|
|
|
|
|
I can Tell you the way to get every User account present in the computer but other details i can't.
actually Win9x treat Every user same, ie ADMIN as it has full control over computer.
this is way you can Find all theuser present in you computer ,but remember this is hack.
you have to enumerate the Key Under HKEY_USERS section ,is Key name is equivalent to Username.
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi All,
When I am linking my one of the module i am getting the following error during link operation:
Copyright (C) Microsoft Corporation. All rights reserved.
/MAP /NODEFAULTLIB /OPT:NOREF /RELEASE /DEBUG:notmapped,full /SUBSYSTEM:CONSOLE /DLL -out:../wntmsci10.pro/bin/sal3.dll -map:../wntmsci10.pro/misc/sal3.map -def:../wntmsci10.pro/misc/sal3.def -implib:../wntmsci10.pro/lib/isal.lib ..\wntmsci10.pro\slo\sal3_version.obj ..\wntmsci10.pro\slo\sal3_description.obj ..\wntmsci10.pro\slo\dllentry.obj ..\wntmsci10.pro\slb\sal.lib uwinapi.lib advapi32.lib wsock32.lib mpr.lib shell32.lib comdlg32.lib user32.lib ole32.lib msvcrt.lib uwinapi.lib kernel32.lib user32.lib oldnames.lib ..\wntmsci10.pro\misc\sal3.res
LINK : warning LNK4224: /DEBUG:NOTMAPPED is no longer supported; ignored
../wntmsci10.pro/misc/sal3.def(2) : warning LNK4017: DESCRIPTION statement not supported for the target platform; ignored
../wntmsci10.pro/misc/sal3.def(3) : warning LNK4017: DATA statement not supported for the target platform; ignored Creating library ../wntmsci10.pro/lib/isal.lib and object ../wntmsci10.pro/lib/isal.exp
sal.lib(unload.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl _STL::__stl_throw_length_error(char const *)" (__imp_?__stl_throw_length_error@_STL@@YAXPBD@Z) referenced in function "protected: void __thiscall _STL::_Vector_base<void *,s
truct MyAllocator<void *> >::_M_throw_length_error(void)const " (?_M_throw_length_error@?$_Vector_base@PAXU?$MyAllocator@PAX@@@_STL@@IBEXXZ)
sal.lib(macro.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl _STL::__stl_throw_length_error(char const *)" (__imp_?__stl_throw_length_error@_STL@@YAXPBD@Z)
sal.lib(unload.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static unsigned int const * const _STL::_Stl_prime<bool>::_M_list" (__imp_?_M_list@?$_Stl_prime@_N@_STL@@2QBIB) referenced in function "private: unsigned int __thiscall _STL::hashtable<struct _STL::pair<void * const,struct _STL::pair<unsigned long,unsigned char (__cdecl*)(struct TimeValue *)> >,void *,struct hashModule,struct _STL::_Select1st<struct _STL::pair<void * const,struct _STL::pair<unsigned long,unsigned char (__cdecl*)(struct TimeValue *)> > >,struct _STL::equal_to<void *>,struct MyAllocator<void *> >::_M_next_size(unsigned int)const " (?_M_next_size@?$hashtable@U?$pair@QAXU?$pair@KP6AEPAUTimeValue@@@Z@_STL@@@_STL@@PAXUhashModule@@U?$_Select1st@U?$pair@QAXU?$pair@KP6AEPAUTimeValue@@@Z@_STL@@@_STL@@@2@U?$equal_to@PAX@2@U?$MyAllocator@PAX@@@_STL@@ABEII@Z)
sal.lib(macro.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned int const * const _STL::_Stl_prime<bool>::_M_list" (__imp_?_M_list@?$_Stl_prime@_N@_STL@@2QBIB)../wntmsci10.pro/bin/sal3.dll : fatal error LNK1120: 2 unresolved externals
dmake: Error code 96, while making '../wntmsci10.pro/bin/sal3.dll'
echo: No match.
ERROR: Error 65280 occurred while making /cygdrive/c/oo/sal/util
dmake: Error code 1, while making 'build_all'
echo: No match.
Can anybody explain me that due to which function or member variable i am getting this linker error
Thanks In advance
Bye
Nitin Mahajan
|
|
|
|
|
Hi all,
I'm using tooltip in an MFC ActiveX Control Project. I have added Handler for TTN_NEEDTEXT Notification Message. But this Notification is not calling. I tried in an SDI Application. It works.. Could anyone tell the solution
BEGIN_MESSAGE_MAP(CEx1Ctrl, COleControl)
//{{AFX_MSG_MAP(CEx1Ctrl)
ON_WM_MOUSEMOVE()
ON_WM_PAINT()
ON_WM_SIZE()
ON_WM_CREATE()
//}}AFX_MSG_MAP
ON_NOTIFY_EX(TTN_NEEDTEXT, 0, OnToolTipNeedText)
ON_OLEVERB(AFX_IDS_VERB_PROPERTIES, OnProperties)
END_MESSAGE_MAP()
regards
Rajesh
|
|
|
|
|
Does EnableToolTips() need to be called? Is their a group box surrounding the control?
Rajesh_Parameswaran wrote:
ON_NOTIFY_EX(TTN_NEEDTEXT, 0, OnToolTipNeedText)
Try this instead:
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTW, 0, 0xFFFF, OnToolTipNeedText)
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTA, 0, 0xFFFF, OnToolTipNeedText)
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I'm Using an ActiveX Control. So how do I enable the Tooltip.. where should I give the EnableToolTips() function..?
FYI - The same Stuff is working in a SDI Application..
TIA
regards,
Rajesh
|
|
|
|
|
I have a view from wh ere I call an Object A property dialog (modal). In that Dailog I call an Object B property dialog (non modal). It may happen that the Object A is destroyed in the Object B property dialog. So it looks logical to close the Object A property dialog automatically by sending it a message to close itself. OK, I know how to write and handle messages in general but i don't know how to send a message to the Object A property dialog.
Should i store a pointer to this dialog and then call a SendMessage? Looks absurd...
SendMessageToDescendants() called for AfxGetMainWnd() doesn't work...
Any explanation would be appreciated.
|
|
|
|
|
Hi,
you can define a public function in the ObjectA property Dialog and in the second dialog's close function, u just create a member of the first one and invoke the public function of ObjectA dialog box, which inturn calls the OnOK() function.
ObjectA.cpp
---------
void CADlg::Destroy()
{
OnOK();
}
ObjectB.cpp
-----------
void CBDlg::OnButton1()
{
// TODO: Add your control notification handler code here
OnOK();
CADlg *pWnd = (CADlg*)GetParent();
pWnd->Destroy();
}
or
can also use this way
void CBDlg::OnButton1()
{
// TODO: Add your control notification handler code here
OnOK();
CADlg *pWnd = (CADlg*)GetParent();
pWnd->EndDialog();
}
Regards,
Rajesh
|
|
|
|
|
It's not that easy - the dialog B is a modaless dialog and its parent is a MainFrame...
|
|
|
|
|
maybe this could help.....
use GetParent() function and retrieve the pointer to the main window,
then use the PostMessage(WM_CLOSE, 0, 0);
hope that helpz.....
cheerz
|
|
|
|
|
hi all,
I want to create access database using provider="Microsoft.Jet.OLEDB.4.0"...
How to Dinamically create Access database using it?
|
|
|
|
|
hello everybody,
what is the responsible part which decides in which language messagebox buttons are displayed ? Does someone have a clue?
thanks in advance,
hph
|
|
|
|
|
ask your windows how you installed it...
TOXCCT >>> GEII power
|
|
|
|
|
Boy what a question, hundreds of articles have been written on this M$ spent great deal of time with iffy solutions. As for default buttons that is easy, Right Click on the Dialog in the resource view, Properties, Language.
Make sure your compiler has the targeted lang pack installed from M$.
"Naked we come and bruised we go."
- James Douglas Morrison
Best Wishes,
ez_way
|
|
|
|
|
I am having trouble in registering a dll module which is an add-in for Visual Studio .NET 2003:
DLLRegisterServer in cyclocomplexviewernet.dll failed.
Return code was: 0x80070002.
Using the Error Lookup tool this means:
The system cannot find the file specified.
My question is how do I find out how to find which file the regsvr32 program is looking for?
I am the handsome one in the crowd.
|
|
|
|
|
Try to use Denpends in Visual Studio Tools to investigate which runtime dll is needed.
|
|
|
|
|
Do you mean the error happens, when compiling a visual studio add-in project ?
There is no spoon.
suhredayan
|
|
|
|
|
Create one function called Writelog(), pass the error code to this function
and write to some file. Now check what is the root of problem !
Try to get error code using GetLastError()
nways have you written RegisterServer() function in your code of dll ?
Regards,
Vishal More
|
|
|
|
|
Firstly you replied to a wrong message.
vishalmore wrote:
Try to get error code using GetLastError()
Since FranzKlein already have the error code :"0x80070002", wots the point in using GetLastError() again ?
There is no spoon.
suhredayan
|
|
|
|
|
No, compilation runs fine. It occurs when I use Regsvr32 to register the specified dll with the registry.
I am the handsome one in the crowd.
|
|
|
|
|
Try entering the fully qualifed path to the dll in question when using RegSvr32.
e.g. Instead of RegSvr32 my.dll use RegSvr32 c:\mydlllocation\my.dll
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Hi all,
I have a dialogbox created in an SDI application on which i placed a ownerdraw buttons and i am displaying some characters on the buttons and when i open the dialog box for the first time with shift key pressed on keyboard i am able to see capital letters on the buttons and when i open the dialog box with out pressing the shift key small letters are apperaring and if I press shift key on the keyboard after opening the dialog box and click on the button i could see the capital letter on the button but my reqirement is when i click shift key on my keyboard after opening the dialog box i shold be able to see capital letters on all the buttons without clicking them
my drawitem function is as follow:
void MybutCls::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
::DrawFrameControl(lpDrawItemStruct->hDC, &lpDrawItemStruct->rcItem,
DFC_BUTTON, BS_PUSHBUTTON);
int iSaveDC;
CDC* pDC;
pDC=CDC::FromHandle(lpDrawItemStruct->hDC);
VERIFY(pDC);
short caps=GetKeyState(20);
if((0x8000 ==(0x8000 & GetKeyState(16))&& !caps)||(0x8000 !=(0x8000 & GetKeyState(16))&& caps))
{
if(lpDrawItemStruct->CtlID==IDC_BUTTON65)
::DrawText(lpDrawItemStruct->hDC,"A",1,&lpDrawItemStruct->rcItem, DT_SINGLELINE|DT_VCENTER|DT_CENTER);
if(lpDrawItemStruct->CtlID==IDC_BUTTON66)
::DrawText(lpDrawItemStruct->hDC,"B",1,&lpDrawItemStruct->rcItem, DT_SINGLELINE|DT_VCENTER|DT_CENTER);
if(lpDrawItemStruct->CtlID==IDC_BUTTON67)
::DrawText(lpDrawItemStruct->hDC,"C",1,&lpDrawItemStruct->rcItem, DT_SINGLELINE|DT_VCENTER|DT_CENTER);
}
if((0x8000 ==(0x8000 & GetKeyState(16))&& caps)||(0x8000 !=(0x8000 & GetKeyState(16))&& !caps))
{
if(lpDrawItemStruct->CtlID==IDC_BUTTON65)
::DrawText(lpDrawItemStruct->hDC,"a",1,&lpDrawItemStruct->rcItem, DT_SINGLELINE|DT_VCENTER|DT_CENTER);
if(lpDrawItemStruct->CtlID==IDC_BUTTON66)
::DrawText(lpDrawItemStruct->hDC,"b",1,&lpDrawItemStruct->rcItem, DT_SINGLELINE|DT_VCENTER|DT_CENTER);
if(lpDrawItemStruct->CtlID==IDC_BUTTON67)
::DrawText(lpDrawItemStruct->hDC,"c",1,&lpDrawItemStruct->rcItem, DT_SINGLELINE|DT_VCENTER|DT_CENTER);
}
iSaveDC=pDC->SaveDC();
pDC->RestoreDC(iSaveDC);
// Invalidate(FALSE);
}
|
|
|
|
|