|
Hi,
I'm using smart pointers in MSXML to retrieve nodes from a xml doc. I want to check the value of an attribute of an element using the value () fucntion. But, it returns _variant_t , how to convert it to CString so that I can compare with string?
Also, can anybody provide me with api of Smart pointers in msxml? because they are not available in msdn and are very different from normal api.
Please help
|
|
|
|
|
CString str;<br />
_variant_t v;<br />
str = V_BSTR(&v);
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Thanks Sir. can you tell me where I can get the api of smart pointer?
Ans. 5
|
|
|
|
|
Been a little while since I did this, but I think you do the following:
MSXML2::IXMLDOMElementPtr iNode = iNodeList->Getitem(iRow);
CString csVal = iNode->getAttribute("AttrName").bstrVal;
|
|
|
|
|
|
Hi, i'd searched around the forums, read many posts and also the articles in CodeGuru.com, Codeproject.com... and still find myself big trouble to Create a 24 Bit bitmap from scratch datas...
ok, i have a set of datas... and i wanto make a 24Bit Bitmap from the datas..
COLORREF RawPixelData[400];
BYTE RawData[1200];
<color=green> //example of my datas
RawData[0]=1111 1111;
RawData[1]=1111 0000;
RawData[2]=1100 0011;
: :
: :
: :
RawData[1199]=1111 1111;
<color=green>//my RGB datas
RawPixelData[0]=RGB(RawData[0],RawData[1],RawData[2]);
RawPixelData[1]=RGB(RawData[3],RawData[4],RawData[5]);
RawPixelData[2]=RGB(RawData[6],RawData[7],RawData[8]);
: :
: :
: :
RawPixelData[399]=RGB(RawData[1197],RawData[1198],RawData[1199]);
thats the datas of every pixels... that i'd made them ready to build a 24Bit BITMAP...
so, i learned from the tutorial written by Alex Salta - Creating Color Bitmap From Scratch..
<url=http: www.codeguru.com="" bitmap="" createdibsection.html="">http://www.codeguru.com/bitmap/CreateDIBSection.html
HDC dc= CreateCompatibleDC(NULL);
BITMAPINFO i;
ZeroMemory( &i.bmiHeader, <color=blue>sizeof (BITMAPINFOHEADER) );
i.bmiHeader.biWidth=5; <color=green> // Set size you need
i.bmiHeader.biHeight=5; <color=green> // Set size you need i.bmiHeader.biPlanes=1;
i.bmiHeader.biBitCount=24; <color=green> // Can be 8, 16, 32 bpp or <color=green> // other number
i.bmiHeader.biSizeImage=0;
i.bmiHeader.biSize=<color=blue>sizeof (BITMAPINFOHEADER);
i.bmiHeader.biClrUsed= 0;
i.bmiHeader.biClrImportant= 0;
VOID *pvBits;
HBITMAP hbmp= CreateDIBSection( dc,
&i,
DIB_RGB_COLORS,
&pvBits,
NULL,
0 );
<color=green> // You don't have to use 'pvBits', later DeleteObject(hbmp)
<color=green> // will free this bit array.
ok..those are the codes from the tutorial... some part i couldn't understand at all...the part i bolded them..can anyone teach me what those codes do???
also..where do i assign my RawPixelData[] into the BITMAP??
and how to save the BITMAP??
Its urgent..i hope you guys can help. I'd searched around but do not have any answers...
thanks
Thong
[email]twh81@tm.net.my[/email]
...
|
|
|
|
|
...inside the function SetBitmap !
CSkinProgress contains alotsa bitmap tricks and hints, good for newbies and educational purposes also !
http://www.codeproject.com/miscctrl/CSkinProgress.asp
Kochise
In Code we trust !
|
|
|
|
|
In VC6, you can modify the autoexp.dat file and add a section called [ExecutionControl]. Within that section you can tell the debugger about functions that you don't want it to step into; CString::CString=NoStepInto. Is this supported in VC7? It doesn't seem to be supported the same way as VC6, but perhaps there is another way to get the same result.
Thanks
Ron Ward
|
|
|
|
|
yes, it is, but it's moved to registry.
referring to same maillist:
We read the inclusion/exclusion list from the registry at
PRODUCT_ROOT\NativeDE\StepOver
Each string value in that RegKey should have a decimal number for its name
and a
value in the following format:
RegExp=[No]StepInto
Where RegExp is a regular expression per the standard Visual Studio
regular
expression format, with the following additional escapes:
\cid: A C/C++ identifier
\funct: A C/C++ function name
\scope: A set of class/namespace specifiers for a function (i.e.,
ATL::CFoo::CBar:
\anything: any string
\oper: a C/C++ operator
Due to an oversight, the items are evaluated in descending numeric
order instead of ascending order: the '20' rule will match before
'10'. The first matching rule is used. If no matching rule is
found, we step into. (i.e., there is an assumed entry of
MAX_INT \anything:=StepInto
examples:
---------
Don't step into members of CString[AWT], etc.:
1 \scope:CString.*\:\:.*=NoStepInto
Don't step into overloaded operators:
10 \scope:operator\oper:=NoStepInto
Don't step into ATL:: except for CComBSTR's non-operator members:
20 ATL\:\:CComBSTR::\funct:=StepInto
10 ATL\:\:.*=NoStepInfo
Don't step into templated things, unless they're merely templated
functions in a non-templated class:
20 \scope:\funct:=StepInto
10 .*[\<\>].*=NoStepInto
|
|
|
|
|
Thanks much for the information. I'm not having luck getting this to work though. I'm assuming I'm at the wrong key in the registry. Is PRODUCT_ROOT = HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.0?
Should this exported key work?
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.0\NativeDE\StepOver]
"1"="\\scope:CString.*\\:\\:.*=NoStepInto"
Thanks again for all the information though.
-Ron Ward
|
|
|
|
|
it's user specific, so it is:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\7.0\NativeDE\StepOver
Hope this one will work (didn't tried it yet)
|
|
|
|
|
Worked perfectly. Thanks a ton.
-Ron
|
|
|
|
|
Hi
I have no idea how to change the initial size of a window. I created the MFC AppWizard based on single document, and the class *View (in the last frame before the project is created) is based on the class CFormView. Can somebody help?
Thanks.
Ruben
rubencmos@hotmail.com
|
|
|
|
|
One solution is MoveWindow(). Another solution is SetWindowPos().
Kuphryn
|
|
|
|
|
Thanks. I tried the SetWindowPos and get errors, the program is not able to start. where should I put these lines?
I made a member variable in *View class:
CEdit m_Size;
then in the constructor:
m_Size.SetWindowPos(this,0,0,640,480,SWP_SHOWWINDOW)
Also tried the with SetScrollSizes(MM_TEXT, Size);
where Size is CSize;
but that didn't makes nothing.
Thanks
|
|
|
|
|
Place it in OnInitUpdate().
Kuphryn
|
|
|
|
|
Do it in OnInitialUpdate().
Kuphryn
|
|
|
|
|
void CMainFrame::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
{
lpMMI->ptMaxSize.x = 640;
lpMMI->ptMaxSize.y = 480;
lpMMI->ptMinTrackSize.x = 640;
lpMMI->ptMinTrackSize.y = 480;
CFrameWnd::OnGetMinMaxInfo(lpMMI);
}
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I want my mouse move only in my window. Please tell me How I could do? And more, how could set the mouse position? Get distants although my mouse reach the limit of screen?
[IMG]http://sinhvienufa.vietnam-it.com/forums/html/avatars/dethuong/Avatar7A1F.gif[/IMG]
|
|
|
|
|
One solution is to keep track of the pointer coordinate. If it is outside the program's boundaries, then reposition it.
Kuphryn
|
|
|
|
|
Just my opinion but...
bad bad bad move. Your application doesn't own the mouse. You shouldn't be restricting mouse movements only to your window. Any application that did that on my system would be immediately removed, forever.
Rob Manderson
http://www.mindprobes.net
You have an eight-ball and Tommy wants to buy two grams. You bought the eight-ball with a quarter-bag of grass, two reds, a six-pack of Old Milwaukie, and $4 in change. You want a profit margin of 35%. How much hash should you get from Tommy for your blow? - Roger Wright
|
|
|
|
|
|
ICE_WIZARD wrote:
I want my mouse move only in my window. Please tell me How I could do?
There is ClipCursor() , but it doesn't give you absolute total control over the cursor. The cursor is a shared resource and the user is in control of it, so if he Alt+Tabs to some other window, your ClipCursor() coordinates are discarded.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
CP SearchBar v2.0.2 released
|
|
|
|
|
Normally it is a bad idea to limit the mouse pointer to an area of the screen. But if you do need to do it, the API call ClipCursor(Rect) can set a liit area and the call ClipCursor(NULL) restores movement to the whole screen. Be careful with these!
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
Well, the title must explain my great problem
I installed some data on a Storage Card (256 MB SD Card) and try to manage to get the size and the free space of this SD Card from a desktop computer ! I already use CeFindFirstFile with the name of the Storage Card, check if it is really a storage card if CE_FIND_DATA.dwFileAttributes & (FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_TEMPORARY) != 0 , but CeGetStoreInformation just return me the size and free space from the data area of the main memory. Typically, on my 64 MB iPAQ, 40 MB is reserved for the datas, and 20 MB for the programs. CeGetStoreInformation return me 40 MB and 5 MB free (current config)
My SD Card is 256 MB and have 20 MB free ! Is there a function to use through RAPI to know that, giving the storage card's name as parameter ? For instance BOOL CeGetVolumeSpace(DWORD &o_pnSizeVolume, DWORD &o_pnSizeVolumeFree, CString const& i_poStrStorageCardName); !
VERY URGENT AND IMPORTANT, sorry...
Kochise
In Code we trust !
|
|
|
|