|
Hi
I have the following
struct tcbholder
{
char* tcb;
char programname[8];
struct stdecs stdecsx;
list <stdecs> strptr;
list <stdecs>::iterator stfirstptr;
list <stdecs>::iterator straverse;
};
struct stdecs
{
struct vsmdesc stordesc;
char* tcb;
struct blkdesc ablkdescx;
struct blkdesc fblkdescx;
list <blkdesc> ablkptr;
list<blkdesc>::iterator blktraverse;
list<blkdesc> fblkptr;
}
struct blkdesc
{
char type;
int blkaddr;
int blklen;
};
I declare a list class
list<tcbholder> tcbcollecter;
then a iterator
list <tcbholder>::iterator tcbitrate;
I am able to initialize the main iterator
tcbitrate = tcbcollecter.begin();
However when I try
tcbitrate->straverse = tcbitrate->strptr.begin();
I get the following
_STL_VERIFY(this->_Ptr != _Mycont->_Myhead, "cannot dereference end list iterator");
its in the list member line 151
Dont Understand
Thanks
|
|
|
|
|
It means that your "tcbcollecter" list was empty when you assigned the "tcbitrate" iterator. Calling begin() on an empty list will give you the end() iterator, because there is no real element to point to. You can't dereference it because it doesn't point at anything.
|
|
|
|
|
How would I solve this problem would calling tcbitrate->push_back solve it after that there is something on the list though the members of tcbcollector have not been assigned values
|
|
|
|
|
Instead of trying to manipulate the contents of these structs from outside I would add member functions to do it.
|
|
|
|
|
Was thinking how to that don’t know if it’s practical my list represents the output of VSMLIST z/os assembler mainframe macro representing the amount allocate free and I unallocated storage for an address space
It’s listed by storage blocks ( address and length ) storage descriptors representing a storage subpool which different attributes and storage keys and the TCB task control blocks of the task that own them
|
|
|
|
|
Quote: tcbitrate = tcbcollecter.begin();
Quote: tcbitrate->straverse = tcbitrate->strptr.begin(); If tcbcollecter is empty then the complaint is correct.
"In testa che avete, Signor di Ceprano?"
-- Rigoletto
|
|
|
|
|
I think I finally got it a iterator is for traversing
I first have to populate the list
I’m in bed now with my iPhone I’ll try this again after work
Thanks
|
|
|
|
|
Message Closed
modified 15-May-23 19:06pm.
|
|
|
|
|
Quote: Forgive me to be so bold - but I just cannot believe that in versatile forum like
this there is nobody who can at lest give me some idea how to resolve this.
It seems to be a problem that everybody wants SINGLE system problem
- that seldom works in real life.
As the title suggest - I need to connect Qt generated object / window to Linux "terminal"
(operating system ) native window.
I can highlight ( Using Qt) the text in the native window (!)
but Qt gives me no indication it did that.
PLEASE - NO PASSING THE BUCK TO QT FORUM - THEY HAVE NO IDEA HOW TO PROCEED - IT IS NOT Qt ISSUE IN THEIR ASSESSMENT -HENCE out OF THEIR narrow minded LEAGUE.
ps i WILL REMOVE THIS , AND MY SIMILAR POSTS, IF i DO NOT GET REASONABLE REPLY , JUST TO SAVE SPACE HERE.
Edited / addendum
I am still looking for somebody who is willing to help me instead of just posting text.
If it bothers you that my post is not specifically C/C++ code , please ignore it .
If it bothers you that my post is too complex , please ignore it also.
If it bothers you that my post is poorly written - read how to post / answer questions.
Is short - write something helpful and constructive.
"Terms and conditions apply to your answer."
You're doing it again, and you wonder why nobody, in any forum, is willing to even talk to you, let alone help you.
|
|
|
|
|
Member 14968771 wrote: How does terminal created window "connect" to Qt ? - that is the question. And as so often suggested, that is a question for a QT forum and has nothing to do with C/C++. Unless you can show some actual code and explain (without all the unnecessary orders) what the problem is, there is very little anyone here can do to help you. So try this template:
---------------------------
In the following code, the instruction at line x throws an out of range exception, even though the calculation appears to be correct. blah blah ...
int value = 5;
do
{
} while (values < 10);
---------------------------
That's all we need, not a load of 'instructions' about how we must answer your questions in a form that you think you deserve. Remember, we are all volunteers here and actually do this because we like to help people. What we do not care for is being given orders, especially by those who somehow think we are their employees.
|
|
|
|
|
Message Closed
modified 15-May-23 19:06pm.
|
|
|
|
|
I am sorry, but whatever the people at QT say, this is purely a QT question. Every single line in that code is using a QT command or object so that is where the answer(s) lie.
[edit]
Member 14968771 wrote: how to "link " Qt process created terminal window with Qt running application. Not sure what you mean by that. The started terminal is a separate process, so the only connection between the two is the process id which allows the caller to determine whether the started process is running or not.
[/edit]
|
|
|
|
|
Message Closed
modified 15-May-23 19:06pm.
|
|
|
|
|
I suspect that what's going on is that when you highlight some text in your terminal window, its getting copied to a clipboard in the GUI. Or perhaps its not getting copied and you need to tell the terminal app to copy the text - usually, but not guaranteed to be, CTL-C. Otherwise, you might need to look into the GUI API for accessing contents of the clipboard. Note that many XTerm emulators seem to have 2 independent clipboards. There's one that you get when you merely highlight the text, and which you can then usually paste with middle-button on the mouse. There's also the Cut/Paste (CTL-C/CTL-V) clipboard. The two sometimes seem to be synchronized, but not always. In general, I think you should prefer the Cut/Paste method, as that seems to copy text to the GUI's idea of the clipboard, and is usually what you get back when you Paste. This is all a bit hand-wavy, because it seems like there's no hard and fast rules about what gets copied where during a highlight and/or a Copy/Paste.
Keep Calm and Carry On
|
|
|
|
|
When you highlight text in a terminal it can usually then be copied by some keystrokes or menu option. That is fairly standard throughout Windows, MacOS and Linux. You can then paste it into another running application (e.g. the QT process that launched the terminal), but as far as I am aware you still need to do it manually. If you want direct connection between a calling and called process, then the called process needs to be a console type application. You can then connect the stdout of the called process to stdin of the caller, so the caller can read what the called process writes. The QProcess documentation explains how to do it.
|
|
|
|
|
I have no idea what you are trying to achieve, but is this even close:
Creating a Child Process with Redirected Input and Output - Win32 apps | Microsoft Learn[^]
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Message Closed
modified 15-May-23 19:06pm.
|
|
|
|
|
Message Closed
modified 15-May-23 19:06pm.
|
|
|
|
|
Do you need to wrap bluetoothctl in an xterm for some reason, can you not just call QProcess with bluetoothctl as the program to execute?
Keep Calm and Carry On
|
|
|
|
|
Message Closed
modified 15-May-23 19:06pm.
|
|
|
|
|
|
Message Closed
modified 15-May-23 19:06pm.
|
|
|
|
|
Member 14968771 wrote: do not get so huffy. There's only one person here who gets huffy.
The main problem with your question is that it is far from clear exactly what you are trying to do, or why you are using QT. If you merely want to capture the output of some command, then running it in xterm is not a good choice. But since the reason for xterm was not clear I did not originally question it. However, I did point out that connecting processes via stdin, stdout is something that has been around since the early days of Linux/Windows, and is actually fully supported by QProcess.
|
|
|
|
|
Message Closed
modified 15-May-23 19:06pm.
|
|
|
|
|
Member 14968771 wrote: you are avoiding to provide a solution. Yes, mainly because I still do not really understand what you are trying to achieve. But, hey ho, that seems to be par for the course with your questions.
|
|
|
|