|
For the two record sets that are read-only, how were they opened that differs from the three record sets that are not read-only?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Thsnks for your kind consideration.
I have Classes like:
1. CHRMSSet (CRecordset inherited class) Created when I supplied the DSN to application at start. This is OK
2. CDept added using ODBC Consumer. This is also OK
CDialog based class is using CDept like (CDept *pDet = new CDept)
pDept->Open();
3. CSalaries using ODBC Consumer. This is Read-only
Implementation is As above
4. CSeniority............ Same case
5. CAttendance........ same case
Syed fasih
|
|
|
|
|
Are all five calls to Open() the same?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Hello all,
Perhaps this is a rather idiotic question to ask..but i will ask anyway.
I am writing a VC++ application with a lot of edit boxes (about a hundred >_<) and thus i have a lot of variables which go like PHASE1_1,PHASE1_2,PHASE1_3.....,PHASE2_1,PHASE2_2..PHASE3_1...etc
i find that i have a programming nightmare when i attempt to retrive values from all of them as i have to type out their names individually.
Is there any elegant way of handling A LOT of variables which are similar in name, such that it would make the program writing process a lot easier ?
Thanks in advance
|
|
|
|
|
Use an array of edit controls. You can access each of them by it's index.
Owner drawn
Jesus Loves
|
|
|
|
|
Oh that is interesting ! =)
Can you give more details on how to do that ?
I was looking for something like that...
Thanks
|
|
|
|
|
CEdit m_EditGroup[NUMBER_OF_EDITS_REQUIRED];
for(int index=0;index<NUMBER_OF_EDITS_REQUIRED;index++)
m_EditGroup[index].Create(...);
for(int index=0;index<NUMBER_OF_EDITS_REQUIRED;index+)
m_EditGroup[index].FunctionName(...);
Owner drawn
Jesus Loves
|
|
|
|
|
Owner drawn wrote: CEdit m_EditGroup[NUMBER_OF_EDITS_REQUIRED];m_EditGroup.Create(...);
Except that you have to create all the edit boxes (in a for loop).
|
|
|
|
|
Yeah.
Owner drawn
Jesus Loves
|
|
|
|
|
I wanted to use the "Express OLE DB Library"
(http://www.codeproject.com/database/expressodl.asp?df=100&tid=837433&forumid=3215&noise=5&exp=1&mpp=50&select=1293756)
in my Visual Studio 2003 Standard (with MFC) application.
But when i compile the first programm i have an erros:
Compiling...
stdafx.cpp
d:\AAA\SPR\SPR\Include\SypODLCommand.h(27) : error C3203: 'CRowset' : class template invalid as template argument for template parameter 'TRowset', expected a real type
d:\AAA\SPR\SPR\Include\SypODLRecordBase.h(53) : error C3200: 'int' : invalid template argument for template parameter 'TRowset', expected a class template
d:\AAA\SPR\SPR\Include\SypODLCommand.h(29) : see reference to class template instantiation 'CSypODLRecordBase<taccessor>' being compiled
with
[
TAccessor=CDynamicParameterAccessorEx
]
d:\AAA\SPR\SPR\Include\SypODLRecordset.h(25) : error C3203: 'CRowset' : class template invalid as template argument for template parameter 'TRowset', expected a real type
d:\AAA\SPR\SPR\Include\SypODLRecordBase.h(53) : error C3200: 'int' : invalid template argument for template parameter 'TRowset', expected a class template
d:\AAA\SPR\SPR\Include\SypODLRecordset.h(27) : see reference to class template instantiation 'CSypODLRecordBase<taccessor>' being compiled
with
[
TAccessor=CSypODLDynAccessor
]
d:\AAA\SPR\SPR\SypOLEDBLib.rc(3) : fatal error C1083: Cannot open include file: 'SypODLResource.h': No such file or directory
Build log was saved at "file://d:\Aaa\Spr\Spr\Debug\BuildLog.htm"
SPR - 5 error(s), 0 warning(s)
Can you help me?
regards
mwgomez
|
|
|
|
|
How to ignore this text. This warning appears everytime I build by application. Is there anyoption through which I can overcome this warning
APCApp warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification.
I will be thabkful if anyone can help me out.
Thanks
---Arun.
|
|
|
|
|
if you are using Visual Studio 2003, then follow these steps :-
Click On Project Menu Item then Click PROJECT_NAME properties. A Dialog Box will be popup, then choose Linker Tree Item, after Linker Tree Item get expanded choose General tree Link and in General properties, choose YES(/INCREMENTAL) combo option in Enable Incremental Linking link
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Thank you for your response Alok.
---Arun.
|
|
|
|
|
Hi,
I have a program to debug a proprietary mapping language. The window contains a CToolBar that will generate tooltips. When the program runs, it stops at each mapping command, waiting for the user to press all kinds of keys. During this, I have the messages processed using the following code:
while (m_bLoop)
{
WaitMessage ();
while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
{
if (!PreTranslateMessage (&msg))
{
TranslateMessage (&msg);
DispatchMessage (&msg);
}
}
}
During this message pump, everything works just fine (keys, menus, sizing or moving the window, etc), except that the tooltips on the toolbar don't show. When the program ends, and hence reverts to the standard message pump, the tooltips will show again.
Does anyone have an explanation for this?
Thanks in advance for any help
William Engberts
|
|
|
|
|
If you overrode PreTranslateMessage, did you call the base class PreTranslateMessage or not? Since it relies upon calling
AFX_MODULE_STATE* pModuleState = _AFX_CMDTARGET_GETSTATE();
if (pModuleState->m_pfnFilterToolTipMessage != NULL)
(*pModuleState->m_pfnFilterToolTipMessage)(pMsg, this);
to get the tooltips processed.
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|
|
Thanks for the remark. I do indeed override the PreTranslateMessage, but I also do include a call to the base class version:
BOOL CView32Dlg::PreTranslateMessage(MSG* pMsg)
{
BOOL r = TRUE;
if ( m_hAccel == NULL
|| !TranslateAccelerator(this->m_hWnd, m_hAccel, pMsg))
r = CDialog::PreTranslateMessage(pMsg);
return r;
}
As a test, I have also already tried to only call the base class PreTranslateMessage (so ignoring the accelerators):
BOOL CView32Dlg::PreTranslateMessage(MSG* pMsg)
{
BOOL r = TRUE;
// if ( m_hAccel == NULL
// || !TranslateAccelerator(this->m_hWnd, m_hAccel, pMsg))
r = CDialog::PreTranslateMessage(pMsg);
return r;
}
This indeed resulted in my accelerators not functioning, but I still did not get any tooltips (of course, only until my mainloop ended and the program falls back into the Microsoft message pump, wherever that may be)
Thanks
|
|
|
|
|
One idea, then might be to call this from your own PreTranslateMessage
void CWnd::FilterToolTipMessage(MSG* pMsg)
and if the tooltips don't appear, then maybe they are disabled.
You can try calling
BOOL CWnd::EnableToolTips(BOOL bEnable)
to make sure tooltps are activated for your window.
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|
|
I am facing few compilation errors,while importing Adobe Acrobat SDK 7.0 into VC++ 5.0 from Adobe Acrobat SDK 4.0 such as 1.Due to ENDHEADER and STARTFOOTER (
2. #error 64-bit integer type not supported (COREEXPT.h)
3. Warning: Using older Acrobat SDK. Define ACRO_SDK_LEVEL to 0x00070000 (ASExpT.h)
Any solution?
|
|
|
|
|
HI,
Using CFile i have created a file and write the data in it also using modeNoTruncte flag., Now when again the control come to that code , if the file already exist there then i want to write the data in that file from start and there should be no previous data in the file
Regards.
|
|
|
|
|
Then don't use the modeNoTruncate flag. Use only the modeCreate flag.
|
|
|
|
|
In first iteration of filw writing I have to right data gain that on line each in each inner loop .
While 2nd iteration of outer lop i have to write data from scratch in the inner loop
Regards.
|
|
|
|
|
Hi
I know my answer is a stupid one... but still
You want to write again from beginning. its equal to close the previous handle. Open is any other mode that delete the file and create it. then close again.( this is equal to close the handle and delete the file). then open in notruncate mode again.
souds funny I know. I will try to find out better options...
|
|
|
|
|
Hi,
Another option would be to set the filecursor back to the beginning using CFile::SeekToBegin (); and then emptying the file by CFile::SetLength (0);
Regards
William Engberts
|
|
|
|
|
Yes your one is a better solution.
I have no idea about SetLenght funtion.
Thanks
|
|
|
|
|
In continuation with Cedric.. combined CFile::modeWrite with CFile::modeCreate too
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|