|
|
I've derived my propertysheet classes from a class, which has implemented RemovePage as:
void cdxCDynamicPropSheet::RemovePage( cdxCDynamicPropPage & rPage )
{
ASSERT(rPage.m_pSheet == this);
rPage.m_pSheet = NULL;
}
but there's no implementation for CPropertySheet::RemovePage(int nPage)
I'd like to know how I can implement that.
|
|
|
|
|
mfc_surfer wrote:
but there's no implementation for CPropertySheet::RemovePage(int nPage)
Have you looked in DLGPROP.CPP? It's implemented there.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hello , ive got the following member function pointer problem noting that all my search result on the net wasn't useful at all.
class MyClass
{
Anotherclass MyObject;
void Function1();
void FunctionNeededPointer(Float*,int,int);
};
void MyClass::Function1()
{
//Here i need to pass a pointer of a function to the
//following function belonging to MyObject
//void Anotherclass::Function(void *aFunction,void
// *callingObject=NULL)
//so i tried this and didn't work
void (MyClass::*pToFunction)(float*,int,int)
= &MyClass::FunctionNeededPointer;
MyObject.Function((void*)pToFunction);
//oops error: cannot convert from void(__thiscall
// Myclass::*)(float*,int,int) to void*
//So had to make that function static and worked but
//it ended up that every thing in MyClass was converted
//to static which is not a nice solution at all
//so i'm wondering if someone could help with this
//problem
}
|
|
|
|
|
With classes you have two options:
1) make function static, so that all objects of the type MyClass reference the same static function. In this case you can use MyClass::FunctionNeededPointer
2) Function you are trying to pass is not static.
To pass function pointer you should use something like "this->FunctionNeededPointer", since function obviously has very little meaning outside of class scope...
3) Here is how you can define function type
typedef void (MYFUNCTION)(float*,int,int);
void Function(MYFUNCTION *p);
{
Function(&this->FunctionNeededPointer);
}
Brian
|
|
|
|
|
Thanks for your reply, but i forgot to mention something that i haven't got any control on the function
Function(void *aFunction , void *callingObject=null) as it came with a header file of a library and i've got to use it as is, besides when i try to use
&this->FuctionNeededPointer it gives the following error
'&' : illegal operation on bound member function expression
|
|
|
|
|
i develop almost all of programs under win95 because we can sell to more customers.
i don't think there is any important reason to develop under xp, 2k etc.
if you use xp, 2k..., do you find some significant contributions of those OS related to C++?
includeh10
|
|
|
|
|
includeh10 wrote:
i develop almost all of programs under win95 because we can sell to more customers.
Does this mean you run your Visual C++ and tools under Win95 as well!
includeh10 wrote:
i don't think there is any important reason to develop under xp, 2k etc.
XP and Win2k and NT 4 are much more stable for developing on. If you app crashes in 9x then it is possible that it'll bring the entire OS down. For me this meant time consuming reboots which is why I did/do all my developing on NT based OS.
Testing apps to make sure they run on 9x is fine, developing on 9x is a little silly if you ask me.
Michael
Blue canary in the outlet by the light switch
Who watches over you
Make a little birdhouse in your soul - They Might Be Giants
|
|
|
|
|
Michael P Butler wrote:
Testing apps to make sure they run on 9x is fine, developing on 9x is a little silly if you ask me.
I agree. The two contract jobs I worked on prior to my current one required me to develop on Windows 95 and 98 respectively. Both were disastrous for developing on, re: crashes and frequent reboots.
Of course, with the latest VC++ you can't develop on Win 9x anyway.
Kevin
|
|
|
|
|
1. Your point one is invalid since there is nothing that precludes you from developing on NT and then running on 9x.
2. NT is a much better development environment since it doesn't suffer the stability issues of 9x.
3. C++ isn't tied to an operating system. It is a question of environment quality. 9x contributes nothing to C++.
There is NO reason to develop on 9x. It doesn't provide you with a wider install base since NT program can run on 9x as long as you don't take advantage of the advanced functions. There is even UNICODE support for 9x via MSLU.
9x is not a development quality operating system.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Two reasons to work on 2K / XP.
1) more stable
2) Alot more GUI controls you can use. (you can also incorporate DirectX if you are doing Sound or Video Editing tricks)
|
|
|
|
|
NT = 2K = XP
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Over the years I have developed on all the operating systems. There are only 3 things I can tell you:
1) Years ago I used to have the believe that if you could get an app to compile on old 95/98 machines it would have a better chance of working without modification on newer OS (NT). You would be supprised at how many developers ignore the footnotes for a function at the end of the MSDN literature that specify what operationing systems support them only to get burned later. Lately though I have decide to develop on the latest OS because of the next paragraph. Read on...
2) I have noticed that an application developed on 2000 using VC7 produces a GUI appearance that looks the same on 2000 and XP (that is the old style buttons etc.). Whereas the same application developed on XP will have the newer buttons (mouse hover hite etc..)and interface appearance when viewed on XP and the older but standard appearance on 2000.
3) Visual studio.Net won't work on anything older than 2000 so you might as well forget the older OS for developing.
Art
|
|
|
|
|
I want to programmatically control the mouse cursor- like they do in all those playback demos and stuff like that. The mouse cursor should not only move to the coordinates defined in the program, but also click.
Secondly, how can I do the same for keyboard? I mean, I should be able to issue keyboard key commands from a program.
Thanks for your help.
http://www.atanveer.com
|
|
|
|
|
Well as far as the keyboard goes, normally you'd be doing that all internally anyway. For instance, let's say you're writing a game in which the up-arrow key moves a character forward. Well, you're already going to have written a function like MoveForward which is called from the up arrow key. If you want to simulate this behavior, just call MoveForward from somewhere else,, the key itself is irrelevant.
It's the same with the mouse cursor, except that now you want to display something to the screen. You could simulate this with your own image of a mousecursor moving to the button and clicking - I'm not certain how to actually take the cursor away from the user programmatically and move it where you want, but it shouldn't be terribly difficult I think.. but the only part you need to worry about is what it looks like on the screen. Otherwise just call whatever function you call when you catch the button-click, you don't actually need the mouse to click per se. I know I didn't answer everything but I hope I helped somewhat at least.
Kelly Ryan
|
|
|
|
|
See Keyboard(Mouse) Input Functions in msdn and arbitrary keybd_event & mouse_event
|
|
|
|
|
Hi,
I am writing a DLL(general purpose plugin) for winamp.In this I want to write the details of the song into a file whenever the song changes. I used FILE *fp=fopen(file,"w") to open a file but it is giving errors. How should I open a file to write into?
Karteek
|
|
|
|
|
CString stmpfilename,sMyText;
tmpfilename = "C:\\my.txt";
sMyText = "Hello World\r\n";
CFile f;
if (f.Open(tmpfilename, CFile::modeCreate | CFile::modeWrite | CFile::shareDenyWrite))
{
f.Write(sMyText, sMyText.GetLength());
f.Close();
}
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
HI,
I tried CFile also.I wrote the same code and included afx.h.But it is giving errors.I included afx.h
KArteek
|
|
|
|
|
What is the exact error you got? You probably need to catch file exceptions.
|
|
|
|
|
OK
This seems strange.
You said the you included afx.h
Try this please
#include <afx.h>
char* pFileName = "test.dat";
TRY
{
CFile f( pFileName, CFile::modeCreate | CFile::modeWrite );
}
CATCH( CFileException, e )
{
#ifdef _DEBUG
afxDump << "File could not be opened " << e->m_cause << "\n";
#endif
}
END_CATCH
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
And those compiler/linker/runtime errors are?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi,
when I delete a listbox item it seams the top index is set to 0, is this a normal behaviour? Can I switch this off or is there any good workaround?
Thanks for help, Moak
Here is a little MFC code snippet to produce the effect:
<br />
BOOL CTest1Dlg::OnInitDialog()<br />
{<br />
CDialog::OnInitDialog();<br />
<br />
for(int t=1;t<20;++t)
{<br />
CString sText;<br />
sText.Format("listbox line %d", t);<br />
m_list.AddString(sText);<br />
}<br />
m_list.SendMessage(WM_VSCROLL, SB_BOTTOM, NULL);
<br />
return TRUE;<br />
}<br />
<br />
void CTest1Dlg::OnButton1() <br />
{<br />
m_list.DeleteString(0);
<br />
}<br />
|
|
|
|
|
void CYourApp::OnDelete()
{
CString tmp;
int nCurItem = m_ctrlMainList.GetCurSel();
m_ctrlMainList.GetText(nCurItem,tmp);
if (nCurItem != LB_ERR)
m_ctrlMainList.DeleteString(nCurItem);
UpdateData(FALSE);
}
Call it and see if the abhorant behavior continues.
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
use code as:
int iSel=m_list.GetCurSel();
//delete
m_list.SetCurSel(iSel);
includeh10
|
|
|
|