|
Hi !
I have a small problem that I cannot figure out, when I add for example a menu to an MFC project and then type in the id in the property list "ID_VIEW_MYWINDOW" for example, everything look's fine but the value of ID_VIEW_MYWINDOW is zero (0), so to make it work I have to edit the resource.h file and change it to a working value myself, this happens all the time, both with old VC 6 projects converted to VS.NET and new projects.
Am I the only one with this problem ? (I have the same problem on two different computers).
Any ideas on what's going on would be helpful here.
|
|
|
|
|
Why does this control flicker so much? Is there anyway to get rid of the flicker?
Does MSKB address this issue? I've noticed many apps use this control (IWebBrowser2 anyways) and many if not all flicker except...outlook and IE.
Thanks
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
Hi,
Another problem..
I want to have a modeless dialog that will close if it loses focus. This dialog is open from another dialog. So in a dialog a have a button that does this OnClick:
CAnotherDialog *newDlg;
newDlg = new CAnotherDialog(this);
if (newDlg != NULL) {
BOOL ret = newDlg->Create(IDD_SOMEDIALOG,this);
newDlg->ShowWindow(SW_SHOW);
}
In CAnotherDialog a have a overrided the method OnKillFocus and declared ON_WM_KILLFOCUS() in the message map but this method gets executed when I close the dialog, not when it loses focus.
Thanks!
-----
We are what we repeatedly do. Excellence, then, is not an act, but a habit.
|
|
|
|
|
Try handling the WM_ACTIVATE message instead. The dialog usually doesn't have the focus; one of its child controls has it. I used this method on a project with some automated popups in a touch screen application. Touching 'away' from the popup caused it to close automatically.
Software Zen: delete this;
|
|
|
|
|
Thanks! It works.
If someone else needs this, the function looks like this:
void CMyDialog::OnActivate(UINT nState,CWnd *pWndOther, BOOL bMinimized) {
if (nState == WA_INACTIVE)
CDialog::OnCancel();
}
-----
We are what we repeatedly do. Excellence, then, is not an act, but a habit.
|
|
|
|
|
happy new year, all!
don't play ur C++ today, take a rest!
includeh10
|
|
|
|
|
Happy new year!
I'm still playing today.
-----
We are what we repeatedly do. Excellence, then, is not an act, but a habit.
|
|
|
|
|
Hi folks,
I'm gonna build a GUI which works with XML for a class Project. How can I go about it? Any Pointers are welcome.
|
|
|
|
|
Do you mean use XML to drive gui creation? Or gui manipulation on the fly with XML? Or do you mean manipulate XML from a gui?
Either way one you'll probably want to use some kind of XML parser. You mentioned Visual C++ so I'm assuming you're talking about VC++ 6.0. If that's the case then there are plenty of XML parsers you could use. Do a google search for MSXML4.0 or Xerces. There's some others but I can't remember them right now. You may also want to check W3C for XML parsers and tutorials. I personally use MSXML4.0 though some people snicker at the idea. It suits my needs fine.
If it's the GUI part you need help with there are plenty of articles here on CodeProject that can give you a good start.;)
nay
|
|
|
|
|
Anonymous wrote:
I'm gonna build a GUI which works with XML for a class Project. How can I go about it? Any Pointers are welcome
If you are allowed to, use the Xml classes from the .NET framework. Not only it's an incredible product quality/price ratio, it also makes you take your distance from the bullish msxml parser (former MS Xml sdk).
In addition, you can fill the .NET tabular datagrid control with Xml content, from/to flat files or databases. This can shorten the dev time.
|
|
|
|
|
See http://www.ltpb.8m.com/tutorial[^] I have written many articles on using XML and with VC++.
-Steven
CP Addict
By reading this message you are held fully responsible for any of the mispelln's or grammer, issues, found on, codeproject.com.
For those who were wondering, actual (Linux) Penguins were harmed in creating this message.
|
|
|
|
|
Reading/Writing XML data?
I use XML DOM for that. See MSDN Library for more info.
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Hi,
happy new year to all...
i want to create a tabbed dialog. I can't find anything. also I am unable to use property sheets as i don't know anything about it. but i guess tabbed dialogs would be better because i have to add functionality to both of the tabs and also i want to appear in my color way. Any suggestions..please..thanx in advance..
Himanshu
|
|
|
|
|
|
hi,
I have problems trying to use CRecordset class.. or maybe I don't need to use it. I want to select some rows from a table. I managed to do some inserts like this:
CDatabase *bd;
CRecordset *rs;
bd = new CDatabase();
bd->Open(_T("MySQL-DSN"),FALSE, FALSE, _T("ODBC;UID=admin;PWD=sa;Database=mydatabase"));
bd->ExecuteSQL("INSERT INTO logs (Action,Data) VALUES (\"Starting...\",NOW())");
For the select I try to use CRecordset like this:
rs = new CRecordset(bd);
rs->m_nFields = 1;
sprintf(sqlbuff,"SELECT UserID FROM users WHERE Login=\"%s\" AND Pass=\"%s\"",user,params);
rs->Open(CRecordset::snapshot,sqlbuff);
cout << rs->GetRecordCount();
but the program crashes. What am I doing wrong?
Thanks.
-----
We are what we repeatedly do. Excellence, then, is not an act, but a habit.
|
|
|
|
|
I am trying to make a context menu appear when the user right clicks on a static control. I can get left click messages, no problem, but for some reason right clicks are verboten.
Please don't tell me that I have to go through all that sub-classing crap for one message.
Thanks,
Aaron
|
|
|
|
|
I assume you have tried creating it with a SS_NOTIFY style?
Otherwise you could tyry using a "read only" CEdit control.with no frame.
|
|
|
|
|
Hi:
I opened an MFC Sample and I would like to see code of Member Functions and Messages of Object IDs but when I double click for example a Command Button it shows a Dialog Box that asks if I want to Create a New Class or to Select an exisisting class and then... I don't know what to do from here ( because the MFC Wizard doesn't have Messages neither Member Functions.
Please, I really need help from anyone.
Greetings and Happy New Year.
This is the strangest life I've ever known.
|
|
|
|
|
I'm confused. Can't you just scroll down to the function your looking for?
If you have a problem with my spelling, just remember that's not my fault. I (as well as everyone else who learned to spell after 1976) blame it on Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
Hi,
I finally got around to re-installing my compilier after a good ol' virus attack. Sadly, everytime I run VC++ I get an error that says it can't find "winresrc.h".
Could someone send me this file?
Thanks,
~ Selevercin
If you have a problem with my spelling, just remember that's not my fault. I (as well as everyone else who learned to spell after 1976) blame it on Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
Here's the file:
/*++ BUILD Version: ???? Increment this if a change has global effects
Copyright 1990 - 1998 Microsoft Corporation
Module Name:
winresrc.h
Abstract:
This module defines the 32-Bit Windows resource codes.
Revision History:
--*/
#ifndef _WINRESRC_
#define _WINRESRC_
#include <winuser.rh>
#include <commctrl.rh>
#include <dde.rh>
#include <winnt.rh>
#include <dlgs.h>
#include <winver.h>
#endif /* _WINRESRC_ */
|
|
|
|
|
hi I have a MDI app. I want to define a struct like typedef struct{vars...}s1; and have private s1 struct variables in my view classes. Where is the best place to put typedef block in the code? If I put in stdafx.h then I need to include stdafx.h in all my view headers but I don't want it.. And If I write typedef struct.. block in my view classes' header then I get "Illegal pure syntax must be '=0'" what is the problem?
my struct type:
typedef struct{
int n = 1; char * label = "VAB";
}s1;
My view class:
class CView3 : public CView
{
...
private:
s1 s;
...
};
|
|
|
|
|
class CView3 : public CView
{
private:
class s1
{
public:
int n;
CString label;
s1() : n(1), label("Yadda") { }
};
s1 s;
};
"You can stand all night at a redlight anywhere in town, hailing Marys left and right but none of them slow down. I've seen the best of men go past. I don't wanna be the last..."
|
|
|
|
|
The problem is you're putting variable initialization where it doesn't belong.
typedef struct
{
int n = 1; char * label = "VAB";
} s1; Doesn't make sense, the typedef struct means you're declaring a struct type and a new name for it. What I think you meant was:
typedef struct
{
int n; char* label;
} s1 = { 1, "VAB" }; but this makes a global variable s1 . Move the s1 into your view class and initialize its members in the view constructor.
--Mike--
When 900 years old you reach, look as good you will not. Hmm.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
both comments were very helpful thanks
|
|
|
|