|
In properties on my MSFlexGrid I have Selectionmode by row.
But why is not the entire row highlighted when I click in the grid. The first colomn in the row is never highlightened, but the rest is highlightened.
|
|
|
|
|
Check that you have the property FocusRect to none, if not, the grid won't highlight the cell with the focus
|
|
|
|
|
void CExFormViewView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
CClientDC dc(this);
CPen pen, *oldpen;
pen.CreatePen(PS_SOLID, 1, RGB(255, 0, 0));
oldpen = dc.SelectObject(&pen);
dc.MoveTo(0, 0);
dc.LineTo(220, 100);
dc.SelectObject(oldpen);
}
The problem is to be not run the code above, at running for the first time.
The program is made to formview-based.
Help !!
|
|
|
|
|
Sorry if anyone feels I'm posting in the wrong forum, but this question did not really fit in in any of the others.
My problem is that I can't get the insertBefore method to work when adding new elements/nodes to my xml document.
This is my xml document:
<?xml version="1.0" encoding="ISO-8859-1"?>
<names>
<name>Flanders, Ned</name>
<name>Gumble, Barney</name>
<name>Skinner, Seymour</name>
</names>
Now I would like to do a insert with a new name "Simpson, Homer" so that it is placed before "Skinner, Seymour".
According to the MSDN specification the insertBefore method takes two arguments: newChild and refChild. But what confuses me is that refChild is supposed to be a variant, and not just a node pointer. I've tried different approaches but I've only managed to insert the new name at the end of the list.
Does anyone have some code samples using insertBefore in VC++? I would be very grateful. I've been looking for examples everywhere but found none that helps me.
Thanks!
|
|
|
|
|
Jimmy,
I use the following code to do this:
_variant_t varBeforeNode(pBeforeNode.GetInterfacePtr(), false);
pParentNode->insertBefore(pNewNode, varBeforeNode);
This also works if you pass 0 as pBeforeNode, in which case
the element is appended to the end of the list.
Alwin Beukers
|
|
|
|
|
Thanks for your help.
The problem was that I did not know what to initiate the second parameter (varBeforeNode) with. After a lot of experimenting I found that it worked if I created a VARIANT and initiated it with the node pointer and set the variant type to unknown. Like this:
VARIANT var;
var.byref = myNodePtr;
var.vt = VT_UNKNOWN;
parentNodePtr->insertBefore(pNewNode, var);
I figured this out just a few minutes ago and hopefully this example will help others save some time. If anyone's looking for an example I could send you some code. Just drop me a line.
|
|
|
|
|
Hi all,
Can anyone learn to me Visual C++ tools for debuging ? about watch windows and ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Just so long as you stop asking questions that have short answers (that's a joke BTW)
First and foremost I recomend the book 'Debugging Windows' by Robbins ( can't see the first name from here ). As to the basics, you need to hit F5 in debug build to start debugging. You set breakpoints by hitting F9, and when the code reaches one it will stop and enter the debugger. You can type variable names into the watch window to see their contents, hit F10 to step through lines and F11 to step into them. In other words, F10 will execute a function and move to the next line, F11 steps into the function line by line.
What else would you like to know ?
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Hi,
With CHTML view is it possible to get it to show the IE Toolbar and menu bar. There is member functions like, SetToolbar, and menu bar. But can't seem to get it to work, when create a simple MDI MFC appwizzard application.
Thanks again
Richard
|
|
|
|
|
CHtmlView is a MFC wrapper over WebBrowser control. You can call CHtmlView::SetMenuBar or CHtmlView::SetToolBar, but these calls will be ignored.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi,
I am having trouble viewing my variables in watch window from debug mode.
when i insert a break point and try to view _b_str
varaible it is being displayed only partialy followed by some integer:
for example string like this:
SELECT * FROM my_table where when_closed = -1 AND job_id = 1386
will appear like:
SELECT * FROM my_table where when_closed (1)
How can I view the whole string?
thank you
|
|
|
|
|
_bstr_t uses reference counting, that's why (1) is displayed. I have no idea why string is partially displayed - are you absolutely sure that your string contains "job_id = 1386"? On my workstation there's no such effect; I can see complete string.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thank you for replaying.
I am sure that string contains job_id = 1386 and much more. In many places where i try to see value of variables of type _bstr_t whenever it is getting long I can only see part of it in watch window.
someone suggested to check option in tools/options/debug unicode string and now i am getting a little more but still some part is missing.
example (the one i described earlier but with unicode string check out)
_bstr_t str : result in watch window (incomplete string)
{"SELECT * from Main_view where (job_id = 1636 OR project_id = 1636)AND ( ( person_1 = 'Baniewicz Małgorzata' ) OR (person_1 = " (1)}
_bstr_t str1 : result in watch window (complete string)
{"AND ( ( person_1 = 'Baniewicz Małgorzata' ) OR (person_1 = 'Bauer Piotr' ) OR (person_1 = 'Bejm Maciej' ))"}
str should have all str1 in itself (program is working correctly, but watch still does not display some part - in str's (1) place should be: 'Bauer Piotr' ) OR (person_1 = 'Bejm Maciej' ))"} - the end of str1, but it does not appear.
do not know why ?
|
|
|
|
|
This doesn't happen on my VC6 SP5. Watch, QuickWatch and Locals always display full string. Maybe you have a null character somewhere inside _bstr_t?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I am also using VC++ 6.0 SP5.
I do not think that NULL characters might be a reason - I do not have such in my string and the place where string is suddenly dropped happens at random depending only on the lenght of bstr_t
|
|
|
|
|
What is "shell" (in Windows)?
Thanks.
Maer
|
|
|
|
|
From Platform SDK docs:
The Microsoft® Windows® user interface (UI) gives users access to a wide variety of objects necessary for running applications and managing the operating system. The most numerous and familiar of these objects are the folders and files that reside on computer disk drives. There are also a number of virtual objects that allow the user to do tasks, such as send files to remote printers or access the Recycle Bin.
The shell organizes these objects into a hierarchical structure called the namespace, which provides users and applications with a consistent and efficient way to access and manage objects. Users interact with the namespace through the shell's graphical UI or through an application. Applications interact with the namespace through the shell's application programming interface
You'll find complete info in your VC++ help: go to Contents, then Platform SDK/User Interface Services/Windows Shell.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thanks my pal.
I have read the articles you introduced to me. It helps a lot. I have known the function of the "shell".
But I still have a question. I can not find the exact definition of "shell". I am now in a puzzled state. Like the air we breathe, we just know the function and do not know the exact definition of the term.
Can you explain the definition of the "shell"?
Thank again.
Best regards.
Maer
|
|
|
|
|
Can you explain the definition of the "shell"?
In short, this is a program you're using to communicate with operating system. In the case of 32-bit Windows, this program is named explorer.exe.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thanks pal.
You help a lot
Maer
|
|
|
|
|
Use WM_CTLCOLOR:
HBRUSH CMyView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CFormView::OnCtlColor(pDC, pWnd, nCtlColor);
if(nCtlColor == CTLCOLOR_EDIT)
pDC->SetTextColor(RGB(0,0,255));
return hbr;
}
|
|
|
|
|
If I open a workspace in a MIcrosoft Visual studio it's not showing the class
view??What can be the problem..
How I can see the class view in MSDEV..
|
|
|
|
|
Hi Srinu .
Get 'ALT+0' Keys.
Iman Ghasr-e-fakhri
|
|
|
|
|
Hi Srinu .
Get 'ALT+0' Keys.
Iman Ghasr-e-fakhri
|
|
|
|
|
Hi,
I am writing a independant logger class for which I need to write a log
with the application name.
Like if the applicaions name is "UserApp.exe" i need to write a log
file with the name "UserApp.log". The problem I have is i do not have access to the
command line.
Finding out a dll's file name is easy, we can use 'GetModuleFileName' but
it does not work with exes.
How can i find out the current applciations name from within the application ??
Thanks for any help
|
|
|
|