|
Do you specifically want to *read* only part of the image, or just crop the image you get it ?
Christian
I've learned that you cannot make someone love you. All you can do is stalk them and hope they panic and give in.
The early bird may get the worm, but it's the second mouse that gets the cheese.
|
|
|
|
|
hi there,
i am working on a pariticular project which requires horizontal and vertical alignment of objects(with equal spacing). Anybody out there can help then please do.
thank you,
vincent.
|
|
|
|
|
What sort of objects, in what context ?
Christian
I've learned that you cannot make someone love you. All you can do is stalk them and hope they panic and give in.
The early bird may get the worm, but it's the second mouse that gets the cheese.
|
|
|
|
|
Hi guys - hope someone out there can help.
I have a MSFlexGrid control which I have drawn on to my CFormView using the resource editor. I want to display 5 columns of varying widths to fill the entire area I have previously drawn.
The columns widths I want to display are proportionally laid out like this:
| 10% | -20%- | ---- 50% ---- | 10% | 10% | (hope that makes sense!
)
Anyway, I am currently trying to do this like so:
... some code ...
// get the client rect
CRect rect;
m_grid.GetClientRect(&rect);
// work out the width of one of the columns
int nInterval = rect.width()/10;
// alter the widths of each column
m_grid.SetColWidth(0, nInterval);
m_grid.SetColWidth(1, 2*nInterval);
m_grid.SetColWidth(2, 5*nInterval);
m_grid.SetColWidth(3, nInterval);
m_grid.SetColWidth(4, nInterval);
... some more code ...
Now when I do this, I get all of the columns crampt up into the original width of one column!!
I have the feeling that the MSFlexGrid control is using twips mapping mode rather than the one I am using, and I don't know how to change between the two
Can any one help please?
|
|
|
|
|
MSFlexGrid sucks. (Yeah, it IS using twips... you do have to convert.) Check out Chris Maunder's control. It ROCKS and does this crap FOR you though you lose the luxury of creating it in the dialog editor.
As for how to do it, here's a primitive but more or less functioning example:
1) Global: int g_iTwipsPerPixelX=0;
2) In view.... OnCreate
CDC* pDC = GetDC();
int iPixelsPerInch = pDC->GetDeviceCaps(LOGPIXELSX);
if (iPixelsPerInch)
g_iTwipsPerPixelX = int(1440 / iPixelsPerInch);
3) Handle OnSize for the dialog in your formview. Call function AdjustColumnWidths();
4) Here's more or less your function:
void CMyDialog::AdjustColumnWidths()
{
if (m_grid.m_hWnd)
{
// get the width of all the columns exept the second one
CRect rect;
m_grid.GetWindowRect(rect);
long lGridWidth = rect.Width();
// alter the widths of each column
m_grid.SetColWidth(0, lGridWidth*.10*g_iTwipsPerPixelX);
m_grid.SetColWidth(1, lGridWidth*.20*g_iTwipsPerPixelX);
m_grid.SetColWidth(2, lGridWidth*.50*g_iTwipsPerPixelX);
m_grid.SetColWidth(3, lGridWidth*.10*g_iTwipsPerPixelX);
m_grid.SetColWidth(4, lGridWidth*.10*g_iTwipsPerPixelX);
}
}
|
|
|
|
|
Help me, please!!!! I need a bit of code about "hooks" in relation to monitor windows messages of other applications. How can I caught the window text???? For instance, how can I caught a button text??? If anyone knows something about them, you don't hesitate to reply me.
Thanks in advance.
|
|
|
|
|
While working in MSDev there was an error and it shut down. Since then, whenever I open the project I
was working on, I get a message telling me that there was an error opening the ClassView Information
File and that the ClassView pane won't be available. Everything else is fine.
Can anyone out there tell me how to either repair or rebuild the ClassView Information File? I miss being
able to use the ClassView pane.
BTW, it works fine on all of my other projects, so it is just for the one I was working on when
MSDev had to be shut down. Also, the project compiles and works just fine too. So it seems
to simply be a corruption of the ClassView Information file for that one project.
Thanks. David.
|
|
|
|
|
I presume all four questions relate to the one problem ?
Delete your .clw file, it contains your class wizard information. If this does not solve it, ( and it should ), try backing up everyfile that has myfilename.ext format except the .cpp and the .h, delete them progresively until you find the corrupted file ( MSDev will rebuild it for you, this happens to me fairly regularly )
Christian
I've learned that you cannot make someone love you. All you can do is stalk them and hope they panic and give in.
The early bird may get the worm, but it's the second mouse that gets the cheese.
|
|
|
|
|
Close the workspace and close VC++. Then, delete the *.ncb, *.opt and *.clw files. These will be regenerated when you next start VC++ and your ClassView will work fine.
Mark
|
|
|
|
|
Hey, thanks.
That works with the following snag: I could not delete the .ncb file -- Explorer kept giving me an access
denied message. I deleted the .ncb file from a different project and it deleted fine and was regenerated
fine. So, your suggestion was valid, but the corruption of the file was bad enough that even
Explorer is having trouble with it.
Regardless, I managed to get everything back to normal the hard way. I simply created a new
Workspace, deleted everthing out of it and then added all the files I needed to rebuild my
program workspace. It is working fine again.
Thanks for the suggestion -- it seems that it would work except that my .ncb file is totally FUBAR.
David.
|
|
|
|
|
You couldn't delete it because the project was open. Close the project and delete it.
|
|
|
|
|
While working in MSDev there was an error and it shut down. Since then, whenever I open the project I
was working on, I get a message telling me that there was an error opening the ClassView Information
File and that the ClassView pane won't be available. Everything else is fine.
Can anyone out there tell me how to either repair or rebuild the ClassView Information File? I miss being
able to use the ClassView pane.
BTW, it works fine on all of my other projects, so it is just for the one I was working on when
MSDev had to be shut down. Also, the project compiles and works just fine too. So it seems
to simply be a corruption of the ClassView Information file for that one project.
Thanks. David.
|
|
|
|
|
Close your project. Delete the following temporary files: .ncb (I believe this is the only one you need but I usually do them all), .opt, .plg, .aps, .clw
Mike
|
|
|
|
|
While working in MSDev there was an error and it shut down. Since then, whenever I open the project I
was working on, I get a message telling me that there was an error opening the ClassView Information
File and that the ClassView pane won't be available. Everything else is fine.
Can anyone out there tell me how to either repair or rebuild the ClassView Information File? I miss being
able to use the ClassView pane.
BTW, it works fine on all of my other projects, so it is just for the one I was working on when
MSDev had to be shut down. Also, the project compiles and works just fine too. So it seems
to simply be a corruption of the ClassView Information file for that one project.
Thanks. David.
|
|
|
|
|
While working in MSDev there was an error and it shut down. Since then, whenever I open the project I
was working on, I get a message telling me that there was an error opening the ClassView Information
File and that the ClassView pane won't be available. Everything else is fine.
Can anyone out there tell me how to either repair or rebuild the ClassView Information File? I miss being
able to use the ClassView pane.
BTW, it works fine on all of my other projects, so it is just for the one I was working on when
MSDev had to be shut down. Also, the project compiles and works just fine too. So it seems
to simply be a corruption of the ClassView Information file for that one project.
Thanks. David.
|
|
|
|
|
Hi All,
I have a problem with threads !I am trying to write to a Database using Threads!For this, in a process I am creating 10 Threads using "CreateThread" process and the Threads are created in active state only !I have a 10 separate ThreadProcs so that the
the respective thread goes that Corresponding ThreadProc !Each Thread tries to log into Database.I am implementing COM & calling that corresponding function to add to Database !
The Threads where able to log into the Database.But, when I opened the Database what I noted was a single Thread is making more than one logging (But, according to code written , there should be only one logging from each Thread .)But, total number of logging comes to 10 as must be !(One logging from each Thread)
What could be the problem ?How can I rectify the problem !
Thanx for help in advance!
Yamini Devi
|
|
|
|
|
How to using Win32 API DeviceIoControl to control the LED on the keyboard light or dark?
Thank you!
|
|
|
|
|
Just curious: why do you need to blink keyboard LEDs?
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
I set up an Access database that has a memo field. When my program tried to write a long text (>300 but <1000 characters) into that field (by CRecordSet), I got a assertion error and the text was trancated. I know a memo field can contain a text less than 65k characters. Is there any one can tell me where I might make a mistake?
Thanks.
Yijun
|
|
|
|
|
The default maximum length for text fields is 255 characters, this is set by the RFX_Text() function called from DoFieldExchange() member function of your CRecordset. See the documentation of RFX_Text(), and edit the call in DoFieldExchange().
|
|
|
|
|
Tons of thanks! I got it.
Yijun
|
|
|
|
|
Hello,
I have added a Microsoft Data Grid Control to my app. By default it only displays 2 columns. Does anyone know how do I display more than 2 columns?
Thanks,
Rob
|
|
|
|
|
Hi all,
I made a isapi extension to be a chat.
There in it a infinity do-while which do a select in my sql database and send the result to the screen. But I have a problem. When the user close his browser, the isapi holds send select's to the server. Then the cpu usage raises up and the server crashes. So, I need to check in the each loop, if the browser it's open. If not, then I break the loop. Somebody can help me?
-=)Yuki(=-
|
|
|
|
|
You can get a handle to the CWnd of the browser, then check through that if the Window is visible, or valid. I'm not sure if ::IsWindowVisible will work, because I'm not sure if the handle could be recycled to a new window in the meantime, I guess it depends on how often you check, as well as obvious some internal Windows stuff I have only vague ideas about.
Christian
I've learned that you cannot make someone love you. All you can do is stalk them and hope they panic and give in.
The early bird may get the worm, but it's the second mouse that gets the cheese.
|
|
|
|
|
I am using the CFileDialog class and would like the user to only be able to open and save from certain folders.
I can stop the user from changing folders with some help from Shanker Chandrabose report on Customizing the Windows Common File Open Dialog.
|
|
|
|