|
Look in your .rc files - that's what it's complaining about, I think - something in the resources (the .rc files) NOT resource.h
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
hi i have checked..but actually i dont have an id created for the PRINTSTATUS dialog.evn if i set an id to the dialog i am getting more and more errors... i dont have a duplicate id in my .rc file.why i am getting this i dont know.. please help
|
|
|
|
|
Hi all,
i'm trying to use a DDX_Radio in the DoDataExchange of my CDialogBar but when i call the UpdateData to get the DDX value i get an error.
Do i have to do some kind of initializaztion befor i can use the DDX controls?
Does anyone have any suggestion about how resolve this problem?
tnx
|
|
|
|
|
Crownless wrote: i get an error.
You need to explain what the error is before anyone can begin to offer any suggested solution.
|
|
|
|
|
Debugging I can see that I get the error on the DDX_Radio function that I call in the DoDataExchange of my DialogBar.
The error is a "simple" Debug Assertion Failed!
|
|
|
|
|
You should really try to provide all the useful information:
- Code snippet + where the code is crashing
- Exact error message (if there is a message in the assertion, it is probably for a reason, no?)
|
|
|
|
|
well... i'll try to explain better the situation...
i have a CDialogBar with this DoDataExchange:
void CMyDlgBar::DoDataExchange(CDataExchange* pDX)
{
CDialogBar::DoDataExchange(pDX);
DDX_Radio(pDX, IDC_RADIO1, miRadio);
}
i create my CDialogBar in my MainFrame and then i call a function for the initialization of my class.
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if(CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
mMyDlgbar.Create(this,
IDD_DLGBAR,
CBRS_LEFT | CBRS_HIDE_INPLACE,
IDD_DLGBAR);
ShowControlBar(&mMyDlgbar, FALSE, FALSE);
mMyDlgbar.InitDialog( );
return 0;
}
My InitDialog function calls the UpdateData(FALSE) (or UpdateData(TRUE), it's the same).
void CMyDlgBar::InitDialog()
{
UpdateData(FALSE);
}
the UpdateData function calls the DoDataExchange of my class, i get the error on the DDX_Radio function.
No particular message is provided when i get the error.
|
|
|
|
|
|
|
Hello people!
I know this sounds sick, but...sadly in our project the requirement arose to let the user click on a control "behind" a modal dialog. This control is on the main window of our application which is also the parent of the modal dialog and the requirement says that the user should be able to click around this one control in the main window but he should not be able to use anything else that is not on the modal dialog.
I know i could make the dialog modeless and disable everything on the main window except for this one control but this solution doesn't sound all that "sophisticated" and i am hoping for a better one, not to mention that if i disable everything else on the main window the user will still be able to move it around and resize it while the dialog is up and that is also not acceptable but hacking into the moving-sizing functionality also sounds disgusting. Another problem with this aproach would be that certain things around the main window might change enabled-disabled states while the dialog is up depending on certain events (mostly triggered by changes in hardware) so simply disabling everything and re-enabling them once the dialog is closed is not that obvious as it sounds.
Another thing i can think of is capturing the mouse input to the dialog and checking what is under the mouse when it is clicked and if it is that certain control, post/send the mouse messages to it, this might or might not work and also this causes problems when the user tries to move the dialog itself around or when it clicks on a button in the dialog.
I tried catching the needed mouse messages in CWinApp::ProcessMessageFilter or CWinApp::PreTranslateMessage but these don't seem to get called if the user clicks outside of the dialog.
So, any of you have a better idea how to do this if it is possible at all? Is there maybe a filter method i could overwrite somewhere that filters out clicks outside of the modal dialog?
Thanks in advance.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Why don't you move/copy the control on the modal box?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
That idea crossed my mind too but this control is very much integrated into its surroundings not to mention this solution would cause a huge crowd of angry willagers chasing me with pitchforks and torches. Thanks for the idea though.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Code-o-mat wrote: this control is very much integrated into its surroundings
This shouldn't be a problem: just copy the needed context and functionality.
Code-o-mat wrote: not to mention this solution would cause a huge crowd of angry willagers chasing me with pitchforks and torches.
I could not see a viable solution to...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
In the DialogBox() or DialogBoxParam() call set hWndParent to NULL: this creates an 'unowned' dialog, which decouples it somewhat from your main window. Also set EXSTYLE WS_EX_TOPMOST in your dialog resource definition: this will keep the dialog on top of all other windows. You should then be able to click a button on the main window. You will probably also need to disable all the controls on the main window except the one allowed one if the dialog is active.
|
|
|
|
|
Thank you for your suggestion but this seems to be the same thing as the first possible solution i described in my post which i don't want to use. Correct me if i am missing something obvious here.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Code-o-mat wrote: Correct me if i am missing something obvious here.
Nothing I can think of, but I still think that the effort required to achieve what you are suggesting is not worth it.
|
|
|
|
|
don't know whether i am on the right track.. when you click outside a modal dialog the message it is posting will be 0x118.. with wParam 0xfff8 by handling that you can check for your mouse pointer position and check whether it is the area where the component fall in the parent. You don't have to wait for a click on the button but for the mouse click on that area you can trigger that function.. I think i am clear.
urs,
Raghavendran.V.
Raghavendran V
CDAC
|
|
|
|
|
Ragha Venkat wrote: when you click outside a modal dialog the message it is posting will be 0x118.. with wParam 0xfff8
I don't think this is quite true, the messages posted on a mouse click are dependent on where the mouse is positioned: a menu item, button, task bar etc.
This will not provide consistent or reliable results. If this click happens to be on another open window, then that window will be given the focus and receive the message. This is a very unsafe way to handle messages; if you bypass the rules prescribed by Microsoft, then you must be prepared to accept that it may not work as you wish.
|
|
|
|
|
http://lookpic.com/i/990/Q8s8GvYz.jpeg[^]
i want to do a programming using visual C++..
firstly...the key that input was S,D,F,J,K,L...how can i set the input from keyboard...
example like> if i push the input from keyboard letter SDF is for image 1, S for image 2,SDFJKL for image 3 or etc...
example>the sentences was
'saya suka makan'
s=image 1
a=image 2
y=image 3
a=image 1
s=image1
u=image 4
k=image 5
a=image 2
m=image7
a=image 2
k=image 5
a=image 2
n=image 8
display look like,
image 1,image2,image3,image1 ,image 0,image1,image 4,image5,image6,image0,image7,image2,image5,image2,image8
*image 0 for the space.
i wanted to put just 20 image on row...every time finish, i can reset the image...
|
|
|
|
|
Please do not repeat the same question - see here for guidelines on how to get an answer. If no-one answers the question it may be because there is no answer.
|
|
|
|
|
I didnt get your exact need but still i think you are looking for something mentioned
below:-
Before i answer i have small doubt regarding the type of applicaiton.
so a question.
Whether your application is SDI application with CEditView or
From assumption
If it is CEditView then override OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) function of CView by choosing WM_CHAR from classwizard.
And simply check the character with nChar value.
if it is "s" then simply load the bitmap corresponding to it, but i think CRichEdit will support Bitmap loading.
If Edit box(CEditCtrl) then
Firstly override the PreTranslateMessage of Dialog and
you can use the below code if only one edit box else
get the position to to get the exact edit box before checking for the message WM_CHAR.
BOOL CYourDlg::PreTranslateMessage(MSG* pMsg)
{
if( WM_CHAR == pMsg->message )
{
AfxMessageBox( "sa" );
}
return CDialog::PreTranslateMessage(pMsg);
}
Величие не Бога может быть недооценена.
modified on Wednesday, September 9, 2009 5:39 AM
|
|
|
|
|
Hi all
sorry but i post re-question becouse i havn't got any reply and i need help from form.I am useing ODBC 5.1 Driver for connect to MySQL.It's working fine for XP OS.I am getting error on Window Server 2000.on server 2000 OS i am able to connect but after connection i am getting error.
CString por="Driver={MySQL ODBC 5.1 Driver};";
CString Database="Database="";";
CString User="User=";
CString Userp=root;
CString password=";Password=";
CString Passwords=root;
CString option=";Option=3;";
CString final=por;
final +=Database;
final +=User;
final +=Userp;
final +=password;
final +=Passwords;
final +=option;
CoInitialize (NULL);
_bstr_t strCon(final);
try
{
HRESULT hr = m_pConn.CreateInstance (__uuidof (Connection));
if (FAILED (hr))
{
}
if (FAILED (m_pConn->Open (strCon,bstrString,bstrString1,0)))
{
AfxMessageBox ("Can't open datasource");
}
else
{
MessageBox("There is an error to connect with MySQL. Please check your input parameters or server configuration.","Message",MB_ICONEXCLAMATION);
return;
}
AfxMessageBox ("Connection successfully");
_CommandPtr pCommand;
hr = pCommand.CreateInstance (__uuidof (Command));
"Erro showing here"
if (FAILED (hr))
{
AfxMessageBox ("Can't create an instance of Command");
return;
}
::_RecordsetPtr pRecordset;
pCommand->ActiveConnection = m_pConn;
Plz helpe me.
modified on Wednesday, September 9, 2009 3:47 AM
|
|
|
|
|
Please use the code block button when posting code snippets.
Whenever a COM error happens, the HRESULT return value is quite informative, please report it.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
MsmVc wrote: on server 2000 OS i am able to connect but after connection i am getting error.
So what's the error?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
What is the error you're getting?!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|