|
Well... now I just tried...
Outlook::AttachmentsPtr pAtt = pMail->Attachments;
pAtt->Add(L"c:\\download\\MyStuff.htm");
and it worked out... maybe can be beause it's not a binary file... ?
shhh.....
|
|
|
|
|
Hello,
this is (I think) the stupidest question I've posted here...
but, and only for curiosity...
I've designed an app with bitmapped background and I have been trying to make a bitmapped button to coincide with the background, but it seemed to be impossible, using mouse or using keys...
I've finished moving the button control in the OnInit dialog handler using this code:
this->m_cbtnCintaTransportadora.GetWindowRect(&rCorreccioPosBtnCintaTransportadora);
rCorreccioPosBtnCintaTransportadora.left += 1;
rCorreccioPosBtnCintaTransportadora.right +=1;
rCorreccioPosBtnCintaTransportadora.top+=1;
rCorreccioPosBtnCintaTransportadora.bottom+=1;
ScreenToClient(&rCorreccioPosBtnCintaTransportadora);
this->m_cbtnCintaTransportadora.MoveWindow(rCorreccioPosBtnCintaTransportadora);
Is it possible to do it via the dialog editor?
Thank you in advance...
|
|
|
|
|
Hi Joan,
Are you saying you have a background with a pattern on it and your button needs to line up with the background pattern? Or are you just trying to place the button using the resource editor?
I have used bitmap backgrounds on dialog boxes extensively. I always use CBitmapButton class for the buttons. You drag the regular buttons onto the dialog from the resource palette as usual but you only have control of the left top corner of the button. The rest is controlled by the actual size of the bitmap of the button.
If there is a problem with the pattern I reposition in the editor or make an adjustment in a image editor.
Art
|
|
|
|
|
I was talking about placing a bitmap (picture control) in the dialog and then different Bitmap buttons over it (by changing the showing order).
is there any way to place the bitmap in teh dialog? what is a pattern (in this context)?
thank you in advance...
|
|
|
|
|
I would avoid the picture control method of putting the bitmap on the dialog background.
Do this instead:
//Declare some variables:
CBrush m_brush;
CBitmapButton m_btnOK;
CBitmapButton m_btnCancel;
//Add code:
OnInitDialog:
{
...
RECT rc;
GetClientRect(&rc);
HBITMAP hBmp=NULL;
hBmp=(HBITMAP)::LoadImage(NULL,"YourPath.bmp",IMAGE_BITMAP,rc.right,rc.bottom,LR_LOADFROMFILE);
CBitmap *pBmp=CBitmap::FromHandle(hBmp);
m_brush.CreatePatternBrush(pBmp);
::DeleteObject(hBmp);
// Load Graphics onto OwnerDrawn buttons.
// These are CBitmapButton objects
m_btnOK.AutoLoad(IDOK,this);
m_btnCancel.AutoLoad(IDCANCEL,this);
}
OnPaint()
{
//Paint the background with the image brush
CRect rcClient;
GetClientRect(&rcClient);
dc.FillRect(&rcClient,&m_brush);
}
OnCtlColor(..)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
switch(nCtlColor)
{
case CTLCOLOR_STATIC:
pDC->SetTextColor(RGB(TBD));
case CTLCOLOR_BTN:
pDC->SetBkMode(TRANSPARENT);
case CTLCOLOR_DLG:
hbr=m_brush;
}
return hbr;
}
Art
|
|
|
|
|
WONDERFUL: easy and much better.
Only one question:
this is a pattern (now I understand what you were talking about) is there any way to load the bitmap without making a pattern? only load it one time?
Thank you in advance.
|
|
|
|
|
Joan,
(..only load it one time?)
You are loading it only one time. LoadImage(..) is called only once. I don't understand the question.
Art
|
|
|
|
|
Nothing, I meant that if the dialog gets resized the background image gets repeated until the background is fullfilled...
I'd like to get the image not resized and aligned only to top left...
is it possible to get the image sized as the original? even if the dialog gets resized?
thank you in advance...
|
|
|
|
|
Sorry, I thought you wanted it as a background on your dialog.
What you need to do is change the code in OnPaint. This is where the size of the image is being computed when the dialog is resized. Instead of GetClentRect(..) just specify the fixed size of the rectange you want to fill in the FillRect(..)
OnPaint(..)
//Paint the background with the image brush
//CRect rcClient; //Modify this to be the rectangle you want
//GetClientRect(&rcClient); //Block this
dc.FillRect(&rcClient,&m_brush);
Art
|
|
|
|
|
|
Hi ,
this is a question about providing exclusive access to a control .
Consider my case where I am using a active x control to log certain details. My application works on a REQUEST - RESPONSE mechanism where I request a certain piece of data externally (serial or network ) , wait a certain duration and conitinue processing the next REQUEST. There is another callback function that actually reports the data I am requesting and needs to log the RESPONSE To the same active x control .
I am running into problems when both of these threads are running . i.e Main request loop and the call back thread . They tried to access the same resource via a variable(say the current row of a grid !!!!!) and that is when results go messy .
I know that I can use CCriticalSection to protect a block of code , but how do i provide exclusive access to a resource when they are not part of the same code ? like a control which is spread across different functions? Please help
|
|
|
|
|
If the resource is managed by a C++ class you can put a critical section in the class and lock it whenever any code needs exclusive access to the resource. Of course you also need to ensure you can't get into a deadlock situation.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Hi,
Can anyone answer the following question or at least tell me where I can find the answer ?
When you install VB, Visual studio, Ms word etc... and you have a PC with multiple registries (say one for stand-alone use/login and one for network use/login) the software manages to register itself in all the registries and you can use it whichever way you log in. With my own software it will register OK but the settings I enter into the registry are only visible in the registry active at the time of registration. When you log in differently and another registry is used the program cannot access the values in the original one.
The solution seems simple: register the software in all possible registries as the Microsoft products seem to do. The question is: how do you do that ?
Any answers most welcome and appreciated.
Filip
|
|
|
|
|
one thing you can consider is to add your registry entries to HKEY_LOCAL_MACHINE, instead of HKEY_CURRENT_USER. the first is readable to most processes, regardless of user login. the second is unique for each user.
-c
Image tools: ThumbNailer, Bobber, TIFFAssembler
|
|
|
|
|
Are you confusing HKLM (Local Machine) and HKCU (Current User)?
You need administrative rights to write into HKLM but it is visible to all users.
Art
|
|
|
|
|
Thank you for the help. A case of "glaringly obvious once pointed out". It ought to make all the difference.
Filip
|
|
|
|
|
I'm using doxygen for the first time and I'm trying to configure the configuration file with the doxywizard. When I run the generation I've got "unknown command or file name" dos window and that's all.
How can I figure out what's wrong with my configuration file this way ?
I'm using the latest 1.3.
Yarp
http://www.senosoft.com/
|
|
|
|
|
|
Thanks a lot Andreas, I did a search in the articles before asking but I don't know why I missed this.
My main problem comes with the wizard, I think the files included in the zip file will greatly help me solve this.
Thank again
Yarp
http://www.senosoft.com/
|
|
|
|
|
hi,i'm newer developer on visualc++ and i want to know how can i add a bitmap(more than 256 color) for a button,
Please help,
Thanks
Bye
liuqid
|
|
|
|
|
|
I'd like to use a "output iterator" as a function parameter, but somehow I fail to do that. Any hints where to read about this?
Off to in ~74 days
|
|
|
|
|
Post an example of your code.
Kuphryn
|
|
|
|
|
|
Andreas Saurwein wrote:
Sometimes the SGI STL documentation is really useful
No, it's the VC STL documentation that sucks!
It's not the fall that kills you: it's the sudden stop - Down by Law, Jim Jamursch (1986)
|
|
|
|