In my case, i need to create tabs dynamically. Lets say. When my application starts user will input a value between 1 to 10. Based on user input i need to create the tabs (no. of tabs).
later in each tab in need to display different images.
In this case, should i create my class which is inheriting from CTabView or CTabPane?
If i call AddView() and run my program, its working absolutely fine with a window and a view(tab).
But instead of calling AddView() initially, at runtime based on user input, i called addview() which leads to a crash. What could be the reason.
class View : public CScrollView
//below is my main classclass MyTabClass : public CTabView
//this function gets called automatically during creation of window.void OnCreate(LPCREATESTRUCT lpCreateStruct)
if (CTabView::OnCreate(lpCreateStruct) == -1)
AddView(RUNTIME_CLASS(View),_T("Sheet1")); //this works fine.
//this function i will call based on user input and hence its crashing during addView call.void RunTimeBasedOnUserInput()
for(int i = 0 ; i < userinput; i++)
I am serializing CMapStringToPtr object without any problem, key by key, pointer to pointer.
For this case, the key order it is matter.
So, if I archive this CMapStringToPtr object, and de-archive on the same machine, the key order are fine. But, if I de-archive this object on other machine, the key order are not the same, and this is a PROBLEM. How can avoid this issue ?
Yes, I could serialize another CStringArray with the CMapStringToPtr keys, but I don't know if this a good idea ... can you tell me how to overcome this problem ?
MSXML::IXMLDOMDocumentPtr->load function, when I tried to load a file in which the path or file name contains Chinese characters, its not loading. Means, it fails to load the file into the document pointer and return false.
1. The binary representation of 2 is 10 and of 6 is 110. As the length of "10" is smaller, so add a '0' to it making it "100', to make the length of binary representations equal. XOR of 100 and 110 gives 010 which is 2.
You can get the length of each value (remember to save the originals) by repeatedly shifting one bit right until it is zero. You then shift the smaller value left by the difference between their lengths. That will give you two integers of the same length. All you need then is to create the XOR of the two and print it out.
unsignedint myxor(unsignedint a, unsignedint b)
if ( a < b) swap(a,b);
// now a >= b
int lab = 0; // difference of a and b binary length
int ca = a;
int cb = b;
while ( ca )
if ( cb == 0 )
ca >>= 1;
cb >>= 1;
return ( a ^ (b << lab));
In the C/C++ code below debugptr comes up as null however when I go into Disassembly the value return in register rax from __imp_Cwnd::FromHandle is correct as I place an eyecatcher "Debug" in CprogDebug and when I go to look at that memory address I can see that literal in the memory
more so when I got to rsi + 118h the value of the rax register is there
When I do a quickwatch in VS on Debugptr its NULL
BTW I do a get an exception utilizing debugptr as a pointer