|
-
January 11th, 2016, 05:27 AM
#16
Re: Access database with MFC, vc++ 6.0
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
-
January 11th, 2016, 05:30 AM
#17
Re: Access database with MFC, vc++ 6.0
Code:
BOOL CReadDBDlg::OnInitDialog()
{
...
OnRead();
}
Victor Nijegorodov
-
January 11th, 2016, 06:19 AM
#18
Re: Access database with MFC, vc++ 6.0
Look at the CRecordset class. It does almost all of the work for you.
-
January 11th, 2016, 07:39 AM
#19
Re: Access database with MFC, vc++ 6.0
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?
-
January 11th, 2016, 07:45 AM
#20
Re: Access database with MFC, vc++ 6.0
 Originally Posted by [email protected]
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? 
There is the post#17:
 Originally Posted by VictorN
Code:
BOOL CReadDBDlg::OnInitDialog()
{
...
OnRead();
}
Victor Nijegorodov
-
January 11th, 2016, 07:48 AM
#21
Re: Access database with MFC, vc++ 6.0
I want to call BN_CLICKED it self
-
January 11th, 2016, 08:10 AM
#22
Re: Access database with MFC, vc++ 6.0
Why?
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
Victor Nijegorodov
-
January 11th, 2016, 08:16 AM
#23
Re: Access database with MFC, vc++ 6.0
Dear [email protected],
please, don't delete the posts that were already answered! Otherwise you will break the logic!
Victor Nijegorodov
-
January 11th, 2016, 08:34 AM
#24
Re: Access database with MFC, vc++ 6.0
 Originally Posted by VictorN
Dear [email protected],
please, don't delete the posts that were already answered! Otherwise you will break the logic!
Actually I did not see answer and posted question also on second page. After I saw that that's why I delete it. Sorry for that Sir.
Please mention a code for That BN_CLICKED(...) macro. to call in initDiaog() method
-
January 11th, 2016, 09:14 AM
#25
Re: Access database with MFC, vc++ 6.0
 Originally Posted by [email protected]
Please mention a code for That BN_CLICKED(...) macro. to call in initDiaog() method
See the post#17, post#23
Victor Nijegorodov
-
January 11th, 2016, 10:50 PM
#26
Re: Access database with MFC, vc++ 6.0
Ok,
How we can close the open dialogbox through code at runtime
-
January 11th, 2016, 11:27 PM
#27
Re: Access database with MFC, vc++ 6.0
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
Last edited by [email protected]; January 12th, 2016 at 12:14 AM.
-
January 12th, 2016, 12:53 AM
#28
Re: Access database with MFC, vc++ 6.0
 Originally Posted by [email protected]
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?
-
January 12th, 2016, 01:19 AM
#29
Re: Access database with MFC, vc++ 6.0
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 *'
Last edited by [email protected]; January 12th, 2016 at 01:28 AM.
-
January 12th, 2016, 01:55 AM
#30
Re: Access database with MFC, vc++ 6.0
Please reply soon. kindly I am waiting
Last edited by [email protected]; January 12th, 2016 at 02:00 AM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|