|
ensger wrote: ...but it works
Of course it does, but GetBuffer() exposes the underlying char* object to possible (unwanted) changes. Try:
lvc.pszText = (LPTSTR) ((LPCTSTR) titel); Now titel cannot be accidentally changed.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I tried and it works. And the sense of this statement is even more obvious for me.
So, many thanks
|
|
|
|
|
Hi all,
Again i m having a problem related to multi threading....
Actually now what i m trying to do is i want to start a thread within a timer that is that thread shold run in particular time intervals...
this i have done it n its workin fi9...
Now my problem is if i have to run this timer for multiple processes like
one timer for that thread s'ld run within 4s sec n other in 5sec like this.......
can anybody plz help me in this.........
thanxs in advance
|
|
|
|
|
I'm not an expert, but i try to help you
It's possibly to start more than one
Timer in a window ( view or dialog )
You have the Handler like this :
void XX::OnTimer(UINT_PTR nIDEvent)<br />
{<br />
switch(nIDEvent){<br />
case TIMER_1: <br />
Timer1Proc();<br />
break;<br />
case TIMER_2:<br />
Timer2Proc();<br />
break;<br />
case TIMER_3:<br />
break;<br />
default:<br />
break;<br />
}<br />
}
TIMER_1 , 2 , 3 is a define
-- modified at 6:53 Wednesday 28th February, 2007
|
|
|
|
|
Each timer can be identified by id.
Watch first parameter of SetTimer .
neha.agarwal27 wrote: it n its workin fi9...
p.s. Dont use SMS like english, for others disliking.
|
|
|
|
|
neha.agarwal27 wrote: ow my problem is if i have to run this timer for multiple processes like
one timer for that thread s'ld run within 4s sec n other in 5sec like this.......
creating new thread every time will be very troublesome as it take some resource.. so if you want to run your thread for 4 sec and 5 sec.. it will run for much higher time depending on CPU condition
"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
Support CRY- Child Relief and You
|
|
|
|
|
Hi all,
I want to Know how many and what type of controls that are placed in a Dialog Box.
For example :-
i place a Button,CheckBox,listControl,ComboBox.... etc in a Dialog.
from code i want to Iterate all the Dialog Controls in the Dialog and Let me know what controls i have placed in the Dialog.
for(i = 0; i< No of Controls in Dialog ; i++)
{
if(CheckBox) //Alert it is CheckBox.
if(ComboBox) //Alert it is ComboBox.
.
.
.
}
Please let me know it is very urgent.
|
|
|
|
|
Look up GetWindow and GetNextWindow in MSDN.
|
|
|
|
|
CRect rect;
this->GetWindowRect(rect);
CWnd* pWnd = this->GetWindow(GW_CHILD);
CRect rcWnd;
while (pWnd) {
pWnd->GetWindowRect(rcWnd);
if (rcTest.IntersectRect(rect, rcWnd) && pWnd != this) {
}
pWnd = pWnd->GetWindow(GW_HWNDNEXT);
}
|
|
|
|
|
You can use EnumChildWindows ,too.
BOOL CALLBACK EnumChildProc(HWND hwndChild, LPARAM lParam)
{
TCHAR className[256] = {0};
GetClassName(hwndChild,className,256);
return TRUE;
}
EnumChildWindows(m_hWnd,EnumChildProc,0);
|
|
|
|
|
Hi Prasad,
Thank you very much for giving a valuble info. the problem get solved.
|
|
|
|
|
Uday Janaswamy wrote: I want to Know how many and what type of controls that are placed in a Dialog Box.
For example :-
i place a Button,CheckBox,listControl,ComboBox.... etc in a Dialog.
from code i want to Iterate all the Dialog Controls in the Dialog and Let me know what controls i have placed in the Dialog.
GetNextDlgTabItem
"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
Support CRY- Child Relief and You
|
|
|
|
|
Presently I am using the telnet command to connect an IP address which then asks for an Username and then Password. This is all in CUI mode, i.e from the DOS prompt.
I want an GUI application which will telnet the IP in the background and open an authentication window which will ask for Username & password. When correct Username & Password are supplied, it will connect and show the connection Status.
If possible please help me out in this regard.
Rupak
|
|
|
|
|
Look up sockets/Winsock and RFC854[^] for good places to start.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
I've seen what looks to be an excellent article at
http://www.codeproject.com/system/serial.asp
and I shall look at the source code, but what I want to know is if anyone has done any work with RS232 in just simple data reads from scientific equipment, e.g a digital electrometer. If someone has any examples or can point me to some, that would be great. Not even sure I need it to be that clever, it might just be a case of button driven "read data item X" from a dialog, i.e. wouldn't need to be constantly reading/updating.
|
|
|
|
|
Read this[^] article to get started.
I've done quite a few serial communication applications. :->
My approach is similar to the one mentioned in the article above, but I use one thread for writing and one thread for reading with two queues for data to send and data received.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Iam doing an application in VC++..
I want to know how the OS detects the memory drive inserted and loads the driver..
Can any one help me out for this..This is needed for my application...
Sample codes are more helpful..
Thanks in advance..
Regards
vijay
|
|
|
|
|
I beleive that the WM_DEVICECHANGE message is sent when a removable drive is inserted or removed.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
This is cool .
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
I want to know by seeing what, the particular driver is loaded..
Like every USB device have VID & PID, will it check those or anything else..
In my appliaction i want to detect only the pendrives..
So by knowing how the OS detects , i thoought that it will be help full to me..
Can u help in this aspect..
Thanks in advance
Regards
vijay
|
|
|
|
|
I am calling GetColumnInfo() function to get column (datatype - Text) information from the opened rowset. But ColumnSize should be less than 255 but i am getting values like 1162690894.
What may be the problem?
|
|
|
|
|
Can you post relevent code ?
|
|
|
|
|
DBORDINAL* pulColumns;
DBCOLUMNINFO** ppColumnInfo;
LPOLESTR* ppStrings;
HRESULT h = SomeTable.GetColumnInfo(&pulColumns, &ppColumnInfo, &ppStrings);
SomeTable is of CTable.
ppColumnInfo[index].ulColumnSize returns 1162690894
It should be less than or equal to 255.
|
|
|
|
|
Ordinal wrote: DBORDINAL* pulColumns;
DBCOLUMNINFO** ppColumnInfo;
LPOLESTR* ppStrings;
HRESULT h = SomeTable.GetColumnInfo(&pulColumns, &ppColumnInfo, &ppStrings);
How this code is compiling ?
Shouldn't this be like this ?
UINT pulColumns;
DBCOLUMNINFO* ppColumnInfo = NULL;
LPOLESTR ppStrings = NULL;
HRESULT h = SomeTable.GetColumnInfo(&pulColumns, &ppColumnInfo, &ppStrings);
|
|
|
|
|
I am sorry. U r right.
Anyways what may be the problem?
|
|
|
|