|
|
use a pirated copy !!! or linux
sorry i dint understand ur question
|
|
|
|
|
wow! my brother was right! he has a tiny great application, enabling him to do it. microsoft???
Thank you masters!
|
|
|
|
|
Hi All,
I am trying to read text from ListView of other application.
I have created a demo application which is working fine for all listview (FolderView/ Winzip Listview control and listview of some application), but it is not working for a particular Listview.
I am able to get the RowCounts/ Column Counts but I am not able to read text.
Below is my code which I am executing to get ListItem.
The original code is in VB6, but Message API code/messages are similar in VC++/MFC.
<pre>Private Const LVM_FIRST = &H1000
Private Const LVM_GETITEMCOUNT = (LVM_FIRST + 4)
Private Const LVM_GETITEM = (LVM_FIRST + 5)
Private Const LVM_GETSTRINGWIDTH = (LVM_FIRST + 17)
Private Const LVM_GETCOLUMN = (LVM_FIRST + 25)
Private Const LVM_GETITEMTEXT = (LVM_FIRST + 45)
strLength = SendMessage(hWindow, LVM_GETITEMTEXT, iItem, ByVal pMyItemMemory)</pre>
Above code is working fine for other listview, and strLength is returning currect length of text of the List item.
I tried to debug, and understand nature of window (Listview Window) and I observed that all other listview where it is working fine having Windows Proc as Unicode and for list where it is not working having Windows Proc as ANSI (I got this information using Windows Spy++ utility).
My understanding is to get listview item for ANSI strings there would be different message needs to pass.
I appreciate your time and thanking you for any help or direction.
Regards
Rushi
|
|
|
|
|
You could specifically try to use SendMessageA .
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hi Superman ,
Thank you for your prompt reply.
But i guess I am using SendMessageA only see my declaration.
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByRef lParam As Any) As Long
</pre>
Regards
Rushi
|
|
|
|
|
it is a big problem,when I use socket send file from windows to linux and only receive unknown codes,how to design this program,server and client they both work well in file transfer.
|
|
|
|
|
Here's something[^], for a start...you may even be able to find FTP client and server source code.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi all
Can anybody tell me what is scalar deleting destructor.
When i try to delete a class pointer which is derived from CWnd it is showing this error.
class CGraphTollTip : public CWnd
{
....
....
}
class CGraphicsView : public CScrollView
{
....
....
CGraphTollTip *m_wndGraphTollTip;
void CGraphicsView::OnInitialUpdate()
{
....
m_wndGraphTollTip=new CGraphTollTip[SomeValue];
....
....
}
CGraphicsView::~CGraphicsView()
{
delete [] m_wndGraphTollTip;
}
....
....
}
While deleting m_wndGraphTollTip i am getting this error in vc6.0 callstack.
Please help me.
|
|
|
|
|
Here is the checklist:
1. Review the destructor of CGraphTollTip . Maybe it does delete this in its destructor.
2. Validate the pointer array when you are going to delete it.
CGraphicsView::~CGraphicsView()
{
if(m_wndGraphTollTip) {
delete [] wndGraphTollTip;
}
}
Maxwell Chen
|
|
|
|
|
I have checked the destructor of CGraphTollTip.In that delete this is not there
Also in CGraphicsView destructor i had validated the pointer but still the problem is not solved.
|
|
|
|
|
These two discussions (PCreview[^] and CodeGuru[^]) talked the same thing. Maybe they help...
Maxwell Chen
|
|
|
|
|
lbuttonDown out of a mode window, this mode window will refresh, but no message of paint spring.
witch message is spring?
handsome boy and beautiful girl!
who get this?
please tell me. thank you!
|
|
|
|
|
Your question is not clear.
Did you use any language translator? Then it is better to translate back to your language to ensure that what is translated is correct or not.
- ns ami -
|
|
|
|
|
Hi, someone can help with this ?
The objects composition are:
My user interface ... STProfissional ... Do_Start() ... Doing()
.....................
..................... STFabrica ....... STProducao ... STCelula ... STPacoteFabrica ... Move_()
.......................................
....................................... STLogistica ... STProjeto ... STPacoteCliente
Thread 1 = My user interface
Thread 2 = Worker thread started inside profissional (See code). (Blackground).
From STProfessional i would like to start Move_EntradaToBaseline() in STPacoteFabrica ...
My project is basicaly: Inside STFabrica, STProducao, STCelula, STPacoteFAbrica, STLogistica, STProjeto e STPacoteCliente i will make text files containing tasks informations and i put then into directories where a worker Thread (Thread 2) get it and manage it, openig it, reading the tasks informations e calling the apropriated function inside classes STFabrica, STProducao, STCelula, STPacoteFAbrica, STLogistica, STProjeto e STPacoteCliente that efectively do the task.
My Objects (Or classes if you prefer) are just a Set of CString object containing informations about directories, Names, Caracteristics,etc. Sametimes i use deque<cstring> for mantain necessary lists.
I receive the error when was did my first test that call Move_EntradaToBaseline()...(Thread 1, STPacoteFabrica.cpp) from Doing() (Thread 2, STProfessional.cpp) and the error happen.
I noted that, when i put a breakpoint in the line where the error heappen, Looking for variables content, they are invalid, with dirty content or invalid pointers ... I don´t now wy this heappen.
if someone needs i can send the code files ... I realy need help ... the approuch is essencial in my project.
Sorry by poor english, I´m brasiliam and student for this language ...
|
|
|
|
|
SNArruda wrote: I receive the error when was did my first test that call Move_EntradaToBaseline()...(Thread 1, STPacoteFabrica.cpp) from Doing() (Thread 2, STProfessional.cpp) and the error happen.
Sorry, but if you call a function from the worked thread, it's going to execute in the context of the worked thread, no matter if you think it should be executing in the UI thread.
SNArruda wrote: I noted that, when i put a breakpoint in the line where the error heappen, Looking for variables content, they are invalid, with dirty content or invalid pointers ... I don´t now wy this heappen.
Do you use any locking or any other technique to make sure that shared data isn't being altered by one of the threads while the other one's looking at it?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Tanks for your attention ...
Stuart Dootson wrote:
Sorry, but if you call a function from the worked thread, it's going to execute in the context of the worked thread, no matter if you think it should be executing in the UI thread.
so, there are a way to start a function directly in a UI Thread context from worker thread context ?
Stuart Dootson wrote:
Do you use any locking or any other technique to make sure that shared data isn't being altered by one of the threads while the other one's looking at it?
Here, i have many questions about how the things happen, i´m very new about it. above you tell me about context´s ... wy the data needs to be locked before your use ? ... each context don´t have your own data ... or for example the data STPacoteFabrica::p_sPacoteFabrica (CString having a path for a diretory) belong of 2 context´s ?
There are way to attach files here ? I would like to attach the .h and .cpp files
|
|
|
|
|
SNArruda wrote: so, there are a way to start a function directly in a UI Thread context from worker thread context
Not really - although if you send/post a message to one of the UI thread's windows, the message handler will be executed in the UI thread - that's about the best way of communicating between worker and UI threads.
SNArruda wrote: wy the data needs to be locked before your use ? ... each context don´t have your own data ... or for example the data STPacoteFabrica::p_sPacoteFabrica (CString having a path for a diretory) belong of 2 context´s ?
Class members, heap allocated data - it's all visible to both threads. If the UI thread modifies some data while the worker thread is accessing it...you've got a problem. If the worker thread modifies some data while the UI thread is accessing it...you've got a problem. You use locks to ensure that only one thread can access data at a time.
Can I suggest you look at some introductory thread information? There are several on CP[^].
SNArruda wrote: There are way to attach files here ? I would like to attach the .h and .cpp files
I don't believe there are.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
have you applied some type of syncronization mechanism in your program. if not, try critcal_section
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Tanks Alok Gupta,
I'll study the critical_section.
But, one thing resistance to go into my mind.
I have two threads. The primary thread that corresponding to UI thread and a worker thread.
There are a way to call, from a Worker thread, a function in primary thread context without messages. Simply geting a pointer and starting it.
Another example, if i create another worker thread, so, i will have a primary thread, worker_thread_1 and worker_thread_2, and will desired call from worker_thread_1::fx(), from its context, the worker_thread_2::fy(), in its own context.
I Realy need to do this, or samething like.
if you need, see my .h and .cpp files attached early
|
|
|
|
|
I've a SDI Application and want to Enable/Disable some menu items under some specific conditions. My CAppView is derived from CRichEditView and I used the following code to find if it's changed since I set the Modification Flah (using SetModify) or not:
GetRichEditCtrl().SetModify( FALSE ) ;
GetRichEditCtrl().SetModify( TRUE ) ;
if ( GetRichEditCtrl().GetModify() )
{
}
but GetRichEditCtrl().GetModify() allways returns TRUE, even if I set GetRichEditCtrl().SetModify( TRUE )
Any idea?
Thank you masters!
|
|
|
|
|
Look at the usage of the ON_UPDATE_COMMAND_UI macro.
|
|
|
|
|
Jusef Marzbany wrote: but GetRichEditCtrl().GetModify() allways returns TRUE, even if I set GetRichEditCtrl().SetModify( TRUE )
You use GetRichEditCtrl().SetModify( FALSE ) to reset the modification flag to false - see here[^].
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I'm trying to create a small function for a program that should extract the data as a string from a column of a tab delimited text file. It seems to be returning an empty string though.
Let me know if you notice what's wrong with this function. Edit: this is VC++
Function:
string split_row(string line, int column)
{
int c_temp;
string data;
int pos;
const string delimiter = "\t";
for(c_temp=1; c_temp<=9; c_temp++)
{
pos = line.find_first_of(delimiter);
if (c_temp != column)
{
line.erase(0, pos);
}
else
{
data = line.substr(0, pos-1);
break;
}
}
return data;
}
If the string "row", below, were to be:
12 test Phone 2009
And we called split_row(row, 2) it should return "test Phone".
Thanks! (sorry for the stupid username)
|
|
|
|
|
This code (changed bits in bold) seems to work with your test data. I suspect you were forgetting that ranges in STL are half-open, i.e. the last character in the range specification isn't part of the range.
string split_row(string line, int column)
{
int c_temp;
string data;
int pos;
const string delimiter = "\t";
for(c_temp=1; c_temp<=9; c_temp++)
{
pos = line.find_first_of(delimiter);
if (c_temp != column)
{
line.erase(0, pos+1);
}
else
{
data = line.substr(0, pos);
break;
}
}
return data;
}
Ought to add a check that pos != std::string::npos, as that indicates no tab, so a possible error condition.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|