I need to refresh html in wxHtmlWindow sometimes. But when I set html for the second time - my apllication crashed without any error.
code is here
What is this and how to avoid crashing?
EDIT: After some experimenting i found that code work well
void MessagesViewer::ShowMessages()
{
wxString html2 = "TEST";
m_pHtml->SetPage(thml2);
//this->Show(true);
}
But when i uncomment line with Show - app starts crashing on 2d time I call this function.
Your stack trace shows that m_pHtml pointer is invalid. It's impossible to say why exactly does it happen from the code you show here.
Related
In my app code I have a situation where I want an Exception to be fully printed out with the stack trace and everything.
In my testing code for this situation, when I deliberately doThrow(), to test the handling of this Exception, I want still to log to error, but without the stack trace, partly to prevent cluttering the log, partly to prevent the testing code wasting time printing a stack trace I have no need of.
Is there a way I can do this in my logback-test.xml?
Well, I did find a workaround... but it's not for TDD purists.
In my app class under test (it could actually be some utility class and then be used by any app class) I put this:
private boolean printErrorStackTrace = true;
void setPrintErrorStackTrace( boolean doPrint ){
printErrorStackTrace = doPrint;
}
Again in the app class I changed the LOGGER line from this
LOGGER.error(String.format("file was %s", documentFile), e);
to this:
LOGGER.error(String.format("file was %s", documentFile),
printErrorStackTrace? e : null );
And then in my test method I put this:
appClass.setPrintErrorStackTrace( false );
... obviously we're told not to allow testing code to reach into app code ... but of course I could instead have use a method getPrintErrorStackTrace() in the condition clause... and then mocked that method in the testing code. But would that have been any less heretical? We're also told not to add functionality just to help testing.
But my log now looks a lot cleaner...
I have found out my issue on the device not working and simulator working.
When i comment out this part, it works:
[OpenFeint initializeWithProductKey:#"MYKEY" andSecret:#"MYSECRET" andDisplayName:#"LatinToGo" andSettings:settings andDelegates:[OFDelegatesContainer containerWithOpenFeintDelegate:self]];
So it looks like this:
//[OpenFeint initializeWithProductKey:#"MYKEY" andSecret:#"MYSECRET" andDisplayName:#"LatinToGo" andSettings:settings andDelegates:[OFDelegatesContainer containerWithOpenFeintDelegate:self]];
it works perfectly when I comment out that part above, but when I click the open feint button, I get this error:
EXC_BAD_ACCESS.
I replace My key with my app Key in open feint and my secret with my app's secret code.
When I click the open feint button, it goes to a file and highlights this part in GREEN:
[inv invoke]; EXC_BAD_ACCESS
Then in my console when i Step into:
2012-04-28 08:53:12.076 BalloonsPop[500:707] Application windows are expected to have a root view controller at the end of application launch
Single stepping until exit from function +[OpenFeint(Private) launchDashboardWithDelegate:tabControllerName:andControllers:],
which has no line number information.
warning: Remote failure reply: E37
Any Suggestions to try?
Thanks A lot!
I am not sure if you do, but I would declare it like this:
OpenFeint *openfeint = [OpenFeint initializeWithProductKey:#"MYKEY"
andSecret:#"MYSECRET" andDisplayName:#"LatinToGo" andSettings:settings
andDelegates:[OFDelegatesContainer containerWithOpenFeintDelegate:self]];
I hope this helps.
The javascript console keeps showing "Not a custom field name: username" when its supposed to show an error for the username field. There clearly is a field named "username". I tried changing it to some other name everywhere, but it still didn't work.
Any idea what is going on?
<fb:registration redirect-uri="<?=$pageurl?>"
fields="[{'name':'name'},{'name':'email'},{'name':'location'},{'name':'username','description':'Username','type':'text'},{'name':'password','view':'not_prefilled'},{'name':'captcha','view':'not_prefilled'}]"
onvalidate="validate" width="400"></fb:registration>
and my validate function...
function validate(form,cb)
{
console.dir(form);
$.get('/api/?f=user_email_present&username='+form.username+"&email="+form.email,function(data){
console.log(data);
if(data.username==false)
{
cb();
}
else
{
if(data.username=='username')
cb({username: 'That username is already taken. Please try another username.'});
else if(data.username=='usernamelength')
cb({username: 'The username cannot exceed 20 characters in length.'});
}
});
}
I can't be too sure, but I think I remember all this working a while back. Took me by complete shock when we are 2 days from launch.
Update: I scrapped out asynchronous validation and used the other validation. It still throws the same error!
After spending the better part of two days, I managed to figure out what is going on. It is a silly but potent bug on facebook's end. If the width of the widget is too less, it gives this error. Increasing the width to 800px fixed it promptly. Probably they don't render the proper error fields when the width is too small.
I have filed a bug report: https://github.com/facebook/connect-js/issues/275
If you guys can give it a shot and comment on my bug report so that they can take action immediately, it would be awesome.
I'm using Symbian C++ to create my code, I'm using S60 5th Ed SDK
I want to know how to send different messages - Their body text not the same - to multiple recipients in a for-loop ?
I've tried the example below, but when I try to use it in a loop it crashes due to ActiveObjects properties, as I should wait to AO to finish before calling it again.
Sending_SMS_in_S60_3rd_Edition_MTM
Below is example of what I need to do:
SendSMSL(); // **I call this function once to start the process**
// **iRecepients is a CDesCArray contains phone numbers**
// ** iSMSBody is a CDesCArray contains each contact SMS body text**
void CSMS::SendSMSL()
{
if(iRecepients->Count() >= 1)
{
TInt x = iRecepients->Count()-1;
TInt y = iSMSBody->Count()-1;
// **If the sms validating and scheduling succeeded then delete last item from both arrays**
if(iSMSHandler->SendL((*iRecepients)[x],(*iSMSBody)[y])
{
iRecepients->Delete(x);
iSMSBody->Delete(y);
}
}
}
Now, in the code above I call iSMSHandler->SendL() which send sms using AO, and in iSMSHandler object RunL() function, I call back the function above CSMS::SendSMSL() , which in turn checks if there is still anymore iRecepients elements and then call again iSMSHandler->SendL() AO , and keeps this way till no more iRecepients.
Looking forward to hear your feedback on the modification above.
Many thanks in advance.
The link you posted doesn't work for me so I can't see the rest of the code.
Assuming that iSmsHandler is a class that uses active objects to send SMS messages,
I see several issues with your loop.
1) You need to wait for the first asynchronous SendL to complete before you can issue the next SendL
2) The buf variable can not go out of scope until the SendL completes. (This may be the reason for your crash)
I suggest that you keep the textbuffer somewhere else, like together with iSmsHandler, and then code the active object that is called when SendL completes to issue the next SendL.
All of this is guesses since I have no idea what class iSmsHandler is....
I'm trying to use SPWeb.GetListItem() to get an item by a known URL (MSDN).
So basically I'm doing the following:
using (SPSite spSite = SPContext.Current.Site)
{
using (SPWeb spWeb = spSite.RootWeb)
{
SPListItem spListItem = spWeb.GetListItem
("/sites/testSite/Lists/testList/Folder/Subfolder");
}
}
in case you are wondering, I'm trying to get the folder "Subfolder" to do stuff with it.
The problem is that the first time I call this, I get a COMExpeption:
Cannot complete this action.
Please try
again.<nativehr>0x80004005</nativehr><nativestack></nativestack>
Description: An unhandled exception
occurred during the execution of the
current web request. Please review the
stack trace for more information about
the error and where it originated in
the code.
Exception Details:
System.Runtime.InteropServices.COMException:
Cannot complete this action.
There are some reports about the COMException happening because you need to use the full relative site URL, so instead of /Lists/testList/Folder/SubFolder, you need to use /sites/testSite/Lists/... - I'm doing just that. I also tried using the absolute URL (http://sharepoint/sites/...). The problem remains: I get the COMException when trying to get the spListItem for the first time.
When I try to run the code again after the Exception, the SPListItem is received just fine. Also all subsequent calls work - only the first one fails.
AmI doing some initializing wrong or something like that?
Perhaps try SPWeb.GetFolder() instead... but again it depends on what exactly you want to do with the Folder. Seems strange though that you're using a method used for getting list items on a Folder.
http://msdn.microsoft.com/en-us/library/ms461547.aspx
Try to instantiate the web where the list item is located - _uiserWeb.
I tryed Site.RootWeb.GetListItem(item_url) - it gave me null first time after code redeployment and was fine second time.
_item = _userWeb.GetListItem(item_url)