|
Message Closed
modified 15-May-23 19:07pm.
|
|
|
|
|
First, make sure you're creating a debug build. Whatever IDE you're using should have a Build or Compile config section, so take a look and make sure that's set. Your IDE should have a built in link to the debugger, so just run the program in the debugger. When the error is thrown, the debugger should stop the program and allow you to examine the state of the program. If you need to use the command line, here's an example to help you get started:
$ cat bad_alloc.cpp
int main()
{
size_t lim = 2;
while(true)
{
int *arr = new int[lim];
delete[] arr;
lim *= 2;
}
return 0;
}
$
$
$ g++ -m32 -ggdb bad_alloc.cpp -o bad_alloc
$
$ gdb bad_alloc
Reading symbols from bad_alloc...
(gdb) run
Starting program: /home/ebacon/tmp/c++/bad_alloc
terminate called after throwing an instance of 'std::bad_array_new_length'
what(): std::bad_array_new_length
Program received signal SIGABRT, Aborted.
0xf7fce559 in __kernel_vsyscall ()
Missing separate debuginfos, use: dnf debuginfo-install glibc-2.32-10.fc33.i686 libgcc-10.3.1-1.fc33.i686
(gdb)
(gdb) bt
(gdb)
(gdb)
(gdb) frame 8
8 int *arr = new int[lim];
(gdb)
(gdb)
(gdb) p lim
$1 = 536870912
(gdb) quit
A debugging session is active.
Inferior 1 [process 3076940] will be killed.
Quit anyway? (y or n) y
$
Hopefully, that's enough to get you started. If you need more, then Google is your friend.
Keep Calm and Carry On
|
|
|
|
|
Message Closed
modified 15-May-23 19:07pm.
|
|
|
|
|
The docs are pretty clear: QProcess Class | Qt Core 5.15.8 Try
QProcess::execute("hcitool", "-i chio scan --flush");
since hcitool is part of the bluez package, it almost certainly uses the bluez library to do its work. If you can get hold of the source code, you should be able to look through it and find out why they make it work the way you expect it to.
Keep Calm and Carry On
modified 18-Jan-22 17:58pm.
|
|
|
|
|
I am using WebView2 for displaying html contents in my win32 application. I have parent.html in which I am providing reference of child.html like -
<frameset id="myFrmset">
<frame id="myFrm" name="frmContent" src="child.html"></frame>
</frameset>
In child.html :
<button id="samplebutton" onclick="postmessagetocode()">clickhere</button>
<script>
function postmessagetocode() {
window.chrome.webview.postmessage('clickSample');
}
</script>
In my c++ code I am loading parent.htm and want to get above message 'clickSample' in
m_webView->add_WebMessageReceived .
Issue that I am facing : by doing like above I am not getting this message in code. If I post any message from parent.html then I can get it. But if I do like from child.html then it never come to c++ code.
Is there the way to do so?
Is it something like I need to catch the message at parent.html first then post again to c++?
Thanks.
|
|
|
|
|
I have three controls in my Modal Dialog there are EDITTEXT and the Variables I am using are CString
After the modal Dialog Box comes in my OnOk I do an UpdateData(TRUE) the data I enter is 2E000 however when it is returned between every character there is a Null so it would be in hex 32004500300030
this happens with all the varaible
thanks
|
|
|
|
|
One word. UNICODE
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
Have to change the settings in the VS property page ?
|
|
|
|
|
It depends what you are trying to do with the content of the string. The CString is using Unicode, so presumably, the entire application is also. And you cannot (easily) change one part of the application without affecting other elements.
|
|
|
|
|
|
Yes that will work fine, but you really need to consider why your application is using Unicode in the first place.
|
|
|
|
|
Richard
I have a lot of my pieces in place from my windows client debugger setting breakpoints stepping thru code I just created this project to finish off the last piece displaying modifying storage
As whenever I have to re-test in my development project I have to reinit my machine ( long story) don’t know how I unicode got set
Thanks for your help
|
|
|
|
|
ForNow wrote: don’t know how I unicode got set
It would appear that it is the default for new projects, at least in VS 2019.
|
|
|
|
|
I am trying to reference a member of Derived CDialog and am getting an intelligence error not defined it is #included in the file
when I copy the actual class and members to the source file it is able to reference them
seem like changes to my headers arent taking
thanks
|
|
|
|
|
It sounds like something is messed up in your project. Your source files should be dependent on all the associated headers, and if a header changes then the sources should be rebuilt. You need to look at the project settings for all the source files.
|
|
|
|
|
Richard you are right I copied a .cpp and .h from another project instead of instead of going to Add --> exiting item I guess I should delete and recopy ? I mean copy a copy to another directory and then delete and then do add -> resource item
thanks again
|
|
|
|
|
NO need to delete! Just Add the existing (file that you have already copied!)
|
|
|
|
|
that updates the project file thanks maybe I can try that for resource.h as well ?
|
|
|
|
|
Yes, you should ensure that all files are in the Project tree that is displayed in Visual Studio. If they are not included in the actual Project then Visual Studio will not be aware of them.
|
|
|
|
|
I think I’m going to do add—> existing items (.cpp and .h) in all my files that should update the project settings
Thanks
|
|
|
|
|
You only need to add the ones that are missing.
|
|
|
|
|
Does it hurt to do them all seems like it would refresh my project settings
Thanks
|
|
|
|
|
I am not sure what happens if you add one that is already included. Try it on a single file just to check.
|
|
|
|
|
If you attempt to add a file that already exists in the project, Visual Studio will simply ignore the command silently.
This means that you can select all the files in the folder to add, and Visual Studio will sort out which ones already exist in the project.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
That means I take my the .cpp that’s giving me issues copy it somewhere use to VS to remove / delete
Then paste back to the folder have VS add —> existing item ?
|
|
|
|