ON_BN_CLICKED(IDC_READ, OnRead);
BOOL CReadDBDlg::OnInitDialog()
{
}
I want to call ON_BN_CLICKED in OnInitDialog() how to do that. It will be great full if code example mention
Printable View
ON_BN_CLICKED(IDC_READ, OnRead);
BOOL CReadDBDlg::OnInitDialog()
{
}
I want to call ON_BN_CLICKED in OnInitDialog() how to do that. It will be great full if code example mention
Code:BOOL CReadDBDlg::OnInitDialog()
{
...
OnRead();
}
Look at the CRecordset class. It does almost all of the work for you.
ON_BN_CLICKED(IDC_READ, OnRead)
This is my button click event I want to call it in OnInitDialog() Method
BOOL CReadDBDlg2::OnInitDialog()
How to do this?
I wonder, don't you read the answers to your previous questions? :confused:Quote:
There is the post#17:
I want to call BN_CLICKED it self
Why?Quote:
Note that BN_CLICKED is just some UINT constant, ON_BN_CLICKED(IDC_READ, OnRead) is a macro that show the compiler what function must be called in response to the IDC_READ button click.
So if don't want to call this function directly then you should simulate the button click sending the WM_COMMAND message with corresponding WPARAM and LPARAM. See https://msdn.microsoft.com/en-us/lib...or=-2147217396
Dear [email protected],
please, don't delete the posts that were already answered! Otherwise you will break the logic!
See the post#17, post#23Quote:
Ok,
How we can close the open dialogbox through code at runtime
I want to display Logo on my document like other data which I retrieve from database are store into variable and then those are passes to print on document. I am storing path of related bitmap in database and it is also retrieve into variable I know following:
hbit = (HBITMAP) LoadImage(AfxGetInstanceHandle(),
// MAKEINTRESOURCE(IDB_BITMAP4),
MAKEINTRESOURCE(IDB_BITMAPNAME),
IMAGE_BITMAP,
0,
0,
LR_CREATEDIBSECTION); SRCCOPY);
IDB_BITMAPNAME is a BITMAP which File Name Property set to the logo's path.
This is a static way to do means I already set FileName Property of BITMAP. I want to set it at runtime. please help
Wait, did you solve the other problem with reading data from the database?Quote:
I tried as follows but not work,
hbit = (HBITMAP) LoadImage(NULL,
// MAKEINTRESOURCE(IDB_BITMAP4),
sLogopath,
IMAGE_BITMAP,
0,
0,
LR_LOADFROMFILE);
sLogoPath is CString type variable which contain C:\Users\Administrator\Desktop\cg_logoa.bmp path of bitmap
I also tried for dilectly mention path instead of variable "C:\\Users\\Administrator\\Desktop\\cg_logoa.bmp"
Also tried for this
L"C:\\Users\\Administrator\\Desktop\\cg_logoa.bmp" but it gives following error
error C2664: 'LoadImageA' : cannot convert parameter 2 from 'unsigned short [44]' to 'const char *'
Please reply soon. kindly I am waiting