|
Neelesh K J Jain wrote:
query="Select * from Trans where Date = '08-06-2004'";
You are not taking the time into consideration, nor are you using the # symbol for date types. You'll need something like:
query = "SELECT * FROM Trans WHERE Date BETWEEN #08/06/2004 00:00:00# AND #08/06/2004 23:59:59#";
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
hello Friends,
I have got a table of following structure
|
|
|
|
|
Hi
I made three property pages on a property sheet.
Page1,Page2 and Page3.
A property sheet contains three button (OK, Cancel and Apply Buttons).
I also made three - dialog box.
Dialog1,Dialog2 and Dialog3.
Now ,I would like to do that when we select page1 and click on OK button on
a property sheet then dialog1 should be called.Similarly,when we select page2 and click
on OK button on a property sheet then dialog2 should be called. Similarly on page3.
I wrote some code:-
BOOL CPropertySheet::OnCommand(WPARAM wParam, LPARAM lParam)
{
if (LOWORD(wParam)==IDOK) {
CPage1* page1;
page1=(CPage1*)GetPage(0);
page1->UpdateData(TRUE);
CDialog1 dlg1;
dlg1.DoModal();
page1->UpdateData(TRUE);
CPage2* page2;
page2=(CPage2*)GetPage(1);
page2->UpdateData(TRUE);
CDialog2 dlg2;
dlg2.DoModal();
page2->UpdateData(TRUE);
CPage3* page3;
page3=(CPage3*)GetPage(2);
page3->UpdateData(TRUE);
CDialog3 dlg3;
dlg3.DoModal();
page3->UpdateData(TRUE);
return TRUE;
} else
return CPropertySheet::OnCommand(wParam, lParam);
}
What should I write the code ?
Any help appreciated .
rajesh
|
|
|
|
|
Something like:
BOOL CPropertySheet::OnCommand( WPARAM wParam, LPARAM lParam )
{
if (IDOK == LOWORD(wParam))
{
int nIndex = GetActiveIndex();
if (0 == nIndex)
{
CDialog1 dlg;
dlg.DoModal();
}
else if (1 == nIndex)
{
CDialog2 dlg;
dlg.DoModal();
}
else if (2 == nIndex)
{
CDialog3 dlg;
dlg.DoModal();
}
}
...
}
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
SC_HANDLE SCManager = OpenSCManager(NULL,NULL,SC_MANAGER_ALL_ACCESS);
This function works when i am administrator. but when i run this function as a user(other than administrator), it returns NULL.
why is it so?
can anyone help?
|
|
|
|
|
The other users you are using don't have permissions to connect with the SC_MANAGER_ALL_ACCESS level (which gives access to all functionality). You can try opening the manager with a lower level of access that your normal users should have. What do you want to do with the service manager?
|
|
|
|
|
i want to create a service and start the service.
|
|
|
|
|
The MSDN documentation for OpenScManager says "Only processes with Administrator privileges are able to open a database handle used by the CreateService and LockServiceDatabase functions."
|
|
|
|
|
Hi all,
I have a strange problem with embedding a CDateTimeCtrl in a CListCtrl...
When the control is shown it partly shows the date, it's if the
date gets shifted to the left, so for example if the date is today
it only shows -8-2004 instead of 9-8-2004.
I tried resizing it with different rectangle sizes and different
control styles but nothing seems to do the trick?
Any leads on how to solve this strange thingy are greatly appreciated!
Thanks,
mace
|
|
|
|
|
mace wrote:
I tried resizing it with different rectangle sizes...
Does this mean you made the column wider?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Well I didn't make the column itself wider, but the control displayed on it.
I tried to make it wider, or higher but none of it helped.
At first I thought I made the control's width to small so I enlarged
it but unfortunately this wasn't the case.
Any further clues?
Thanks,
mace
|
|
|
|
|
I'm not that good with C++, but you know how most numeric values start of from 0? Perhaps you need to do something similar... e.g, begin date at 0 - I'm not sure if off-setting the date is possible. But if it is, I bet that would be your problem.
|
|
|
|
|
No the problem is not that the values in the control are not correctly
initialized, moreover that the day-value gets shifted to the left
so it's not visible to the user. If I click on the control and
jump to the left with the cursor the complete value is visible.
But thanks for your suggestion anyway, if you or somebody else
knows another lead I hope to hear it....
Thanks,
mace
|
|
|
|
|
I already solved it.
The problem was with the focus. For some reason if I called SetFocus in the OnCreate function of the derived CDateTimeCtrl class I got this problem.
But if I called SetFocus in the derived CListCtrl class which is responsible for creating the control, right after it has been created, it all works fine!
Thanks for the reactions guys, but I am glad that I got it fixed now!
Take care,
mace
|
|
|
|
|
Hi, I'm developping a database application using DAO, and I think it uses version msjet36.dll or something like that.
I took the app on my home pc, and it just stopped working, I checked out and there was only the msjet40.dll installed.
As far as I know, these dlls are dynamically loaded, but are there any compatibility issues?
Regards
Daniel
|
|
|
|
|
Hi All,
Is there any sample application without using STL List for addition or deletion?
|
|
|
|
|
Examples of what? And why would you now want to use an STL list, may I ask?
|
|
|
|
|
Hi,
I wrote an application in which, i used lot of structures. Using STL list i push and pop the few same set of structure items. My friends said, STL list makes more weitage, So i decided for alteration. I got the solution now. Gokings thanks for ur effort.
Thanks
|
|
|
|
|
i am bulding a wave Player in vc++, i am using Playsound()(mmsystem.h) function to play wave file. So can any one help me how to stop, pause and set the Timer ( to control the Slider) for Wave file while playing.
|
|
|
|
|
Dear all,
i'm struggling since last week trying to find memory leaks in my web application when number of users increases, say 100 or more. We have a web based application which uses some VB as well as VC Com dll's. The InetInfo.exe crashes due to memory leaks caused by these dll's and also by the asp code.
We've used a microsoft application to generate the memory dump of InetInfo.exe
Its called LeakDiag. It generated the dmp file and also some xml logs. We also used microsoft's DmpChk.exe to read the dmp file. This is (text) the contents of the dump file
<br />
RVA 00000BB8, 01000000 - 01006000: 'C:\WINNT\system32\inetsrv\inetinfo.exe'<br />
RVA 00000C24, 77f80000 - 77ffd000: 'C:\WINNT\system32\NTDLL.DLL'<br />
RVA 00000C90, 78000000 - 78046000: 'C:\WINNT\system32\msvcrt.dll'<br />
RVA 00000CFC, 7c570000 - 7c628000: 'C:\WINNT\system32\KERNEL32.DLL'<br />
RVA 00000D68, 7c2d0000 - 7c332000: 'C:\WINNT\system32\ADVAPI32.DLL'<br />
RVA 00000DD4, 77d30000 - 77da1000: 'C:\WINNT\system32\rpcrt4.dll'<br />
RVA 00000E40, 77e10000 - 77e75000: 'C:\WINNT\system32\USER32.DLL'<br />
RVA 00000EAC, 77f40000 - 77f7e000: 'C:\WINNT\system32\GDI32.DLL'<br />
RVA 00000F18, 77a50000 - 77b3f000: 'C:\WINNT\system32\OLE32.DLL'<br />
RVA 00000F84, 6e5a0000 - 6e5c0000: 'C:\WINNT\system32\iisrtl.dll'<br />
...<br />
...<br />
...<br />
These are the lines of text which correspond to our application dll's
<br />
RVA 000039B4, 11000000 - 111b4000: 'C:\Apps\WebCache\WebCache.dll'<br />
RVA 00004518, 04200000 - 04573000: 'C:\Apps\WebCache\Admin.dll'<br />
...<br />
...<br />
But i'm stuck now. I do not know how do i understand and interpret the above data. Is there some other way i can track memory leaks in my dll's and/or web application.
Plz. help.
____________________________________________________________
rishabhs
I think therefore I am.
|
|
|
|
|
I always search on 'new' and 'delete'. (in C++ every new has a delete)
but this is not efficient though.
There are programs that do the search for you. I think "Purify" is one of them. (but I'm not sure)
During my studies they always said that you could easily write a garbage collector... ?
good luck.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
I'm working with tree view ctrl with MFC and WTL.
What I really want is to get callback message (TVN_GETDISPINFO) into my tree view class and process or modify my tree items.
That's why I set I_CHILDRENCALLBACK to cChildren in TVITEM structure and set TVIF_CHILDREN flag into uFlags somthing when I insert items to tree ctrl..
My GetDispInfo handler look like this..
if(tvitem.mask & TVIF_CHILDREN){
tvitem.cChildren = (/*somecondion is true?%/)? 1: 0;
}
But I doesn't work..
Even though some items have children, button look like [+] didn't appear..but I could expand that..
Very strange, isn't it..?
Does anyone have idea to solve this problem?
|
|
|
|
|
i need to query the registry entry corresponding to HKEY_LOCAL_MACHINE as a user other than the administrator. but i m unable to do so. i cannot query unless i m administrator. why is it so?
|
|
|
|
|
|
Should the next C++ standard include support for "Design by Contract"?
I'm interested in hearing people's oppinions on the subject.
|
|
|
|