|
RTFM[^]
[quote]
CBitmap::GetBitmapDimension
CSize GetBitmapDimension( ) const;
Return Value
The width and height of the bitmap, measured in 0.1-millimeter units. The height is in the cy member of the CSize object, and the width is in the cx member. If the bitmap width and height have not been set by using SetBitmapDimension, the return value is 0.
Remarks
Returns the width and height of the bitmap. The height and width are assumed to have been set previously by using the SetBitmapDimension member function.
CBitmap Overview | Class Members | Hierarchy Chart
See Also CBitmap::SetBitmapDimension
[/quote]
Use a BITMAP structure filled with CBitmap::GetBitmap(BITMAP *) to get the bitmaps dimensions.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
I am trying to use CDOSYS in a c++ application to send some emails.
I have used #import to get the libraries and everything seems to be working ok except that the mail messages get stuck in inetpub\mailroot\queue.
Any ideas how to find out what the problem is?
Mike
|
|
|
|
|
Could this be an issue with the IIS ? A misconfiguration somewhere ? Can you send normal mail messages using an application such as Outlook Express ?
The CDOSYS API is pretty straightforward, so the errors should be limited to missing sender/recipent or other mail header info. One option here is to see the IIS logs for any tips. Usually when mails are stuck in the queue there's a reason for it, and it's logged. If it's not, you should increase the logging sensitivity (what gets logged) so that everything is written there. Then try again and see if any errors occur.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
I would like to implement a class that will deallocate itself if something in the constractor fails. Something to work like this
class MyClass
{
public:
MyClass(char * filenm) {/* if filenm does not exist the class constuction fails*/};
~MyClass() {};
}
MyClass *mine = new MyClass("filename");
if(!mine)return 0;
....
This should be something similar to how ifstream functions. I tried to look at its code but did not manage to understand it.
Is there a way that I can make this work?
Thanks a lot
Michael
|
|
|
|
|
1. The clean and legal way in C++ to handle a failing constructor is to throw an exception
2. If your construtor throws an exception, C++ will:
- free the memory allocated for the object itself (if the allocation was dynamic)
- call the desctructors of all members and base classes (that were initialized)
It will NOT, however, call the destructor of the object that failed the construction. Since the object was not constructed completely, it would be dangerous to call the destructor.
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist || Agile Programming | doxygen
|
|
|
|
|
Exceptions are your friends!
I suggest, do what peter says.
However, if you do want to try:
Use a function to return the object instead of doing it with "new". Such a concept is usually called a "Class Factory" (concept from COM), whose sole purpose is to create and return an instance of a class.
void *CreateClassAA(string a)
{
if(a == "")
return 0;
else
.............
}
Bikram Singh
|
|
|
|
|
Yes this is a good idea.
But how is it done in ifstream? Does it really work fine?!
Thanks
Michael
|
|
|
|
|
hi,
i have a dialog box with a static control. the problem is that when i try to use setbkcolor for the static control in oninitdialog of the dialog box, it does not produce any results. i have tried to use GetDC() for the static control to get the DC. and then tried to set the background color of the static control. can any one give me a solution?
regards,
kevin
|
|
|
|
|
|
using WM_CTLCOLOR causes problems in other parts of my code. is there any other solution?
|
|
|
|
|
It should not affect other parts of your code.
Here is a sample of my code.
HBRUSH CMyView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CFormView::OnCtlColor(pDC, pWnd, nCtlColor);
INT nIDCtl = pWnd->GetDlgCtrlID();
switch(nIDCtl)
{
case IDC_STATIC_CTRL1:
{
pDC->SetBkColor(RGB(255, 255, 255));
CBrush br;
br.CreateSolidBrush(RGB(255, 255, 255));
hbr = (HBRUSH)br;
br.Detach();
}
break;
case IDC_STATIC_CTRL2:
....
....
case IDC_STATIC_CTRL3:
....
....
case IDC_STATIC_CTRL4:
....
....
}
return hbr;
}
|
|
|
|
|
|
SetBkColor() should be used when handling a WM_PAINT message or within a control's DrawItem() override. Use it to set the background color of the DC for the duration of the painting action.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
even if i use setbkcolor in WM_PAINT is does not do anything.
|
|
|
|
|
I have a SDI project where a user using the menu can select and load another window object. I get the new window, but it is on top of my main window. I want to be able to move the window away from the main window.
This is the code I use to create and show the window:
pStatus->dlg.Create(IDD_FORM_STATUS);
pStatus->dlg.ShowWindow(SW_SHOW);
Can someone help me out?
Thanks.
Jerry
|
|
|
|
|
One solution is MoveWindow().
Kuphryn
|
|
|
|
|
hi!
im a newbie with MFC & hope someone can help me with this...
i hv created 2 MFC dialog based programs and need to integrate them together... ie. after integrating, when i click on build on execute, the 2 dialogs shld appear together on the screen.
i've tried using a modal dialog box in program A so as to contain program B but created a mess n it's not functioning too.. as the 2 dialog dialog boxes need not communicate w each other, i wonder if there is a better suggestion?
|
|
|
|
|
Use Modeless Dialogs...
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
Hi!
I have projects and DLLs made with Visual C++6 and I try to pass to Visual C++7.
I have a link error when I use a function (contained in a DLL) that uses a CString as parameter.
ERROR LINK 2019 non resolved symbol CStringT ...
Everything was alright with VC++6.
How to solve my link problem?
Will any other problems happen soon during the passing of VC++6 to VC++7???
Thanks.
|
|
|
|
|
Hi all
does ne1 know the easist way of deleting a file
i have a txt file which i need to remove in certain situations
i tried using
remove(str_SettingsPath);
but that doesnt work
any ideas ??
si
|
|
|
|
|
Use unlink() , CFile::Remove() or DeleteFile() . Be sure to specify the file's full pathname.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
si_69 wrote:
i tried using
remove(str_SettingsPath);
but that doesnt work
It should, if used correctly. What value does it return? The file must not have the read-only (and probably the hidden) bit set. You must also have the right privileges.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
silly me, still had the file open while i was trying
to delete it
|
|
|
|
|
I first selected some files from an input directory, and then set the output directory to be some other location. Then I processed my input files and had it do a system() call for "dir/b > list.txt".
Its odd that it created the list.txt in the input files directory . I also checked with getcwd and sure enough it was the input directory. What is the reason for this?
Thanks,
sb
|
|
|
|
|
Working directories are specific to a drive. You're much better off using an API to get the list of files in a dir instead of calling system() .
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|