|
Sorry about that. What I'm trying to accomplish is taking a text document, importing it into VC++ then based off of key words create check boxes that will pull data corralated with that word. For example, if I take the speed of a processor chip at 1.8volts and 2.0V, the the text it might say something like
Fmax @ 1.8V 800mhz
Fmax @ 2.0V 1000mhz
I want two check boxes to show up that say Fmax @1.8V and Fmax@ 2.0V, then if I click both of these boxes, I get a new text document that says 1.8v 800, 2.0v 1000.
|
|
|
|
|
Based on that description, you can create the checkboxes at design-time, and simply change their labels once the necessary data has been read from the file. To change a control's caption, use SetWindowText().
|
|
|
|
|
Create a CCheckListBox control and add the items as they appear in the text file. That way, you never need more space than the listbox initially occupies, no matter how many items you add to the list.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
Yes it is the correct place to ask this question. I'm sorry I am too busy to provide an answer though.
John
|
|
|
|
|
Why don't you start here:
http://www.codeproject.com/file/CDataFile.asp[^]
jhaga
CodeProject House, Paul Watson wrote:
...and the roar of John Simmons own personal Nascar in the garage. Meg flitting about taking photos.Chris having an heated arguement with Colin Davies and .S.Rod. over egian values. Nish manically typing *censur*. Duncan racing around after his pet *c.* Michael Martin and Bryce loudly yelling *c.* C.G. having a fit as Roger Wright loads up *c.* . Anna waving her *c.* and Deb scoffing chocolates in the corner.
...Good heavens!
|
|
|
|
|
Hi,
What should I do if I want to prevent my mainframe to become too small when I'm resizing so that it could not be smaller than 600x400 for exemple?
I tried it by catching WM_SIZE and WN_SIZING but I cannot use to make it work.
void CMainFrame::OnSize(UINT nType, int cx, int cy)
{
if(cx < 600) cx = 600;
if(cy < 400) cy = 400;
CMDIFrameWnd::OnSize(nType, cx, cy);
}
Any Ideas?
thanks
Everything's beautiful if you look at it long enough...
|
|
|
|
|
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);
}
|
|
|
|
|
just call the base class before doing your adjustments...
(WM_GETMINMAXINFO is called to retrieve the limits)
void CMainFrame::OnGetMinMaxInfo( MINMAXINFO FAR *lpMMI )
{
CFrameWnd::OnGetMinMaxInfo(lpMMI);
lpMMI->ptMaxSize.x = 640;
lpMMI->ptMaxSize.y = 480;
lpMMI->ptMinTrackSize.x = 640;
lpMMI->ptMinTrackSize.y = 480;
}
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
Calling the base class actually has no value in this case as it will just use the parameters originally passed with the (WM_GETMINMAXINFO) message and not the parameters you supply to the base-class function.
|
|
|
|
|
Yep, but if you move the sample code to a CMainFrame dereived from CMyFrameWndClass, which *does* something to the parameters, my one is better
I just think it's cleaner this way.
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
Hi,
is it guaranteed in an STL map that references to an pair<const key,="" value=""> remain valid even if new items are inserted, or other items are removed?
i.e.
tMyMap::iterator it = map.find( ... );
tMyMap::value_type & pPair = *it;
map.insert( ... );
map.erase( some other element );
Background:
I need a map<string, somestruct> for lookups, but also need to be able to iterate in the original insertion order. (deletes ar rare, they can be O(nn) and I wouldn't care).
I thought keeping the map around as usual, and having a separate list<tmyMap::value_type *> heeping references to the map items in original insertion order would give me fast lookup as desired.
TIA
Peter
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
Take w/ grain of salt:
I am not 100% about this but i wouldn't think that your reference is going to hold all the time. Some % of the time it may be valid but others it wouldn't. I would have to look at the stl implementation but i am guessing that if you insert an element and the map object has to rehash to fit the element in the pair reference is going to be invalidated. However if the map does not have to be rehashed than there is a chance that the reference remains valid. When i have to do something like what you are doing i ususally use pointers to my structures so that you can do:
somestruct* p = map.find( .. ).second;
One issue you are going to have though as far as reading back map elements is that a map doesn't promise to maintain your insertion order whatsoever ( in most cases anyway. I don't think std::map does either, though it could be forced somehow by providing a sort function ).
Joseph Dempsey
joseph_r_dempsey@yahoo.com
"Software Engineering is a race between the programmers, trying to make bigger and better fool-proof software, and the universe trying to make bigger fools. So far the Universe in winning."
--anonymous
|
|
|
|
|
From the SGI documentation on map http://www.sgi.com/tech/stl/Map.html
Map has the important property that inserting a new element into a map does not invalidate iterators that point to existing elements. Erasing an element from a map also does not invalidate any iterators, except, of course, for iterators that actually point to the element that is being erased.
Best regards,
John
|
|
|
|
|
|
I'm learning about .NET and I followed my book on how to set things up for edit and continue. Under Project->Properties, debug info format should be Program database for edit and continue(/ZI), by default it is /Zi. Then "compile as managed" has /clr. But when I go to compile, I get that these two command line switches (/ZI and /clr)are incompatible. SO tried compiling as unmanaged but the project I am trying this idea on is actually one with __gc etc (its a sample using mscorlib.dll), so it really needs compiled as managed (as the compiler tells me gleefully when I compile as unmanaged). I dont know if this is enough information., but what do I need to do to get the edit and continue going?
Appreciate your help,
ns
Or is it that you cant edit and continue with managed code?
|
|
|
|
|
Well.. we are using the APCI Relay8/In8 Card from Arcom since years.. never had problems with it.
Now we would like to use the AIM104-Relay8/In8 Card.. and we are having problems finding a lib file for MVC++ 6.0. (All the given files are for Borland C versions).
We are not able to use the Borland libs and we are not able to make new Lib's from the sources. (Missing some functions and keywords)
Does anybody has got any solution for this?
Thanks in advance,
bernhard
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous." U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
|
|
|
|
|
Hello, please help me with my special problem:
First I have an MDI-Application. In this application I call an MFC-DLL function to calculate different operations...
Now I need to call (from within my dll) a TextOut-function from my application (class View). How can I solve this problem....
Please help me
|
|
|
|
|
Youe EXE calls a function within your DLL, and this DLL then needs to call a function within your EXE? Not a good idea. I suppose it's technically possible to export a function from an EXE, but I've never done it. Why not just have the DLL post a message to your EXE and let the EXE handle the UI?
|
|
|
|
|
Is it possible to post an String or an CRect with PostMessage / SendMessage?
|
|
|
|
|
As long as the object is allocated on the heap. In other words, you couldn't do something like:
void SomeDLLFunction( void )
{
CRect rect(1, 2, 3, 4);
::PostMessage(HwndOfEXE, MY_MESSAGE, 0, (LPARAM) &rect);
}
Because before the EXE has had a chance to process the message, the CRect object has gone out of scope. Instead, you would do something like:
void SomeDLLFunction( void )
{
CRect *rect;
rect = new CRect(1, 2, 3, 4);
::PostMessage(HwndOfEXE, MY_MESSAGE, 0, (LPARAM) rect);
}
Then in your EXE's message handler, it would use the CRect object, and then delete it.
BEGIN_MESSAGE_MAP(...)
ON_MESSAGE(MY_MESSAGE, OnMyMessage)
END_MESSAGE_MAP
LRESULT OnMyMessage(WPARAM, LPARAM lParam)
{
CRect *rect = (CRect *) lParam;
...
delete rect;
}
|
|
|
|
|
How can I get the HwndOfExe - Parameter?
|
|
|
|
|
Two ways, although they are practically the same. Create another exported function in your DLL that accepts as a parameter, the HWND of the EXE's window. The DLL will store that value for later use. Or, modify the other exported function in your DLL to accept an additional HWND parameter. Make sense?
|
|
|
|
|
just pass athe valid Device context of that view to the function in ur DLL and by using that u can display .
Like void DiaplayText(CDC*pDc, char* pszText)
CodeTheDreams();
|
|
|
|
|
I am looking for some ideas on a way to implement a copy file function w/o using WriteFile or CopyFile. I know this sounds tough. This is what I am wanting to do. WriteFile and CopyFile are fairly intensive on a network and I need to come up with a way to write a file (copy it) from one network drive to another and have it be fast, really fast. Unfortunately, I haven't been able to come up with a way for this to happen. Any thoughts?
|
|
|
|
|
ever tried SHFileOperation ?
i don't think that it is faster than CopyFile.. but maybe you should give it a try..
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous." U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
|
|
|
|