|
My Comp. Sci. proffessor told me to use the "hard-wired" operators. I'm assuming he'd know, since he's been teaching the microprocessor and assembly lang. classes as long as I've been at the school (22 years and counting to finish my BS). Anyhow, he wants us to do these bit-wise & and | functions as fast as possible for this huge natural language processor project. The idea is, if the compiler makes use of assembly fucntions that are using registers to access the hard-wired logic operations inherant in the micro processor, they'll be faster.
Does that shed any more light on the question?
So... know anything about boolean vectors? That's my other question. He wants us to use bit vectors -- and the only thing I can find is "bitset" in the template library.
Mark.
Mark Malin
(00==[||]==00)
|
|
|
|
|
Sorry for my bad English, I'm Austrian.
I've programming a "Test"-Project, which contains a ColorButton/ColorPopup. I've downloaded 4 files (ColorButton.cpp/h and ColourPopup.cpp/h) and implanted into my Project "ColorFeld" (=German, it means in English "ColorField")
The Project works perfectly, BUT I've added an Editbutton. It should show the currently Code of ColorButton. There is are any Errors:
C:\Programme\Microsoft Visual Studio\MyProjects\ColorFeld\ColorButton.cpp(90) : error C2653: 'CColorFeldDlg' : Keine Klasse oder Namespace
C:\Programme\Microsoft Visual Studio\MyProjects\ColorFeld\ColorButton.cpp(90) : error C2065: 'm_showcolor' : nichtdeklarierter Bezeichner
Keine Klasse oder Namespace = No Class or Namespace
nichtdeklarierter Bezeichner = not declared Variable
... I've experimented with "CColorFeldDlg::m_showcolor = m_Color;" ... No idea!
Can anybody help me, please? - I'm a beginner!
You can download my Sourcecode here: http://www.xorsystem.info/ColorField.zip
THANKS!!!!
|
|
|
|
|
If I understood your code well, you're doing basic errors about inheritance in C++ and the parent-child relation between a dialog and one of its controls.
When you write
CColorFeldDlg::m_showcolor = m_Color you seem to imply that you can access the members of the parent CColorFeldDlg by means of the notation CColorFeldDlg:: . This is wrong. Inheritance is not a container/contained relationship. You can think of inheritance as an IS-A relationshpip. For instance
class Person
{
...
};
class Woman:public Person
{
}; whereas what you have is more of a HAS-A relationship:
class Car
{
...
Wheel wheels[4];
}; If you got this right you more or less will see what you're doing wrong. In MFC, there are functions for retrieving the parent of a given control:
CColorFeldDlg *pParent = (CColorFeldDlg *)GetParent();
pParent->m_showcolor = m_Color; There's a bit I haven't explained here, namely the so called cast (CColorFeldDlg *) . An excellent introduction to the basics of C++ language if Marshall Cline's C++ FAQ lite[^]. If you have the tie to read it, I recommend you do it. Good luck.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
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
|
|
|
|
|