|
Hmm, the ShellExecute() call should cause your default mailer to open. If it's not OE, then are you saying that you want OE specifically to deliver the message? Sorry if I put you on the wrong track!
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hi!
I need a safe way to acquire a colored bitmap... Now, I do it like
hDC = CreateCompatibleDC(NULL)
hBitmap = CreateBitmap(params...hDC...)
but it's still B&W
any ideas? Thanks!
PS: running 98 if you find this relevant. No window handle available
|
|
|
|
|
Can you post more or your code? What are you passing CreateBitmap for UINT cPlanes and UINT cBitsPerPel?
Todd Smith
|
|
|
|
|
CreateBitmap( width, height, GetDeviceCaps( hTempDC, PLANES ), GetDeviceCaps( hTempDC, BITSPIXEL ), NULL );
and I get the dc like
hTempDC = CreateCompatibleDC(NULL)
|
|
|
|
|
Check what GetDeviceCaps( hTempDC, PLANES ) and GetDeviceCaps( hTempDC, BITSPIXEL ) are returning. I suspect GetDeviceCaps( hTempDC, BITSPIXEL ) is not 8 or greater which is required for a color image. If you want a 256 color image then use 8 otherwise use 24.
Todd Smith
|
|
|
|
|
Hello. I'm using MFC without the use of any wizards or such (VC6/w2kpro), doing everything manually. Now I've run into a problem, I cant set message text to my status bar..here's my frame window constructor:
FrameWindow::FrameWindow()
{
Create(); // create the frame window
m_wndStatusBar.Create(this);
SetMessageText("Testing");
}
When I run this code, I see the status bar, but I don't see any text on it. Then I tried moving SetMessageText("Testing"); to FrameWindow::OnPaint(), and then the text appeared. Now, I dont want to call SetMessageText() in OnPaint(). Why can't I set the inital text in the frame window constructor?
I also tried with m_statusBar.GetStatusBarCtrl().SetText( "Testing", 255, 0 );
Same result as with SetMessageText().
Please help me solve this annoying problem
William Payne
|
|
|
|
|
Probably, it does not work that there are no created fields in SB. Try to use something looks like that:
... It's our SB fields
static UINT indicators[] =
{
ID_SEPARATOR, // status line indicator
ID_INDICATOR_POS,
ID_INDICATOR_CAPS,
ID_INDICATOR_OVR,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
};
... Use update action handlers to change contents of SB
ON_UPDATE_COMMAND_UI(ID_INDICATOR_POS, cmdupOnIndicatorPOS)
ON_UPDATE_COMMAND_UI(ID_INDICATOR_OVR, cmdupOnIndicatorOVR)
....
..... After SB creation we must set indicators
pStatusBar->SetIndicators(indicators, sizeof(indicators)/sizeof(UINT));
...... Update it!!
void CSourceView::cmdupOnIndicatorPOS(CCmdUI* pCmdUI)
{
TCHAR str[32];
....
sprintf(str," Line %d, Col %d", dwLine+1,dwCol+1);
pCmdUI->SetText (str);
}
|
|
|
|
|
Tried your suggestions (except for the command handlers), still no text in the message pane. And I don't think the lack of panes was the problem, since text appears if I call SetMessageText() in OnPaint() of the parent window (the frame window). I've made a small test program: which is as follows:
///// APPLICATION.H /////
#ifndef APPLICATION_H
#define APPLICATION_H
#include <afxwin.h>
#include "FrameWindow.h"
class StatusBarApplication : public CWinApp
{
public:
BOOL InitInstance();
};
extern StatusBarApplication g_applicationInstance;
#endif
//// END OF APPLICATION.H ////
//// APPLICATION.CPP ////
#include "Application.h"
StatusBarApplication g_applicationInstance;
BOOL StatusBarApplication::InitInstance()
{
m_pMainWnd = new FrameWindow();
m_pMainWnd->ShowWindow( m_nCmdShow );
m_pMainWnd->UpdateWindow();
return TRUE;
}
//// END OF APPLICATION.CPP /////
//// FRAMEWINDOW.H /////
#ifndef FRAMEWINDOW_H
#define FRAMEWINDOW_H
#include <afxext.h>
#include <afxwin.h>
class FrameWindow : public CFrameWnd
{
public:
FrameWindow();
DECLARE_MESSAGE_MAP()
private:
CStatusBar m_statusBar;
};
#endif
//// END OF FRAMEWINDOW.H ////
//// FRAMEWINDOW.CPP ////
#include "FrameWindow.h"
BEGIN_MESSAGE_MAP( FrameWindow, CFrameWnd )
END_MESSAGE_MAP()
static UINT indicators[] =
{
ID_SEPARATOR, // status line indicator
//ID_INDICATOR_POS,
ID_INDICATOR_CAPS,
ID_INDICATOR_OVR,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL
};
FrameWindow::FrameWindow()
{
Create( NULL, "Status Bar Test" );
m_statusBar.Create( this );
m_statusBar.SetIndicators( indicators,
sizeof( indicators ) / sizeof( UINT) );
SetMessageText( "test" ); // No text appears in the message pane
// despite this call.
}
//// END OF FRAMEWINDOW.CPP ////
|
|
|
|
|
What about CStatusBar::SetPaneText??? In my opinion it is best solution...
|
|
|
|
|
I am retrieving a text field from a database using the syntax that works fine for an ordinary text entry:
m_photoInfo = (_bstr_t)m_pRecordset->Fields->GetItem ("ID")->Value;
the problem here is that in the ID field I have a value C:\def.mdb,abc
When it gets this value out I have a messagebox pop up which tells me its horribly confused and has some garbage characters ef.mdb,abc
How do I get this text value out so that it comes out properly?
Thanks,
ns.
|
|
|
|
|
how are you displaying your message box?
are you using a function that uses printf()-style formatting??
strikes me that whatever code you're using is trying to interpret "c:\def.mdb,abc" as a format string, thus it's got a "\d" in the middle of it.
Experiment: manually update your record in the db so that the value is "c:\\def.mdb,abc" and see if it displays properly.
Jon
STL is a religeon. Enquiries to Reverend Christian Graus
|
|
|
|
|
I made a database class and the Open() function is quite flexible but opens a recordset based on a specific query. Its too involved to remove that inflexibility. Now I am wanting to use my database class but open with a whole different query. SO is it okay if I have a function called DbClass::Open2() which opens a database based on my new specific query (I may make Open2 be able to take any query but for the moment not). then when I want to open a database with my new query I can instantaite a new db object and call its open2 which in no way will interere with the db object which called Open1 (the original).
Any comments? I know this is not good programmmming but do you agree that I can call two different versions of Open if I so desire...
Thanks,
ns
|
|
|
|
|
Just call it Open but use different parameters. C++ will be able to figure it out. Its called method overloading.
Jason Henderson quasi-homepage articles "Like it or not, I'm right!"
|
|
|
|
|
??????
<< excuse my english please, i'm romanian >>
|
|
|
|
|
void MClass::Open()
void MClass::Open(int i)
void MClass::Open(char c)
Are different functions of the same class with the same name but having different parameters. This is called function overloading.
Jason Henderson quasi-homepage articles "Like it or not, I'm right!"
|
|
|
|
|
Why not rename Open to something more descriptive and change our code? Then add another function for your 2nd query.
Use something like QueryCustomers and QueryProducts instead of Open and Open2.
Todd Smith
|
|
|
|
|
Good idea! I'm just so glad I could extend my class. Appreciate your advice.
Thanks,
ns
|
|
|
|
|
How can I change the default debugger?
Thanks,
Jon Sagara
"Bugs suck. Period."
-- John Robbins
|
|
|
|
|
If you are refering to the app that is launched when you get an error and you tell it to debug, look up AeDebug on MSDN. Its a registry entry.
Jason Henderson quasi-homepage articles "Like it or not, I'm right!"
|
|
|
|
|
1.
I've CEdit and a CButton on a CDialog. The CButton placed on top of the
CEdit. When the CButton is dragged up/down, I wish the CEdit will
streach/shrink, corresponding to the CButton bottom coordinate.
CAN SOMEONE LINK ME TO SOME ARTICLE THAT CAN RESOLVE MY ISSUE
2.
An article dealing with HOWTO create non-cubical windows/controls (please?)
10XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX a lot
--BlackSmith--
"With the help of all mighty", 2001, Me.
|
|
|
|
|
See the Owner Drawn Buttons section at this[^] page.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
use ownerdraw buttons for non-rectangular buttons and use WinAPI functions
CreatePolygonRgn
SetWindowRgn
etc.
for creating windows with arbitrary shape
|
|
|
|
|
quick, easy question:
how do I merge two std::set<ulong> sets into one?
for example:
std::set<ULONG> Aset;
std::set<ULONG> Bset;
...
...
...
...
Aset.merge( Bset );
I'm guessing I don't have to do it by hand (iterate BSet, adding all elements to ASet).
TIA,
Pete
|
|
|
|
|
use std::copy with a back_inserter, I would have thought.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
Didn't work, but that could have been me calling it wrong.
I ended up doing it by hand:
for( set_it = Bset.begin(); set_it != Bset.end(); set_it++ )
Aset.insert( set_it );
which does the job I guess...
Thanks anyway Christian
|
|
|
|