|
You can use the following method to modify the state
for removing of selection where
state = 0
nMask = LVS_SELECTED
SetItemState( int nItem, UINT nState, UINT nMask );
Knock out "T" from CAN'T
You 'CAN' if you think you 'CAN'
-- modified at 0:36 Wednesday 5th April, 2006
|
|
|
|
|
Hi,
I've done a dialogbased project and created databases(MSACCESS) using recordset(class wizard).Now my problem is where do u declare this m_pSet?
In SDI u do it in VIEW Class,but in dialogbased where do u do it?
I get the foll errors when I execute the program:
m_pSet :Undeclared identifier
pls help me
swapna_signsin
|
|
|
|
|
i think you are trying to reuse some code you saw somewhere on the web.
i don't know what type is m_pSet , but refering to its name, ,i think it could be a CRecordSet*
and as there is a prepending m_ it means that it is a member of a class.
but tell me where you found your source ??
|
|
|
|
|
hi,
well thats right,it was the method I used in SDI application in which m_pSet gets automatically.It is a recordset.
Actually Iam a beginner to databases and I just wanna connect my database(MSACCESS) with two fields name and grade thru dialogbased.
How do u think I should proceed?
bye
swapna_signsin
|
|
|
|
|
swapna_signsin wrote: In SDI u do it in VIEW Class,but in dialogbased where do u do it?
Make it a member of the dialog class.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hi,
I am using a slide control in a dialog and I used Visual studio to create it and place the slider on it.
When I want to add the tick marks, I have a problem. I must use the Create function for that with the "TBS_AUTOTICKS" flag, but the problem is that I can't use the Create function since Visual Studio already did it for me using the macros.
Any way to set this flag or override the Create function macro ?
Shay
|
|
|
|
|
Just check the "Auto ticks" checkbox in the resource editor.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Why couldn't I think about it before
BTW, I am using VS 2003 and it also need the Tick Marks property checked.
Thanks !
|
|
|
|
|
I use double buffers to draw a rectangle.I add codes in OnPrepareDC() function:
{ CScrollView::OnPrepareDC(pDC, pInfo);
pDC->SetMapMode(MM_ISOTROPIC);
pDC->SetWindowExt(CSize(100,100));
pDC->SetViewportExt(CSize(300,300));
}
In OnDraw() function,I wrote this:pDC->BitBlt(....,&dcmem,0,0,SRCCOPY);
I found that the rectange became lager and thicker than its original state(In its original state, I wrote pDC->SetViewporOrg(CSize(100,100)) in OnPrepareDC
function )The problem is ,when I changed the mapping mode of Memory DC(memDC),that is,I used this code OnPrePareDC(&dcMem),I found that the rectangle's size got larger but the line width couldn't become larger,what's the diffrence?plz help.
|
|
|
|
|
If your pen width is 0, you will always gets a border or line width of 1 pixel.
(On a side note, MM_ISOTROPIC and double buffers can exhibit rounding errors in the form of streaks and smudging when changing the window and viewport extents. I posted a comment about this in Keith Rule's article in the "Font's and GDI" section of CP. If you drag your "help about" window over your double buffered client area, you will see smudging and/or remnants due to rounding errors. I put a clickety to a helpful link to an (old) Microsoft article that will adapt a solution to your project in that comment.)
|
|
|
|
|
how to allocate in loop any given number of dimension for multidimensional array
like static int m_arr[10][20][15][5][] .... [] ... but do it dynamically
9ine
|
|
|
|
|
you must allocate dimensions one by one...
|
|
|
|
|
Another approach, which should simplify this a bit, is a structure with member functions.
Pointer or vector
Kuphryn
|
|
|
|
|
I've choosen to store multidimensional indeces of all possible combinations
see my topic hackers delight, ....
9ine
|
|
|
|
|
Hi,
Is there any way to Increase the Height of the status Bar?
|
|
|
|
|
|
RockyJames wrote: Is there any way to Increase the Height of the status Bar?
you have to subclass the statusbar and implement Subclassed statusbar there
|
|
|
|
|
Hi everyone,
I have a doubt regarding setting and getting of menus. I change the menu of my frame using:
pMainFrame->MDISetMenu(ptrToAValidMenuTobeLoaded);(pMainFrame = this is the pointer to my Valid Frame)
But when i say :
CMenu* pSetMenu = AfxGetMainWnd()->GetMenu();(GetMenu function of CWnd class)
iam not getting the menu.(pSetMenu is NULL)
Does MDISetMenu of MDIFrameWnd Class and SetMenu of CWnd class, sets menus at different places?
How can i Get my menu attached with my Main window.(is there any other method of doing the same)
Note:
After my application loads iam able to see that the menu is set properly and iam able to see it also.
Thanks a lot for replies and/or reading the same,
thnx
KAB
|
|
|
|
|
I am trying to use the WaitCommEvent function to listen for a signal coming through pin 6 on an RS232. Before i listen i want to send two signals out on different pins. I can already send the signals succesfully, however, does anyone have an example of using WaitCommEvent to listen for a signal that i can view ?
|
|
|
|
|
|
That site is great.. Thanks for that. However here is my delimma
On the 9 pin rs232, i am suing 5 pins to set and monitor.
Pins 2 and 3 are in use continuosly (Recieve and Transmit data)
Pins 4 and 7 (DTR and RTS) are used on occasion and are set high , then set low afterwards.
Pin 6 (DSR) , i need to monitor the input after i set Pin 4 and 7(DTR and DTS)
Can i monitor Pin 6 without using WaitCommEvent?
If so, how will i syncronize all this with just one handle to the COM port?
|
|
|
|
|
Taken from the MSDN :
#include <windows.h>
#include <assert.h>
#include <stdio.h>
void main( )
{
HANDLE hCom;
OVERLAPPED o;
BOOL fSuccess;
DWORD dwEvtMask;
hCom = CreateFile( "COM1",
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
OPEN_EXISTING,
FILE_FLAG_OVERLAPPED,
NULL
);
if (hCom == INVALID_HANDLE_VALUE)
{
printf("CreateFile failed with error %d.\n", GetLastError());
return;
}
fSuccess = SetCommMask(hCom, EV_CTS | EV_DSR);
if (!fSuccess)
{
printf("SetCommMask failed with error %d.\n", GetLastError());
return;
}
o.hEvent = CreateEvent(
NULL,
FALSE,
FALSE,
NULL
);
o.Internal = 0;
o.InternalHigh = 0;
o.Offset = 0;
o.OffsetHigh = 0;
assert(o.hEvent);
if (WaitCommEvent(hCom, &dwEvtMask, &o))
{
if (dwEvtMask & EV_DSR)
{
}
if (dwEvtMask & EV_CTS)
{
}
}
else
{
DWORD dwRet = GetLastError();
if( ERROR_IO_PENDING == dwRet)
{
printf("I/O is pending...\n");
}
else
printf("Wait failed with error %d.\n", GetLastError());
}
}
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Is there any utility which tells C,C++ prgrams performace...? in terms of CPU utilization like..
|
|
|
|
|
what do you want to know exactly ??
|
|
|
|
|
I have code like
int array[10]={10 elements}
int *ptr=array;
int value=0;
here are 2 code fragments
1) for(int i=0;i<10;i++)
value=*(ptr+i);
2) for(int i=0;i<10;i++)
value=*ptr++;
I want to check performance of (1) against (2)
|
|
|
|