|
Try this:
CString csTemp;
csTemp.Format(_T("Save \x26 Exit"));
btn.SetWindowTexct(&csTemp);
INTP
|
|
|
|
|
Never mind I found the problem... it does actually work using "&&" in the string if you use a standard button control, but the custom button control I am using apparently is not handling the & correctly.
thanks anyway.
|
|
|
|
|
Hello,
I developed an ActiveX control for Internet Explorer. I need that control to call JavaScript / VBScript functions on its hosting HTML page.
I looked for information about this in the internet, but haven't come up with something truly useful so far.
Any pointers?
Thanks in advance!
|
|
|
|
|
Search MSDN for "VBScript ActiveX accessing" you should find approximatly 162 aticles. The article ActiveX (partial book) looks like it might provide the answer you are looking for.
INTP
|
|
|
|
|
Thanks for the reply!
Unfortunately, I couldn't find any entry that resembles "ActiveX (partial book)". Can you please give me a direct link?
Thanks!
|
|
|
|
|
It should be on the MSDN CD, I dought that it could be found via the internet.
INTP
|
|
|
|
|
Hello,
Just after adding a new class CDailyListView based on the CListView class, I get the following errors... this one has me stumped, but I'm sure it's some simple and stupid solution. I've tried rebuilding all files to no avail. Another working program I have doesn't have any #includes at the top (to find the CListView class in MFC). Thanks! JennyP
<br />
DailyListView.cpp<br />
c:\documents and settings\mahafjp\my documents\programming\goals1\dailylistview.h(14) : error C2504: 'CListView' : base class undefined<br />
c:\documents and settings\mahafjp\my documents\programming\goals1\dailylistview.cpp(17) : error C2440: 'return' : cannot convert from 'class CDailyListView *' to 'class CObject *'<br />
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast<br />
c:\documents and settings\mahafjp\my documents\programming\goals1\dailylistview.cpp(17) : error C2653: 'CListView' : is not a class or namespace name.<br />
etc....
Here's the code:
<br />
#if _MSC_VER > 1000<br />
#pragma once<br />
#endif // _MSC_VER > 1000<br />
<br />
<br />
class CDailyListView : public CListView<br />
{<br />
protected:<br />
CDailyListView();
DECLARE_DYNCREATE(CDailyListView)<br />
<br />
public:<br />
<br />
public:<br />
<br />
etc.....
|
|
|
|
|
I am not quite sure if this will fix your problem but is afxcview.h included anywhere in your project? If not, try including it in your stdafx.h file.
Artificial intelligence is no match for natural
stupidity.
|
|
|
|
|
I can think of 3 possibilities: 1) you included CDailyListView.h before stdafx.h, 2) your source file did not include stdafx.h, or 3) AfxCView.h is not included for some reason.
Possible solutions:
1) Make sure stdafx.h is the first file included at the top of the source file.
2) Since it is some times difficult to determine all the headers files included indirectly thru other header files, you could manualy add AfxCView.h to the stdafx.h. (recomended)
3) You could include AfxCView.h in your header file before the class definition.
INTP
|
|
|
|
|
Thanks for the advice! I put the following code at the top... not sure why one program builds without it and this one doesnt... ? Thanks again! JennyP
<br />
#ifndef __AFXCVIEW_H__<br />
#include "Afxcview.h"
#endif<br />
|
|
|
|
|
Hello all.
I am wondering if someone could give me a step in the right direction. I have created a simple dialog-based application. I have also created another dialog for the configuration screen. I can call this dialog just fine by declaring a variable of it and calling doModal() and it works great.
Now, what I am wondering is the best way to "share" the data between the two of them. For instance, this is what I was doing now (and it don't work!). I had created some protected variables on the CONFIG dialog. I've also created some methods such as isConfigured(). In my main dialoag, I was doing something of this nature:
ConfigureDialog myConfigDlg;
myConfigDlg.readConfiguration();
if ( myConfigDlg.isConfigured() ) {
...
}
etc...
Now that appears to work great except for one thing. I had put this into my OnInitDialog() method for the main dialog ... so when the main dialog starts, it reads the configuration and makes sure everything is OK.
I also need to access this configuration during button presses on the main dialog. So, what I did
is in my onBnClicked() method, I put another ConfigureDialog myConfigDlg; in there and straight-way checked one of the variables with its method, and it did not "save over the data". I have since realized that I've only created an instance of this dialog. (Somewhat new to OOP). So, when the program left the OnInitDialog method, it destroyed that instance so all that data that it read is long gone.
So, what I am wondering is what may be the best way for me to go ahead with a configuration routine? I kind of wanted to have one class, which was the configure class, that did all of the reading/writing/etc of the configuration file. But the question is, how can I instantiate that class one time in my main dialog (for instance during OnInitDialog() ) and then keep it "in scope" for that entire dialog to read?
Hope I explained that enough! Thanks in advance for the replies.
|
|
|
|
|
Just to be real clear on what I'd like to do.
App starts. Main dialog is initialized.
Configure dialog is somehow instantiated.
I call configuredlg.readConfig()
On the main dialog I press "begin processing"
I call configuredlg.getTemporaryPath();
... at this point, I do not want it to have to read the configuration file again to get this information. I want to have it stored one time in a protected/private variable within the class after I called .readConfig().
so pretty much
CString CSConfigureDlg getTemporaryPath() {
return theTempPath;
}
I am also wondering, can I solve my problems (would this be the best way) in my main dialog .h header file, just to create a variable of type CSConfigureDlg() ??
|
|
|
|
|
Here are a couple of possibilities: 1) Declare your dialog object globaly, then you could access it from any where and keep/access the infomation stored in it via that object (Example: g_CfgDlg.GetWhatEver()), 2) Declare your dialog object as a member of your main dialog or application class for the same reasons as in 1 above.
INTP
|
|
|
|
|
Keep the config data in your main class, as an instance of another class and make it visible to the config dialog, probably by passing it in through the constructor, and visible in the dialog class, so that it can be grabbed back when the dialog is closed. Something like this:
class ConfigData
{
// config stuff here
}
class MainDialog
{
private ConfigData m_configData;
// Read in oninitmethod
private void OnClickShowConfig()
{
MyConfigDialog dlg(m_configData, this);
if(dlg.DoModal() == IDOK)
{
m_configData = dlg.configData;
}
}
}
The config dialog saves the changed data to disk, and has only got a constructor which takes the config as well as the usual parameters with defaults ( parent dialog, etc. That what the this is being passed in for, the parent window )
My MFC is VERY rusty, two years since I used it. But that should be the general idea.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Has anyone here used the extended mapi interface? and if so do you know what has to be changed to use the GUID's that are declared in mapiguid.h? I have included everything the MSDN library specifies and have even defined the proper defines, but when I build I get the following error:
EmailMessage.obj : error LNK2001: unresolved external symbol _IID_IMessage
Can anyone help me?
|
|
|
|
|
#include <initguid.h>
or
#define INITGUID
|
|
|
|
|
I included mapiguid.h mapix.h and #defined initguid and uses_iid_imapimessage and when I build I still get the error on the link.
|
|
|
|
|
How about MapiDefs.h
Thank You
Bo Hunter
|
|
|
|
|
I included that as well and several other of the mapi includes. the error seems to be an issue of the lib files linked, but I included uuid.lib, mapi32.lib, ole32.lib, and oleaut32.lib.
|
|
|
|
|
Hi,
I'd like to know how I can draw simple 2D Shapes like Rectangles, Triangles, Boxes, Circles with Microsoft Visual C++ 6.0 in DOS ? Is there something like a "dosgraphs.h" header file with pre-defined prototypes for drawing such objects ? If there is something like this where can I get a tutorial ?
Thanks in advance
Tolga
|
|
|
|
|
This is not possible because VC++ 6.0 cannot create a DOS application. It can create a console application, but this is not the same thing. To do this, you’d need an older version of VC++ (like say 1.x or 2.x). Furthermore, DOS uses the concept of different screen modes to display graphics; a Windows console app does not support this. Yes, Windows can run a DOS app (like some games), but these are two different things.
However, VC++ 6.0 can work very well with Windows graphics using the GDI, OpenGL, DirectX, etc. But, if it must be DOS then look for an older version of VC++ first.
Jeremy Falcon
|
|
|
|
|
Well actually the program I wrote opens up in a DOS Console and all the data is input from the DOS Console, but could I do something like this: use the gl.h to create the 2D shapes which open up in Windows ?
Tolga
|
|
|
|
|
I created a simple app using the wizard. It was a dialog based app. It works fine, but does nothing expect close when you hit the button. However, I have a problem when I add a Rich Edit control. The app compiles fine, but the app window does not appear when I run it. Nothing happens. I stepped through the code and found it exits at a DoModal call. What's up? Thanks.
|
|
|
|
|
AfxInitRichEdit() needs to be called.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|