|
zhdleonid wrote:
CMyFindDlg dlg; // i want to declare the Class CMyFindDlg object
First, MSDN says: "CFindReplaceDialog objects are constructed on the heap with the new operator".
Maybe doing so with your class may help?
CMyFindDlg* pDlg = new CMyFindDlg(); Second, you cant make a CMyFindDlg without parameters, because you have no constructor defined that uses no parameters. This is what the compiler is saying here:
": error C2512: 'CMyFindDlg' : no appropriate default constructor available". Call your constructor with any constructor arguments you need, construct the CFindReplaceDialog without parameters (as you do) and store the parameters in member vars of CMyFindDlg until you need them.
Third, as the MSDN states in the article about CFindReplaceDialog ,
you show the dialog using the Create() -function.
Do this when calling your dialog (and override this function as neccesary).
Hope this helps
--
"My opinions may have changed, but not the fact that I am right."
Found in the sig of Herbert Kaminski
|
|
|
|
|
Thanks all you say.
i know why it has an error.
but i don't konw how to make it right.
i try :CMyFindDlg* pDlg = new CMyFindDlg();
but it isn't right.
so i will do as it have parameters.
for example:
if I New a class CMyFindDlg base on the class CFindReplaceDialog
when i use the new class CMyFindDlg to define a object in the CMainFrame.
i will do :
void CMainFrame::OnFind()
{
// TODO: Add your command handler code here
CMyFindDlg dlg(...) //here ,how to write? can you help me?
}
wait you.
i feel good.
|
|
|
|
|
Try something like this:
void CMainFrame::OnFind()
{
CMyFindDlg* pDlg = new CMyFindDlg(..you parameters..);
pDlg->Create(..parameters that CFindReplaceDialog::Create needs..);
} This Way you first construct your Object, giving it the parameters it needs, and later display it, using the parameters that create needs.
You did #include < afxdlgs.h > ? MSDN says there are the headers for CFindReplaceDialog.
Hope this helps
--
"My opinions may have changed, but not the fact that I am right."
Found in the sig of Herbert Kaminski
|
|
|
|
|
but i don't how to over write the CFindReplaceDialog::Create
in the NEW Class CMyFindDlg.
i try:
//in CMyFindDlg.hF
BOOL Create(BOOL bFindDialogOnly,
LPCTSTR lpszFindWhat,
LPCTSTR lpszReplaceWith = NULL,
DWORD dwFlags = FR_DOWN,
CWnd* pParentWnd = NULL);
//in CMyFindDlg.cpp
CMyFindDlg::Create(BOOL bFindDialogOnly, LPCTSTR lpszFindWhat,
LPCTSTR lpszReplaceWith, DWORD dwFlags, CWnd* pParentWnd )
{
return TRUE;
}
when i use :
void CMainFrame::OnFind()
{
// TODO: Add your command handler code here
CMyFindDlg* pDlg = new CMyFindDlg();
pDlg->Create( TRUE, "", "", FR_DOWN, this );
}
to do
it run CMyFindDlg::Create() ,not the CFindReplaceDialog::Create.
-------------------------------------------------------------------
i feel good.
|
|
|
|
|
zhdleonid wrote:
error C2512: 'CMyFindDlg' : no appropriate default constructor available
This means you're trying to build your object, somewhere, but do not provide a constructor that has no arguments. Actually I thought the compiler wrote you one if you did not provide it, so it's more likely the default constructor is private, meaning you cannot access it.
zhdleonid wrote:
: CFindReplaceDialog()
Of what use is this, seeing as you don't pass in anything ? Does CFileReplaceDialog have a default constructor ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
dose the class CFindReplaceDialog defined in
#include <afxdlgs.h>????
i feel good.
|
|
|
|
|
It's an MFC dialog, it will be defined in the MFC source, which comes with VC. Do a find in files for CFindReplaceDialog:: and you'll find the source.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Instead of using (c) in the About box I used the real symbol ©.
On my machine and a lot of others it is perfectly visible.
But, I have a colleague (who runs XP) who doesn't see that symbol
in the about box. Instead he sees a '?'.
Also, when he opens my project in MSDEV, he can't see the ©,
but again sees a '?' instead.
When he looks e.g. at the about box of Outlook the © is perfectly visible.
Any ideas on how to solve this?
Thanks.
|
|
|
|
|
What font are you using?
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 Rickard,
I'm using the standard MS Sans Serif (size 8).
So, it's not that this symbol doesn't exist in that font.
Thanks for your reaction.
Geert.
|
|
|
|
|
strange, perhaps have a look into your .rc file ? any strange things or unwanted code page (language local)?
|
|
|
|
|
Nothing suspicious.
Language is English (U.S.) and the © character is perfectly visible.
Must be something with XP I guess.
Geert.
|
|
|
|
|
How can I make a DialogBase Program with no TaskBar Button.
I can make it by StatusBar icon;). But i can't remove it's TaskBar button .
Plaese guid me how do I it.
THANKS.
|
|
|
|
|
have a look at this[^] article
Cheers
Kannan
|
|
|
|
|
hi,
I'm not able to execute script using IHtmlWindow2 as execScript function fails..for e.g thr following code returns failed..
BSTR bstrCode = ::SysAllocString(L"MsgBox \"Hello there\"");
BSTR bstrLanguage = ::SysAllocString(L"vbscript");
VARIANT var;
VariantInit(&var);
hr = pWindow->execScript(bstrCode, bstrLanguage, &var);
if(SUCCEEDED(hr))
AfxMessageBox("success!!");
else
AfxMessageBox("failed !!");
Can anyone Help me with this?The IHTMLWindow2 is successfully created and its other functions like pWindow->alert(.. work correctly in this same code.
thanx in advance,
viraj
|
|
|
|
|
Hi,
I've Created an ActiveX container application by selecting container in the third step of the Wizard of to make an SDI Application. I'm able to Insert ActiveX Objects into the Application. they look real great. The problem is the window Messages like Left Mouse Button Click MouseMove etc.. are not being sent to the control as a result it just appears to be doing nothing but appear as images. is there any method that would enable the controls to recieve User Interface messages. Would be very thankful for helping out.
Thank You
|
|
|
|
|
Hi,
I've Created an ActiveX container application by selecting container in the third step of the Wizard of to make an SDI Application. I'm able to Insert ActiveX Objects into the Application. they look real great. The problem is the window Messages like Left Mouse Button Click MouseMove etc.. are not being sent to the control as a result it just appears to be doing nothing but appear as images. is there any method that would enable the controls to recieve User Interface messages. Would be very thankful for helping out.
Thank You
|
|
|
|
|
I have a drop-down list style combo box control in my program, with about 10 items in it. In XP, when it is dropped down, it shows all the items at once, like I want it to. But in 98, it only shows one item, with tiny up and down scrollbars to show the other items. Why does it do that? How can I make it show all the items at once?
Thanks!
|
|
|
|
|
Did you try extending the Combo Box's drop down length at design time.
By default it displays the tiny scrollbar as if there is only one item.
Cheers
Kannan
|
|
|
|
|
I can only make it wider in the dialog editor
|
|
|
|
|
Nevermind, I figured it out
|
|
|
|
|
This probably sounds like an ridiculously simple question but the DirectX 8.0 docs read like stereo intructions:
Once I have created an IDirect3DTexture8 texture in DirectX 8.0, how do I go about setting the color and alpha channel of individual pixels in that texture if I do not want to do so by loading an image file? (Actually, I am loading an image file but it's in a special format so I can't use any of the DirectX LoadImage functions.)
|
|
|
|
|
Calling SHGetSpecialFolderPath with CSIDL_WINDOWS and with CSIDL_DESKTOPDIRECTORY works fine in Windows XP, but in Windows 98 (SP1, IE6 SP1) CSIDL_WINDOWS doesn't work. Why is that? Is there a better way to get the user's Windows directory?
Thanks!
|
|
|
|
|
IGx89 wrote:
Calling SHGetSpecialFolderPath with CSIDL_WINDOWS and with CSIDL_DESKTOPDIRECTORY works fine in Windows XP, but in Windows 98 (SP1, IE6 SP1) CSIDL_WINDOWS doesn't work. Why is that?
According to MSDN, usage of CSIDL_WINDOWS requires Shell32.dll v5.0, i.e. at least Windows 2000 or Windows Millenium.
IGx89 wrote:
Is there a better way to get the user's Windows directory?
Try following:
TCHAR szWinDir[MAX_PATH+1] = {0};
GetEnvironmentVariable(_T("windir"), szWinDir, MAX_PATH);
Regards
Thomas
Sonork id: 100.10453 Thömmi
Disclaimer: Because of heavy processing requirements, we are currently using some of your unused brain capacity for backup processing. Please ignore any hallucinations, voices or unusual dreams you may experience. Please avoid concentration-intensive tasks until further notice. Thank you.
|
|
|
|
|
IGx89 wrote:
Is there a better way to get the user's Windows directory?
How about the standard, old GetWindowsDirectory(...) function?
BTW: I do not believe that Win9x supported different/shared Windows/System directories a'la Win2K or later.
Peace!
-=- James (Sonork:100.21837)
[Tip for SUV winter driving survival: "Professional Driver on Closed Course" does not mean "your Dumb Ass on a Public Road"!] [Get Check Favorites 1.5 Now!]
|
|
|
|