|
All
I have a situation where I want to use an environment variable in the path during linking with VC7.
A) is it possible to use environment variables in the path to your OutputFile in the linker options?
B) If so, what is the syntax to use an environment variable in the linkers OutputFile options.
Thanks for your time
Dave
|
|
|
|
|
Configuration Properties:
Output directory:$(PATH_OF_ENV_VAR)
Linker->$(OutDir)/$(ProjectName).exe
where PATH_OF_ENV_VAR is your env variable.
You may need to restart your machine.
similary you can use $(var) in other options also.
Hope these help.
Regards
Abhishake Lahare
|
|
|
|
|
Thanks Abhishake
I ended up finding it after some scowering of the documentation. The very important step is what you mentioned. The re-boot. You have to re-boot after setting a system environment variable. That held me up for about 20 mins too.
Thanks again
Dave
Programming is like cake, you start on one piece and you want eat the whole thing.
|
|
|
|
|
Greetings:
I have long been aware of how difficult working with property sheets can be, but whenever I get down to having to deal with one, it never fails to amaze me just how awful they truly are...
Anyway, I set out to make a property sheet where the pages can be re-ordered. Can't do that, I know, so I set out to make it so that if I wanted to insert a property page into the sheet that was NOT at the end, I would actually remove the pages AFTER the point where I wanted to insert the new page and then re-add the pages that were already there.
This worked fine until I tried to INSERT a new page at position ZERO. It seems that if I remove ALL of the pages from the sheet, the property sheet spontaneously commits suicide. Isn't that nice? Who at Microsoft thought that this would be a good idea? What is so wrong with a property sheet that is blank for a few microseconds before it is populated or repopulated?
Can anybody lend some advice here, if not sympathy would be accepted. I really need my property pages to be ordered in a certain way and I will have to insert new pages and also re-order existing ones.
Thanks in advance,
Mark, Toronto
|
|
|
|
|
Hi Again:
Shortly after sending off my rant, I realized that my delemma had a simple solution:
In any case of inserting a page, including in the ZERO position, add the new page first, then remove all of the pages that you want to have positioned AFTER the new page. Then just add them all back.
Adding the new page FIRST ensures that the property sheet is never naked.
That's my story.
Regards,
Mark
PS: I still think that property sheets are stupid...
|
|
|
|
|
I'm looking for a control that incorporates both CCheckListBox / CDragDropListBox. I've attempted to use CDragDropListBox code from this site (non OLE version) but I'm having some problems after moving a list item and attempting to "check" that item.
Thanks in advance
Tony Teveris
Gerber Scientific Products
Senior Software Engineer
Phone: 860 648 8151
Fax: 860 648 8214
83 Gerber Road West
South Windsor, CT 06074
|
|
|
|
|
Hi All,
I am facing high performance problem when working with CListCtrl with owner draw data and styles.
When i am inserting around 5000 records it takes more time. I want to avoid this delay. My idea is insert around 100 records initially and in background insert the remaining records. So user no need to wait till insert operation completes. Which is the best solution to solve this type problems.
Different ideas in my mind are
1) Use thread function to insert the data as background process
2) Insert the data into the list control when user scroll the list
3) Use the Peekmessage and Pump message instead of going for thread.
Please suggest me the solution/suggestion if any one faced like this problem.
Thanks.
Jerin
-- modified at 14:04 Tuesday 11th July, 2006
|
|
|
|
|
|
You could used a combination of 1) and
4) Use the List control in virtual mode. This makes use of the CListCtrl callback functions that request information about visible data only when needed.
I have used this technique in the past where a searching routine returns its result in a list control. A separate thread would do the searching, then post the result (or any other thread-safe method), back to the list control for populating. This is great, especially if you don't know the final number of items that will be shown in the control.
I Dream of Absolute Zero
|
|
|
|
|
I am high performance problem when working with CListCtrl with owner draw data and styles.
I cant change existing functionalites also using Virtual list control
Problem 1: Actully i am inserting 3000 records takes 2.11.This time only executing of insert statement.
Problem 2:
After inserted all the data if i scroll horizontal and vertical,grid lines is not refresing.if i use Invalidate i am getting flickering.
Please give me the solution/suggestion if any one faced like this problem.
Thanks.
PRABHUDURAI
|
|
|
|
|
prabhudurai wrote: I cant change existing functionalites also using Virtual list control
If you are prohibited from making changes, how can you be expected to solve the problem?
prabhudurai wrote: Problem 1: Actully i am inserting 3000 records
If you are using an owner-drawn control, there's no way to insert 3,000 items at a time. The control will only ask you about items that it is going to display (a few dozen at most).
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: If you are using an owner-drawn control, there's no way to insert 3,000 items at a time. The control will only ask you about items that it is going to display (a few dozen at most).
Owner-draw doesn't stop you from inserting items does it?
Seems to me I have done that.
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
Well, the LVM_SETITEMTEXT message cannot be used with the LVS_OWNERDATA style. Instead, you must respond to the LVN_GETDISPINFO notification and provide information needed to display the item.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
We may not be talking about the same thing. Here is what I tested with no handling of LVN_GETDISPINFO.
I have CMyListCtrl derived from CListCtrl and set the owner draw style and override DrawItem(). If you don't override DrawItem an Assert is thrown from CListCtrl::DrawItem() if Owner draw style is set.
Then I drop a CListCtrl onto a dialog and add a "control" member variable mapped to the ID of the List Control. Then I change the declaration of the member in the dialog class:
CMyListCtrl _list;
Then in the dialog OnInitDialog override I use InsertItem which I believe sends LVM_INSERTITEM message:
_list.InsertColumn(0, _T("Col One"));
_list.InsertColumn(1, _T("Col Two"));
_list.SetColumnWidth(0, 150);
_list.SetColumnWidth(1, 150);
CString sbuf;
for(int n=0; n<100; n++)
{
sbuf.Format(_T("Item %d"), n+1);
_list.InsertItem(n, sbuf);
sbuf.Format(_T("Item %d - 2"), n+1);
_list.SetItemText(n, 1, sbuf);
}
Notice there are two columns in the list but in my owner draw override I only draw the first one:
void CMyListCtrl::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
CDC* pDC = CDC::FromHandle( lpDrawItemStruct->hDC);
CString sbuf = GetItemText( lpDrawItemStruct->itemID, 0);
pDC->DrawText( sbuf, &lpDrawItemStruct->rcItem, DT_LEFT);
}
As expected the control displays only the first column of all 100 items. If I turn off the Owner Draw Style both columns draw as expected since the control is then drawing.
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
led mike wrote: We may not be talking about the same thing.
Apparently.
led mike wrote: _list.SetItemText(n, 1, sbuf);
I don't see how you could have done this as the assertion on line 494 of winctrl2.cpp would have fired. It asserts that SetItemText() cannot be used with the LVS_OWNERDATA style.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Ah now I get it.
prabhudurai wrote: when working with CListCtrl with owner draw data and styles.
Owner Draw and Owner Data are two different things, he posted both, I was talking about draw your were talking about data. Sorry for the confusion.
Oh I see from your first post you stated "owner-draw" as well not "owner data", that makes me feel a little better.
Last modified: Wednesday, July 12, 2006 9:34:40 AM --
|
|
|
|
|
led mike wrote: Owner Draw and Owner Data are two different things
I mistakingly used them interchangeably.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi all. could any one show me how i can get the html of a perticuler url and place that html inside a textbox/editbox for further manipulation. I have done such think in visual basic 6 but i do not know that can be done in visual c++ 6. I be happy if some one show me how i can achive that.Thanks
visual basic 6 method:
RichTextBox1.Text = Inet1.OpenURL(txtURL.Text, icString)
|
|
|
|
|
Do a search on MSDN for CHttpConnection. That will lead to several other classes that wrap the WinInet API for making HTTP requests.
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
method007 wrote: could any one show me how i can get the html of a perticuler url and place that html inside a textbox/editbox for further manipulation.
Have you considered URLDownloadToFile() ?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
man i am new to visual c++ .i be happy if u guys give me an example of how to use it. Just URLDownloadToFile() will not help me. You migh say msdn but that is not readable at all for starter.!! Furthermore, i do not want to download a url in file i just want to load its html code into a editbox for further process.
-- modified at 13:19 Tuesday 11th July, 2006
|
|
|
|
|
method007 wrote: Just URLDownloadToFile() will not help me.
Why not?
method007 wrote: You migh say msdn but that is not readable at all for starter.!!
Sure it is. I started using it some 15 years ago.
method007 wrote: Furthermore, i do not want to download a url in file i just want to load its html code into a editbox for further process.
This makes no sense. If you are wanting to edit the HTML, use URLDownloadToFile() . You can then plug the contents of the file into the edit control. Using the alternative IHTMLInterface would only complicate matters.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
my whole intention is to extract data from a html page so it would be easier to load the html instead of the file !! i have done this in visual basic 6 but i need to do it for a project that is visual c++ 6 and so far i just get unrleated answer and no example!!! i think this the nature of visual c++ programers unlicke visual basic programmers!!
|
|
|
|
|
method007 wrote: ...so far i just get unrleated answer and no example!!!
I've given you more than enough information to solve your problem. As a matter of fact, you've been given several solutions to the same problem. That's very gratuitous in my book.
This retrieves all of the <FONT> elements:
IDispatch pDisp2 = m_ctrlBrowser.GetDocument();
pDisp2->QueryInterface(IID_IHTMLDocument2, (void **) &ptrHTMLDocument);
BSTR pBURL = SysAllocStringByteLen(NULL, 1024);<br />
ptrHTMLDocument->get_URL(&pBURL);<br />
ptrHTMLDocument->get_all(&ptrHTMLElements);
ptrHTMLElements->get_length(&lElements);
VARIANT varName;<br />
varName.vt = VT_BYREF | VT_I1;<br />
varName.pcVal = "FONT";<br />
VARIANT varIndex;<br />
varIndex.vt = VT_I4;<br />
varIndex.lVal = 1;<br />
ptrHTMLElements->item(varName, varIndex, &pDisp3);
pDisp3->QueryInterface(IID_IHTMLElement, (void **) &ptrHTMLElement);
ptrHTMLElement->get_innerHTML(&pBURL);<br />
ptrHTMLDocument->Release();
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow thank u for u code. But i want the get the whole html of a specific url and place it in a textbox just like i showed u in visual basic 6. I do not want to retrive font elements!!!
|
|
|
|