|
|
Hi Everybody,
Now i am creating N-Number of text boxes in a window. But the window showing particular no of textbox. after that the window does not scroll.
Now i need to scroll the window if the textbox is high numbers.
Any help will be appriciated.
Thanks.
G.Paulraj
|
|
|
|
|
Use a CScrollView[^] as your base window.
It's time for a new signature.
|
|
|
|
|
i'm trying to attach CBitmap to CImage,but itz not working.
/* CBitmap bmpCap;
CBitmap *pBmpOld;
CImage img;
these three r declared in CChildView class
*/
//following code is in OnPaint() function...
CRect rect;
CDC dcMem;
dc.TextOutA(20,20,"Humais");
GetClientRect(&rect);
bmpCap.CreateCompatibleBitmap(&dc, rect.Width(), rect.Height());
pBmpOld=dc.SelectObject(&bmpCap);
i'm getting runtime error...
|
|
|
|
|
I don't know what you are trying to do here, but to answer your question
img.Attach(bmpCap.Detach());
bmpCap.Attach(img.Detach());
pBmpOld should be a local variable. Probably img as well.
|
|
|
|
|
i'm drawing shapes on CPaintDC dc....then i want to attach those shapes to img...so i can save them... can u please tell me proper steps?
|
|
|
|
|
This would be close (using only local variables)
CRect rect;
GetClientRect(&rect);
CBitmap bmpCap;
bmpCap.CreateCompatibleBitmap(&dc, rect.Width(), rect.Height());
CBitmap *pBmpOld = dc.SelectObject(&bmpCap);
dc.TextOutA(20,20,"Humais");
dc.SelectObject(pBmpOld);
CImage img;
img.Attach(bmpCap.Detach());
img.Save(...);
bmpCap.Attach(img.Detach());
...
|
|
|
|
|
i'm using save function,thats why i declare CImage & CBitmap in CChildView class..tell me now where i have to put
img.Attach(bmpCap.Detach());
i mean in save function or in OnPaint function??
|
|
|
|
|
In save.
You have the bitmap in bmpCap, so you only have to move the handle over to the CImage instance while saving, and then move it back again.
Make sure you're not creating the bitmap every time you enter OnPaint (should that not be OnDraw btw?). Verify that (HBITMAP)bmpCap == nullptr before creating it.
|
|
|
|
|
Hi,
I have a third party dll which actually is corruping fpcw register.Due to this my application crashes upon being launched.
I also have the code to fix, this is just a call to _controlfp() function.And I want to call it immediately after the third party dll is loaded.I want to put my fix in any of the dlls which get loaded after this one.Where can I call this code as all of these dlls are loaded statically?
Any suggestions would be helpful.
Thanks
Satya
Today is a gift, that's why it is called the present.
|
|
|
|
|
Call it in the entry point of your program (main or Winmain).
Statically linked DLLs are already loaded by the time the application entry point is called.
|
|
|
|
|
Does VS2010 have .vcproj project compatibility with VS2008?
Will it be possible to open the same project in VS2008 after conversion in VS2010? or keep them both appended to the same project to be able to work with the same project in either VS2008 or VS2010?
Is it possible to install the both on the same machine?
Чесноков
|
|
|
|
|
It is definitely possible to install both on the same machine.
VS2010 will convert VS2008 projects when opened.
A new project file will be created with extension .vcxproj .
The old project file with extension .vcproj will remain unchanged.
The only file that is going to be overwritten is the .sln file.
After conversion, the .sln file will reference the .vcxproj file.
You will still be able to open the .vcproj files in VS2008.
If your solution has multiple projects, you will need to maintain 2 copies of the .sln file.
This will have to be done manually in which case, after conversion, create a new .sln file and add all the old .vcproj files into it.
|
|
|
|
|
Just note, there is some MFC problems in VC2010.
Pavel Sokolov
|
|
|
|
|
Hi,
I am researching on CPU Stress Testing Functionalities
I have found we can stress test on FLOPS, Encryption, Compression, etc to test the CPU performance
Can anyone say how to calculate FLOPS per second?
Does anyone have any sample code for calculating FLOPS?
Thanks in advance.
|
|
|
|
|
Asking the same question three times in two different forums is NOT going to get you any more or better answers. Have you tried googling FLOPS or Benchmark?
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
Sorry for the repetition. I've tried alot in google. After two months of searching, I'm posting this question in this forum
|
|
|
|
|
FLOPS per second is zero if you have a constant clock rate.
Once you agree to clans, tribes, governments...you've opted for socialism. The rest is just details.
|
|
|
|
|
This seems such an obvious thing to need to do but I've failed to find any good references. Can anyone help please?
I have an MFC app which uses the Doc/View architecture. One of the document types it can display is a registered file type: the file is in a private binary format, and based on a code value in the file a config file is selected: the binary file is then rendered using the config file into a read-only text file in a CEditView within the app. OK so far? this works fine.
What I want to do is as follows. Let's say an intranet .aspx web page contains a link to the binary file, perhaps along with some summary text extracted separately. When the user clicks on the link, the view changes to the same text as would be displayed in my MFC app. What's the best way to do this? ActiveX control? other ideas?
This is a company intranet application, the binary file would be located on one of the company file servers. It is acceptable for my MFC app to require to be installed on the local machine, so any required controls/DLLs etc could be installed at the same time.
|
|
|
|
|
Paul Steane wrote: ActiveX control?
Yep
virtual void BeHappy() = 0;
|
|
|
|
|
i wrote the code in EVC++ 4.0, MFC,when i debug the code, the error occur at:
CDisplayData* pDisplayData=(CDisplayData*)pMainFrame->m_wndSplitter.GetPane(1,0);
i don't know how to solve it, please help
void CReadWriteData::DisplayAxisInfo()<br />
{<br />
...<br />
<br />
<br />
CMainFrame* pMainFrame=((CMainFrame*)AfxGetApp()->m_pMainWnd);<br />
<br />
<br />
CDisplayData* pDisplayData=(CDisplayData*)pMainFrame->m_wndSplitter.GetPane(1,0);<br />
pDisplayData->m_xAxisCor.Format(_T("%f"),fValue);<br />
pDisplayData->UpdateData(FALSE);<br />
<br />
<br />
}
i 've tried ,then i have no regret
|
|
|
|
|
i entered the GetPane(),
<br />
CWnd* CSplitterWnd::GetPane(int row, int col) const<br />
{<br />
ASSERT_VALID(this);<br />
...<br />
}
the app stopped at here
i 've tried ,then i have no regret
|
|
|
|
|
Verify that your pMainFrame != nullptr and that your splitter wnd, this in your last post != nullptr . You can also step into the ASSERT_VALID macro for more info.
|
|
|
|
|
First off I'm new to programming, so please be patient.
I'm writing a program that creates many instances of an image and randomizes their xy coordinates. My problem is I don't know how I should attach coordinate values to the array that represents the images.
Basically I want to know how I can take the image character[31] and attach coordinates to it, such that:
character[31] x = 5;
character[31] y = 7;
I want all the characters to have their own sets of coordinates:
character[32] x = 14;
character[32] y = 2;
Of course that code doesn't work, but that's what I want to do. Is this what a struct would be good for? I haven't worked with them before so a short piece of example code would be very helpful. Any help is greatly appreciated!
modified on Sunday, July 4, 2010 3:45 PM
|
|
|
|
|
You could try
struct Coordinate
{
int x;
int y;
};
const size_t numberOfCoords = 64;
Coordinate coords[numberOfCoordinates];
std::vector<Coordinate> coords(numberOfCoordinates);
Now you can use coords as the character array in your example:
coords[2].x = 1;
coords[2].y = 2;
Edit: Template argument....
home
modified on Monday, July 5, 2010 4:34 AM
|
|
|
|