The following EndDraw() function returns an HRESULT error code:
http://msdn.microsoft.com/en-us/library/windows/desktop/dd371924%28v=vs.85%29.aspx
The documentation specifies:
If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code and sets tag1 and tag2 to the tags that were active when the error occurred.
...and then returns an HRESULT indicating the success of the operations...
I am getting a return value of -2003238911 (0x88990001) which doesn't appear on Microsoft's "Common HRESULT values" page:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa378137%28v=vs.85%29.aspx
I have also searched for the error code in WinError.h but can't find it there either. If it returns this code, there must be a way to find out what it means.
How do I interpret this error code to find out what went wrong?
You use the Google, on which the top result for that hex code has this:
D2DERR_WRONG_STATE
0x88990001
The object was not in the correct state to process the method.
http://msdn.microsoft.com/en-us/library/windows/desktop/dd370979(v=vs.85).aspx
I don't know the first thing about graphics programming or Windows programming, but I think this answers your question, combined with the docs stating that the tag values will be given back to you referring to the point where the error occurred.
Last but not least..
I got the same error, till i realized that i wasn't calling ID2D1HwndRenderTarget::BeginDraw() first in order to prepare the render target for draw calls.
(I just created an account to vote up the answer by Loul G. but I don't have permission to vote yet...)
I have had this same issue...
When BeginDraw() and EndDraw() are called out of order you can get HRESULT: 0X88990001
Trace back to see the order in which they are called.
Also, to help protect against this you can surround BeginDraw(), EndDraw() calls like:
bool beginCalled;
int beginCount;//for debugging
int endCount;//for debugging
//initialize variables somewhere...
void begin(){
rendTarget>BeginDraw();
beginCalled = true;
beginCount++;
}
void end(){
if(beginCalled){
rendTarget->EndDraw();
beginCalled = false;
}
endCount++;
}
//print counts as necessary for debugging
Related
So I have an "assertion failed" error message when I want to run my program. I understand that it means that somewhere a condition that should be true isn't but I don't know how to correct that.
The error concerns the following line :
_AFXWIN_INLINE BOOL CEdit::SetReadOnly(BOOL bReadOnly)
{ ASSERT(::IsWindow(m_hind)); return (BOOL)::SendMessage(m_hWnd, EM_SETREADONLY, bReadOnly, 0L); }
So I get that it's about the "Read Only" condition, but I don't know where to correct that.
I am new in C++, so sorry if I forgot to put important information in my question.
Thanks in advance!
The OnInitDialog function contains a call to the base class function
CDialog::OnInitDialog();
Move your calls to SetReadOnly to after that line. The edit control variables are only initialized after that line.
Thank you for your help! Finally, after going through the whole code line by line, I realized in DoDataExchange I mixed up and put twice the same variable at some point instead of two different ones ... So I don't really know how that got me that error but I thought I'd keep you updated in case someone makes the same absent-minded mistake and gets that error :)
I am calling a stored procedure with cfscript, but when I add the addProcResult method to the call, ColdFusion returns the error The specified key, result, does not exist in the structure. Removing the method fixes the error and doesn't effect the results, but I still would like to know why the error appeared. Using <cfstoredproc> and <cfprocparam> doesn't generate the error. I am running CF9. My code is below.
spService = new storedProc();
spService.setDatasource("mydb");
spService.setProcedure("someSP");
spService.setUsername("TaskRunner");
spService.setPassword("password");
spService.addProcResult(name="result",resultset=1);
spService.execute();
You'll get this error if your stored procedure actually doesn't return a resultset (perhaps it returns an output parameter--or nothing at all).
Simply remove the call to .addProcResult(), and you'll be fine.
Well, it's been several hours I'm lost...
IXSLTemplate::putref_stylesheet doesn't document any error except E_FAIL.
However in my case putref_stylesheet returns E_INVALIDARG. GetErrorInfo() is only redundant telling me that the "Argument is invalid". So I am not left with much information.
However my code is pretty close to all examples I found on the web and msdn.
And it does something like:
void xsltProcessing(MSXML2::IXMLDOMDocument* pXmlDoc, MSXML2::IXMLDOMDocument * pXslDoc)
{
IXSLTemplatePtr pTemplate;
pTemplate.CreateInstance( _T( "Msxml2.XSLTemplate" ));
pTemplate->putref_stylesheet(pXslDoc);
//...
}
As there is not much documentation for putref_stylesheet. Do you have any idea what could go wrong for it to return E_INVALIDARG ?
My pXslDoc is a IXMLDOMDocument I have loaded from static const strings with success.
Any clue ? ( I guess it's pretty vague a question, but it's been hours I am searching )
Are you loading pXslDoc asynchronously perhaps?
The default behaviour for IXMLDOMDocument objects is to load asynchronously, so it is possible that the pXslDoc has not finished loading when you call putref_stylesheet().
Adding the following code before you load pXslDoc would fix this problem, if it is what you are suffering from:
pXslDoc->put_async(VARIANT_FALSE);
Hi I have just started using C++ today, and I am working on checkboxes. I have tried using CheckBox1->Checked in an if statement or whatever, but it isn't working.
The error is:
Error 2 error C2227: left of '->Checked' must point to class/struct/union/generic type
EDIT: The Code is:
void function ()
{
if (1001->Checked)
{
Sleep(2000);
}
}
Without seeing some of your code, it's very difficult to offer targeted assistance.
However, that error message usually comes about because the item you're de-referencing is not a pointer.
Check to ensure it's of the correct type. It should be something along the lines of:
tCheckBox *CheckBox1;
One possibility is that you've declared it not as a pointer to the checkbox but as a checkbox itself:
tCheckBox CheckBox1;
Note the lack of the asterisk there that would otherwise mark it as a pointer. In that case, you would use CheckBox1.Checked rather than CheckBox1->Checked, if it's allowed by the framework (this isn't standard C++ since that beast has no concept of GUI libraries).
If that doesn't help, please post the code so we can offer better suggestions.
Update:
if (1001->Checked) ?????
1001 is not a pointer - it's not a variable of any description, it's an integer constant.
You need to declare and use a variable of some description. First step is, I think, to read up on the documentation for your framework and/or get some sample code that does compile and work, basing your initial work of that.
Use CButton::GetCheck() to determine the state of the checkbox - like so...
CButton* pButton = (CButton*) GetDlgItem(IDC_CHECKBOX_RESOURCE_ID);
if ( BST_CHECKED == pButton->GetCheck() )
{
// button is checked
}
I am very new to SSL , Actually I would say I know nothing about it.
I am using the method "SSL_CTX_new" to create an SSL_CTX object. The method returns null.The documentation says I can check the error stack in order to get the cause for this.
So I have the function "int SSL_get_error(SSL *s,int ret_code)" which (as I understand) I have to use in order to get the error message. the documentation of the method says nothing about the first parameter of the function. It only says that the second ("ret") parameter should be equal to the return code from the failed operation which can be any of the following :
SSL_connect(), SSL_accept(), SSL_do_handshake(), SSL_read(), SSL_peek(), or SSL_write()
So now I am having two problems. The first is that I didn't use any of those functions but rather use SSL_CTX_new that doesn't return any kind of return code (it returns a pointer to SSX_CTX object) So i don't know what to put as the "ret" parameter. The second problem is that I don't know what does the first parameter mean and what should I put there , because the doc says nothing about it.
You need a valid context to create the SSL object.
Since you can't create a context you can't use SSL_get_error.
Try using ERR_print_errors to see what's gone wrong
#include "openssl/err.h"
...
SSL_CTX * ctx = SSL_CTX_new(....);
if(!ctx) {
ERR_print_errors_fp(stderr);
//throw or return an error
}
I just had a read of the SSL docs. If you need to programatically get the error code / error string you should use the ERR_get_error and ERR_error_string functions.
Have a look here and here
As per http://www.mail-archive.com/openssl-users#openssl.org/msg51543.html, you may be missing a call to SSL_library_init(). Adding this before the SSL_CTX_NEW(..) call fixed the NULL value problem for me.