|
|
Hi, I am making one application using win32 and VC++.NET. I have one ‘list control’ and one ‘edit control’ in my dialog box. Now I select one item in list control and then I tried to click in edit box to write something in it, I lost selection from list control. Can I know what kind of style I have to use in my list control so it will not lost selection.
Thanks in advance.
Priyank.
|
|
|
|
|
Use LVS_SHOWSELALWAYS style while creating list control.
Or go to control poperties -->Appearance-->Always Show selection , and set it to true .
|
|
|
|
|
Thanks
|
|
|
|
|
Hello,
I have a dll which get injected into every running process.
I want all of my dll instances to share a certain char * variable.
However, even if I use the #pragma data_seg(...) definition, the variable holds the correct value only for one instance of it, which is the instance created to work with my app.
What can I do to share the variable?
Thanks in advance,
Shy.
|
|
|
|
|
Hi
Do you supply the value to the variable at the time of initialization in the shared data segment. Because your dll must be loading first of all in your process, and then in others, therefore, the shared pointer contains value correct only for your app's process.
Generally, pointer variables should not be shared among different mappings of a dll. The pointer variable will contain address pertaining to the address space of a particular process, and which will be invalid for other processes.
Pankaj
|
|
|
|
|
pnkj wrote: Do you supply the value to the variable at the time of initialization in the shared data segment?
This is my #pragma snippet:
#pragma data_seg("SHARED")<br />
char *myString = new char[100];<br />
#pragma data_seg()<br />
#pragma comment(linker, "/section:SHARED,RWS")
I also tried the following:
char myString[100];
pnkj wrote: Generally, pointer variables should not be shared among different mappings of a dll.
How would I use a string then?
Added:
I forgot to mention that I get a link error which appears only once, and if I compile again it disappears:
--------------------Configuration: HookingCore - Win32 Debug--------------------
Compiling...
HookingCore.cpp
Linking...
Creating library Debug/HookingCore.lib and object Debug/HookingCore.exp
LINK : warning LNK4039: section "SHARED" specified with /SECTION option does not exist
HookingCore.dll - 0 error(s), 1 warning(s)
|
|
|
|
|
The pointer itself may be shared among processes, but the data it points to is not. Use shared memory for that, check out CreateFileMapping() and MapViewOfFile()
|
|
|
|
|
Because this error \"SQL:Statement too long"\ i must write an SQL statement for 3 columns , because when i say CRecordset pSet;
pSet.Update(); The cause of this error ! (Update) because he is try to update all columns in my table , i have 400.000 records !
all i want is to Edit a field pSet.Edit();
My SQL statement is too long , but i dont write an SQL statement how can i short him ? or how can i write an SQL statement to retrieve just 3 columns from my table , please help me !?!?
Bravoone
|
|
|
|
|
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Do not feed the troll ! - Common proverb
|
|
|
|
|
I think you must read a sql book else you can not write a good program
|
|
|
|
|
You've failed to provide sufficient enough information for a meaningful answer. Have you derived class from CRecordset ? What does it look like? What does the code look like that opens the database and/or record set? What does the code look like that calls Edit() and Update() methods? The more relevant code that you omit from your post, the less help you're apt to receive.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
void CNoteDlg::OnSalveazaCr()
{
CWaitCursor wait; // Display a wait cursor
for(int i=0; i<m_list.getitemcount();i++)
{
="" if(m_list.getcheck(i))
="" {
="" cstring="" stemp,stemp1,stemp2,stip1,stip2,stest1,sanul1,
="" sluna,sluna1,sziua1,sdata;
="" cmainspace="" *pmainspace="new" cmainspace;
="" pmainspace-="">m_sTextDatabase.Empty();
pMainSpace->m_sTextDatabase1.Empty();
pMainSpace->m_sTextDatabase2.Empty();
pMainSpace->m_sTextDatabase3.Empty();
m_cod.GetWindowText(pMainSpace->m_sTextDatabase);
pMainSpace->m_sTextDatabase.TrimLeft();
pMainSpace->m_sTextDatabase.TrimRight();
m_nrNota.GetWindowText(pMainSpace->m_sTextDatabase1);
pMainSpace->m_sTextDatabase.TrimLeft();
pMainSpace->m_sTextDatabase.TrimRight();
m_datanota.GetWindowText(sLuna1);
m_datanota3.GetWindowText(sZiua1);
m_datanota1.GetWindowText(sAnul1);
pMainSpace->m_sTextDatabase3 = m_list.GetItemText(i,22);
pMainSpace->m_sTextDatabase2 = sLuna1 + "/" + sZiua1 + "/" + sAnul1;
CDatabase_Note pBun;
pBun.m_strFilter="note1="+ pMainSpace->m_sTextDatabase;
pBun.m_strFilter="note2="+ pMainSpace->m_sTextDatabase1;
pBun.m_strFilter="note3="+ pMainSpace->m_sTextDatabase3;
pBun.Open();
pBun.Edit();
while (!pBun.IsEOF())
{
int nIndexA = pBun.m_note1.Find(pMainSpace->m_sTextDatabase);
int nIndexB = pBun.m_note2.Find(pMainSpace->m_sTextDatabase1);
if ((nIndexA != -1) & (nIndexB != -1))
{
pBun.Edit();
pMainSpace->m_sTextDatabase3 = m_list.GetItemText(i,22);
pBun.m_note2 = pMainSpace->m_sTextDatabase3;
pBun.Update();
pBun.Close();
delete pMainSpace;
break;
}
//while
}
m_list.DeleteItem(i);
i--;
}
}
}
this is my code ... but somethig is wrong because it say SQL: Statement too long ! what can i do !
please help me !
i will wait your answer !
because i dont have one !
Bravoone
|
|
|
|
|
Bravoone_2006 wrote: for(int i=0; i<m_list.GetItemCount();i++)
...
i--;
Notice anything wrong with this?
Bravoone_2006 wrote: CMainSpace *pMainSpace = new CMainSpace;
It is not necessary to make this a pointer. Remove the new and delete calls.
Bravoone_2006 wrote: pMainSpace->m_sTextDatabase.Empty();
pMainSpace->m_sTextDatabase1.Empty();
pMainSpace->m_sTextDatabase2.Empty();
pMainSpace->m_sTextDatabase3.Empty();
The calls to Empty() are not necessary.
Bravoone_2006 wrote: while (!pBun.IsEOF())
I do not see anything in the while loop that is advancing the pBun object to the next record. Have you ensured that the while loop terminates.
Aside from the logic errors, what exactly are you trying to accomplish here?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
All i want is to Edit some fields !
How? i have done what you say but no change !
... how can i terminate the while loop , and where i must do in while pBun.MoveNext();?
Bravoone
|
|
|
|
|
Bravoone_2006 wrote: How? i have done what you say but no change !
None of my suggestions had anything to do with "editing fields." I would suggest posting your modified code snippet (please use the <pre> tags for this), and the results it is producing.
Bravoone_2006 wrote: how can i terminate the while loop ,
What is the while loop supposed to be doing?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
How long does a SQL statement have to be to be too long? 64K? 1MB?
Do you have 400,000 records or 400,000 columns?
I guess the real question is - How many times are you going to ask this question without providing
any information so someone can try to help you?
|
|
|
|
|
1MB? and I think you guess is right
|
|
|
|
|
Hello together!
I run a hexapod / stewart platform, which receives its position data from a computer that acts as a server. I have put up a direct LAN connection (100Mbit/s) between this host and the computer on which we will run all the simulation software for our project. I want to transmitt the new position data (36 bytes)every 5 or better every 2 ms. Therefor I planed to use UDP and I used some code I found here. By now the packets I sent only arrive seperately if I transmitt the packets with 100Hz. A higher pulse seems not possible. I already changed the MTU to 70....
If you please have any hint...
Thanks a lot and kind regards.
Oli
|
|
|
|
|
kletteroli wrote: By now the packets I sent only arrive seperately if I transmitt the packets with 100Hz.
Huh? And if you send them faster they arrive how? Why change the MTU? You should easily be able
to send this data using UDP (even TCP).
Something's up in your communication code.
|
|
|
|
|
I want to add items between two dates.I used CTime class to find the two dates(current and past). i want to add the list of url's i opened that range of time.Everything is fine but how can we make the condition on times for ex: for or while or if etc
|
|
|
|
|
CTime has normal add and compare operators, so you can loop on a CTime the same way you would do with an integer.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Do not feed the troll ! - Common proverb
|
|
|
|
|
CTime CurTime = CTime::GetCurrentTime();
CString sTime1,sHour,sTime2;
sTime1.Format("%d/%d/%d",CurTime.GetYear(),CurTime.GetMonth(),CurTime.GetDay());
sTime2.Format"%d/%d/%d", .......);
m_time1.SetWindowText(sTime1);
m_time2.SetWindowText(sTime2);
if(sTime1 > sTime2)
{
//Do something
//lets say m_time3.SetWindowText("Real time");
}
UpdateData(FALSE);
Bravoone
|
|
|
|
|
I have converted file time to system time using the function,
FileTimeToSystemTime(&suURL.ftLastVisited,&st);
Now can i get the time in CTime from the above line.I am able to display the string value for that particular systemtime.otherwise how can we convert CString to CTime.
Thanks
|
|
|
|
|
radhika28 wrote: otherwise how can we convert CString to CTime.
If the time is in a standard format, use COleDateTime::ParseDateTime() . The CTime class is too limiting.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|