|
Yes, having 3 records.
If i comment out return CDialog::OnInitialUpdate() and return TRUE, then I am not getting this assertion failure. Only after the dailog with the listctrl filled with the records, the assertion failure appears.
|
|
|
|
|
try this:
call CDialog::OnInitDialog first in your function (not last). then return FALSE.
-c
Greenspun's Tenth Rule of Programming:
"Any sufficiently complicated C or Fortran program contains an ad-hoc, informally-specified bug-ridden slow implementation of half of Common Lisp."
|
|
|
|
|
|
what happens?
Greenspun's Tenth Rule of Programming:
"Any sufficiently complicated C or Fortran program contains an ad-hoc, informally-specified bug-ridden slow implementation of half of Common Lisp."
|
|
|
|
|
Getting an assertion failure immediately. If I click 'Ignore' button, an message box appears with msg 'unsupported operation was attempted'
|
|
|
|
|
can you step into the function?
Greenspun's Tenth Rule of Programming:
"Any sufficiently complicated C or Fortran program contains an ad-hoc, informally-specified bug-ridden slow implementation of half of Common Lisp."
|
|
|
|
|
I fixed the problem.
The assertion failure is thrown when calling DoDataExchange();
CDialog::OnInitialUpdate() calling CDialog::UpdateData(FALSE) calling CDialog::DoDataExchange(..).
Actually I had an button control in the dialog and an corresponding button variable in the Dialog class and hence the DoDataExchange() had an line containing button variable. Then I removed the Button variable from the resource. But didnot remove from the code.
I tried to remove the button variable from the Dialogs class and DoDataExchange() and thus it worked.
Thanks for your help. Sorry for the trouble.
|
|
|
|
|
Hello,
I would like to send a mail automaticaly from my application in vc++ with a file in attachement.
What's the good way to do it ?
Thanks in advance
DD
|
|
|
|
|
|
Hi guys.
I was wandering if it's possible to have a long text as a resource and then how to show it in a Dialog based application.
Do you have any suggestion to keep the long text inside the final ex file?
Thanks in forwarding.
Jordi
|
|
|
|
|
Put it in your application as a custom resource:
In your .rc2 file
MYTEXT TEXTFILE "Somefile.txt"
To get the text
HANDLE handle = ::LoadResource(hInstance, ::FindResource(hInstance, "MYTEXT", "TEXTFILE")) ;
char *pText = (char *)::LockResource(handle) ;
Roger Allen
Sonork 100.10016
I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.
|
|
|
|
|
Hi,
I need to put together a context menu within an app that can display options that aren't known at compile time. I can create a normal pop-up menu alright I just don't know where to look to
populate the menu with items that are, for instance, defined in a user configurable file.
Any Ideas???
Josh Knox
We will rid the world of buttmunching pussnuts. Armed only with my blunt spoon of death and my circumcising potato peeler. Death and torture to them all. - Michael Martin
|
|
|
|
|
If you are using MFC, you can use CMenu methods like AppendMenu.
Following code snippet loads menu from resources and adds a separator and a dynamic menuitem:
void CMyView::OnContextMenu(CWnd* pWnd, CPoint point)
{
{
if (point.x == -1 && point.y == -1){
CRect rect;
GetClientRect(rect);
ClientToScreen(rect);
point = rect.TopLeft();
point.Offset(5, 5);
}
CMenu menu;
VERIFY(menu.LoadMenu(IDR_CONTEXT_MENU));
CMenu* pPopup = menu.GetSubMenu(0);
ASSERT(pPopup != NULL);
pPopup->AppendMenu(MF_SEPARATOR);
pPopup->AppendMenu(MF_STRING,1111,"Dynamic");
CWnd* pWndPopupOwner = this;
while (pWndPopupOwner->GetStyle() & WS_CHILD)
pWndPopupOwner = pWndPopupOwner->GetParent();
pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y,
pWndPopupOwner);
}
}
If you want the menu completely dynamic, then add a MF_POPUP instead of LoadMenu.
Pavel
Sonork 100.15206
|
|
|
|
|
Thanks Pavel,
That'll work great. My next question is how to map commands to the dynamically added menu items?
Josh Knox
We will rid the world of buttmunching pussnuts. Armed only with my blunt spoon of death and my circumcising potato peeler. Death and torture to them all. - Michael Martin
|
|
|
|
|
Sorry I can't help you, but I had the same problem.
I dynamically create a menu that contain a certain number of IP adresses, like :
_TRAYMENU_
192.168.0.1
62.43.12.10
etc...
and I want to copy the IP to the clipboard when I click on it (I know for the clipborad, but I don't know how to map commands...)
Thanks!
|
|
|
|
|
Look up the DYNAMENU sample in MSDN. It details how to do this stuff.
Josh Knox
We will rid the world of buttmunching pussnuts. Armed only with my blunt spoon of death and my circumcising potato peeler. Death and torture to them all. - Michael Martin
|
|
|
|
|
Add an ON_COMMAND or ON_COMMAND_RANGE macros to the message map section of the class where you want to catch them:
BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
ON_WM_CREATE()
ON_COMMAND(ID_VIEW_DLLTEST, OnViewDlltest)
... and other macros added by class wizard
ON_COMMAND(ID_xxxx, OnXxxx)
END_MESSAGE_MAP()
You also need to add the void OnXxxx() method to your class.
Pavel
Sonork 100.15206
|
|
|
|
|
Hello everybody:
I want a function to be exectured when I press CTRL + Click over a bitmap image in a Dialog. I know how to do that when I to a Ctrl + Click over the Dialog itself using the OnLButtonDown() function. What do I need to do to make it happen by just clicking the bitmap image? Any answer is more than welcome.
Regards,
Luis E. Cuadrado
)
|
|
|
|
|
Place the bitmap in a static text control on your dialog. Give the control a unique ID and set the notify style for it. You can then write a handler for BN_CLICKED for the static control and check to see whether the control key is pressed (GetKeyState(VK_LCONTROL) || GetKeyState(VK_RCONTROL))
Roger Allen
Sonork 100.10016
I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.
|
|
|
|
|
Hello:
I tried what you told me and this is what I put in my code:
void CMyClass::OnPicClicked() <br />
{<br />
<br />
if ((GetKeyState(VK_LCONTROL) || GetKeyState(VK_RCONTROL)))<br />
{<br />
}<br />
}
Does that looks correct? I run my application and it doesn't work.
Thank you for your reply.
Regards,
Luis E. Cuadrado
)
|
|
|
|
|
In my previous post I told you that I didn't work. I take that back. It works. I forgot to set the notify style for the CStatic. Works perfect. Thank you very much.
Regards,
Luis E. Cuadrado
)
|
|
|
|
|
Filedownload event is not caugth or not thrown.
I cannot catch it.
Anyone knows the solution????
Thanks
|
|
|
|
|
hio!
i have a split view that i am using, and whenever i replace any view i set the documents title.. the problem is that when i click inside of a field in any of these views the title somehow gets set to the filename of the document (which i beleive is the default of CDocument::SetTitle )
any suggestions? here is an example of how im setting the title:
void CMainFrame::ShowHeader()
{
CView* pView = GetActiveView();
CMyDoc* pDoc = (CMyDoc*)(pView->GetDocument());
m_wndSplitter.ReplaceView(0,0,RUNTIME_CLASS(CHeaderView),CSize(500,HEADERHEIGHT), pDoc);
SetDocTitle(pDoc, pDoc->m_pComp, pDoc->m_pLoc);
m_wndSplitter.LockBar(false);
}
the SetDocTitle() just calls the document's set title function with it formatted the way i want it to look..
-dz
|
|
|
|
|
Hi,
Iam using CDhtmlDialog class.
How can I trap newWindow ?.
Iwant open the new window using my own browser dialog not the IE browser.
Thanks
|
|
|
|
|
I have a COM dll and I am using the libs from Office 2000. When the user hits a button, I open Word. When I open word, sometimes there is text that the user wants to edit so I put the text in a file, then put this filename in the CreateProcess function call so that Word will open this file. But I am having on irritating issue. Every time I do this with Office 2000, I keep getting the messagebox "Do you want to revert to the saved document" right when Word opens. I have tried several things and nothing seems to work so that this message box doesn't appear and Word just goes ahead and opens the file like I want it to. Does anyone have any idea how I can stop this messagebox, do you think there is something wrong with the way I am opening Word, or perhaps is there something wrong with the way I am saving the word document??????
|
|
|
|